Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macos codecov uploader fails on Appveyor #756

Closed
adswa opened this issue Sep 10, 2024 · 4 comments · Fixed by #752
Closed

Macos codecov uploader fails on Appveyor #756

adswa opened this issue Sep 10, 2024 · 4 comments · Fixed by #752

Comments

@adswa
Copy link
Member

adswa commented Sep 10, 2024

Appveyors macos builds recently started failing with

/usr/local/Cellar/appveyor-build-agent/7.0.3293/bash-shell.sh: line 51: ./codecov: Bad CPU type in executable
Command exited with code 126
Running "on_finish" scripts

The codecov docs point to using the "codecov-cli", released in 2023, instead of the uploader: https://docs.codecov.com/docs/codecov-uploader

adswa added a commit to adswa/datalad-next that referenced this issue Sep 10, 2024
This change replaces the legacy codecov uploader on macos with a
specific codecov-cli (the uploader's modern replacement) version that is known
to support several CPUs.
Fixes datalad#756
@adswa
Copy link
Member Author

adswa commented Sep 10, 2024

I read up some more. Here is a blog post announcing that the codecov bash uploaders will not be maintained anymore outside of critical security releases.

Instead, everything migrates to use codecov-cli. I tried replacing the uploader with codecov-cli (and, later, stumbled over datalad/datalad#7649, in which @yarikoptic tried to fix the same issue, and found an uploader that supports the CPU architecture (though isn't invoked correctly at the moment in datalad-core - it lacks the "do-upload" subcommand)).

SADLY, while this uploader does not have the "Bad CPU Type" error anymore, it also doesn't upload reports anymore (on any OS), ultimately I believe because we don't seem to have a codecov token (the tokenless upload would be for PRs from forks of repositories, but it relies on a token in the origin project nevertheless I think: https://docs.codecov.com/docs/tokenless-bundle-analysis).

curl -Os $CODECOV_BINARY
chmod +x codecov
./codecov do-upload
info - 2024-09-10 14:05:06,639 -- ci service found: appveyor
warning - 2024-09-10 14:05:06,675 -- No config file could be found. Ignoring config.
warning - 2024-09-10 14:05:06,700 -- No swift data found.
warning - 2024-09-10 14:05:06,701 -- No gcov data found.
info - 2024-09-10 14:05:06,701 -- Running coverage combine -a in /Users/appveyor/projects/datalad-next/__testhome__
Combined data file .coverage.worker-1248-001.shared.3571.XlaJFYKx
info - 2024-09-10 14:05:06,811 -- Generating coverage.xml report in /Users/appveyor/projects/datalad-next/__testhome__
info - 2024-09-10 14:05:18,353 -- Wrote XML report to coverage.xml
info - 2024-09-10 14:05:18,386 -- Found 1 coverage files to report
info - 2024-09-10 14:05:18,387 -- > /Users/appveyor/projects/datalad-next/__testhome__/coverage.xml
info - 2024-09-10 14:05:18,594 -- Process Upload complete
error - 2024-09-10 14:05:18,595 -- Upload failed: {"detail":"Not valid tokenless upload"}
Running "on_finish" scripts

I believe that we would need to pay for codecov, should we want to get one.

Keeping the old uploaders for Linux and Windows successfully uploads coverage reports still, so I would propose to keep them. Failed macos builds because of the CPU mismatch are annoying, so we could replace the uploader with an installable but non-functional (won't upload) uploader (or skip the codecov upload entirely).

@yarikoptic
Copy link
Member

error - 2024-09-10 14:05:18,595 -- Upload failed: {"detail":"Not valid tokenless upload"}

I think it is just that token needs to be specified. We do have a token org wide, and use it for github actions: https://github.com/datalad/datalad/blob/maint/.github/workflows/test.yml#L241 . Try adding it to appveyor env

@adswa
Copy link
Member Author

adswa commented Sep 11, 2024

I think it is just that token needs to be specified. We do have a token org wide, and use it for github actions: https://github.com/datalad/datalad/blob/maint/.github/workflows/test.yml#L241 . Try adding it to appveyor env

Ha, I had no clue - thanks for this info! I can't get the secret out of Github, though. Will ask in the chat if someone can send it.

@adswa
Copy link
Member Author

adswa commented Sep 11, 2024

there also seems to be an unresolved issue on codecov's side: codecov/codecov-action#1548

adswa added a commit to adswa/datalad-next that referenced this issue Sep 12, 2024
This change replaces the legacy codecov uploader on macos with a
specific codecov-cli (the uploader's modern replacement) version that is known
to support several CPUs.
This does not solve the issue that coverage reports are not uploaded to
codecov, but it fixes the issue that the CPU mismatch caused a non-zero
exit code that would lead to a CI failure even when all tests passed.
Fixes datalad#756
adswa added a commit to datalad/datalad-dataverse that referenced this issue Sep 12, 2024
adswa added a commit to datalad/datalad-dataverse that referenced this issue Sep 12, 2024
@mih mih mentioned this issue Sep 22, 2024
3 tasks
@mih mih closed this as completed in #752 Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants