Skip to content

Correct use ERRORLEVEL in conda scripts for Windows #28

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

Merged
merged 3 commits into from
Sep 14, 2020

Conversation

PokhodenkoSA
Copy link
Contributor

When I build conda package on Windows in my local environment it fails on tests.
It happens because oneAPI env activation script (part related to FPGA) does set ERRORLEVEL=1.
As mentioned in this article in cmd.exe scripts
IF ERRORLEVEL 1 ... checks the last exit value but IF %ERROLEVEL% NEQ 0 ... checks env variable. The env variable does not relate to last exit status. I think it is error in oneAPI and conda scripts to use env variable instead of exit value.

Current CI works without this modifications but my local env does not work without it.

Also, I have tested it with my last commit on branch beta/2021. When I test in master it crashes on python -c "import dppl". It does not relate to this modifications. Just there is an issue between beta/2021 and current master.

@PokhodenkoSA
Copy link
Contributor Author

PokhodenkoSA commented Sep 11, 2020

I have finished reading the article mentioned. If env var %ERRORLEVEL% is not set then access to it will fallback to exit value. So setting ERRORLEVEL in oneAPI scripts is an error, but using it in conda scripts is not an error.

@diptorupd
Copy link
Contributor

I am fine with this change. Maybe open a ticket for oneAPI, but not a very high priority.

@PokhodenkoSA
Copy link
Contributor Author

I have returned old checks style IF %ERRORLEVEL% NEQ 0 ... because the main problem is in vars.bat setting this variable. After resetting the variable is could be used and it will behave as expected - fallback to exit value of previous command.

@PokhodenkoSA PokhodenkoSA merged commit 578a6f6 into IntelPython:master Sep 14, 2020
diptorupd pushed a commit to diptorupd/dpctl that referenced this pull request Sep 15, 2020
* Correct use of ERRORLEVEL in cmd scripts.

* Reset 0 after oneAPI env activateion in build and test scripts.

* Revert "Correct use of ERRORLEVEL in cmd scripts."

This reverts commit b42a7e1.
diptorupd added a commit to diptorupd/dpctl that referenced this pull request Sep 15, 2020
diptorupd added a commit to diptorupd/dpctl that referenced this pull request Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows Applies to Windows OS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants