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

Update ONNX installing script #21044

Merged
merged 1 commit into from
Jun 14, 2024
Merged

Update ONNX installing script #21044

merged 1 commit into from
Jun 14, 2024

Conversation

snnn
Copy link
Member

@snnn snnn commented Jun 14, 2024

Avoid using command line flags to pass in CMAKE_PREFIX_PATH. Use environment variables instead.
Because, otherwise the value of CMAKE_PREFIX_PATH could get encoded twice. For example, if the prefix is C:\a\root, then in tools/ci_build/github/windows/helpers.ps1 we set it in Env:CMAKE_ARGS which will be consumed by ONNX. Then when ONNX get it and decoded it, ONNX will get C:aroot instead. Then because the path doesn't exist, the CMAKE_PREFIX_PATH couldn't take effect when the script installs ONNX. This PR fixes the issue.

The issue got discovered when I tried to upgrade cmake to a newer version. Now our Windows CPU CI build pipeline uses cmake 3.27. In the main branch even the CMAKE_PREFIX_PATH setting does not work, cmake still can find protoc.exe from the directories. However, starting from 3.28 cmake changed it. With the newer cmake versions the find_library(), find_path(), and find_file() cmake commands no longer search in installation prefixes derived from the PATH environment variable.

@snnn snnn requested a review from a team June 14, 2024 03:55
@snnn snnn merged commit 80a60d9 into microsoft:main Jun 14, 2024
93 of 95 checks passed
@snnn snnn deleted the snnn/update_script branch June 19, 2024 20:12
yf711 pushed a commit that referenced this pull request Jun 19, 2024
Avoid using command line flags to pass in CMAKE_PREFIX_PATH. Use
environment variables instead.
Because, otherwise the value of CMAKE_PREFIX_PATH could get encoded
twice. For example, if the prefix is `C:\a\root`, then in
tools/ci_build/github/windows/helpers.ps1 we set it in Env:CMAKE_ARGS
which will be consumed by ONNX. Then when ONNX get it and decoded it,
ONNX will get `C:aroot` instead. Then because the path doesn't exist,
the CMAKE_PREFIX_PATH couldn't take effect when the script installs
ONNX. This PR fixes the issue.

The issue got discovered when I tried to upgrade cmake to a newer
version. Now our Windows CPU CI build pipeline uses cmake 3.27. In the
main branch even the CMAKE_PREFIX_PATH setting does not work, cmake
still can find protoc.exe from the directories. However, starting from
3.28 cmake changed it. With the newer cmake versions the find_library(),
find_path(), and find_file() cmake commands no longer search in
installation prefixes derived from the PATH environment variable.
baijumeswani pushed a commit that referenced this pull request Jun 20, 2024
Avoid using command line flags to pass in CMAKE_PREFIX_PATH. Use
environment variables instead.
Because, otherwise the value of CMAKE_PREFIX_PATH could get encoded
twice. For example, if the prefix is `C:\a\root`, then in
tools/ci_build/github/windows/helpers.ps1 we set it in Env:CMAKE_ARGS
which will be consumed by ONNX. Then when ONNX get it and decoded it,
ONNX will get `C:aroot` instead. Then because the path doesn't exist,
the CMAKE_PREFIX_PATH couldn't take effect when the script installs
ONNX. This PR fixes the issue.

The issue got discovered when I tried to upgrade cmake to a newer
version. Now our Windows CPU CI build pipeline uses cmake 3.27. In the
main branch even the CMAKE_PREFIX_PATH setting does not work, cmake
still can find protoc.exe from the directories. However, starting from
3.28 cmake changed it. With the newer cmake versions the find_library(),
find_path(), and find_file() cmake commands no longer search in
installation prefixes derived from the PATH environment variable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants