Skip to content

Conversation

@nikic
Copy link
Contributor

@nikic nikic commented Feb 6, 2025

This is an external tool, so I don't think there is an expectation that it has to be in the LLVM tools bindir. It may also be in the default system bindir (which is not necessarily the same).

This is an external tool, so I don't think there is an expectation
that it has to be in the LLVM tools bindir. It may also be in the
default system bindir (which is not necessarily the same).
@nikic nikic requested a review from frasercrmck February 6, 2025 14:02
Copy link
Contributor

@frasercrmck frasercrmck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get where this is coming from, thanks.

However, note that with this change, the priority is changed so that llvm-spirv will be picked up from the PATH environment variable before LLVM_TOOLS_BINARY_DIR.

See the documentation for find_program, when NO_DEFAULT_PATH is provided:

  • step 5: Search the standard system environment variables
  • step 7: Search the paths specified by the PATHS option (...)

I'm not too concerned by the other steps as they're cmake-specific options or variables.

However, this does appear to present a change to users (would re-configuring change the location of the llvm-spirv binary in such scenarios?).

Should LLVM_TOOLS_BINARY_DIR be made a HINT so that it gets searched in step 4 before system paths?

@nikic
Copy link
Contributor Author

nikic commented Feb 6, 2025

Good point, I've changed this to use HINTS instead of PATHS. I'm not really sure which one is more "correct" in this context, but sticking closer to the previous behavior seems like a good idea...

Copy link
Contributor

@frasercrmck frasercrmck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@nikic nikic merged commit 26ecddb into llvm:main Feb 7, 2025
8 checks passed
@nikic nikic deleted the libclc-spirv-path branch February 7, 2025 08:18
@nikic nikic added this to the LLVM 20.X Release milestone Feb 7, 2025
@nikic
Copy link
Contributor Author

nikic commented Feb 7, 2025

/cherry-pick 26ecddb

@llvmbot
Copy link
Member

llvmbot commented Feb 7, 2025

/pull-request #126201

swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request Feb 7, 2025
This is an external tool, so I don't think there is an expectation that
it has to be in the LLVM tools bindir. It may also be in the default
system bindir (which is not necessarily the same).

(cherry picked from commit 26ecddb)
Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request Feb 11, 2025
This is an external tool, so I don't think there is an expectation that
it has to be in the LLVM tools bindir. It may also be in the default
system bindir (which is not necessarily the same).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants