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

Windows: Catch all non-zero exit codes (negative values too) #1763

Merged
merged 3 commits into from
Sep 19, 2023

Conversation

jaimergp
Copy link
Member

@jaimergp jaimergp commented Sep 8, 2023

Checklist

  • Added a news entry

Supersedes #1704. The formula if errorlevel 1 actually means "if the exit code is >=1", so it doesn't catch -1 and other negative exit codes. This can happen in conda-build when it segfaults during the linkage analysis steps, for example.

Exit codes in CMD are tricky and there are many gotchas. Since we can afford to enable delayed expansion, this is relatively robust. See this SO answer for (way ) more info if you are curious.

@jaimergp jaimergp marked this pull request as ready for review September 12, 2023 07:58
@jaimergp jaimergp force-pushed the fix-conda-build-error-handling branch from 85c2a5a to 815853f Compare September 12, 2023 07:59
@xhochy
Copy link
Member

xhochy commented Sep 19, 2023

We should have this as a linter message for bld.bat, too. We use the previous if errorlevel statements in nearly all windows builds.

@xhochy xhochy merged commit 9395c07 into conda-forge:main Sep 19, 2023
2 checks passed
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 this pull request may close these issues.

2 participants