-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
llvm: add llvm_config helper #28670
llvm: add llvm_config helper #28670
Conversation
Add a helper as a base to build better libs etc. methods
I think we should remove these. This isn't related to this PR and the same problem occurs for all files in Spack. At one point I think we tried making the import system less hacky to fix this, didn't we? Like use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there other executables that get installed with LLVM or just llvm-config
? We could override command
to point to this exe.
Yeah, I had a big PR that tried to straighten out a bunch of that, but it rotted when I lost time to keep updating it. I can pull it out, but figuring out something for this would be nice. It’s kinda painful to work on package files as it is. |
There are others, lots actually including replacements for most of binutils and the bytecode interpreter, but I’m not sure all of them are necessarily always installed. The llvm-config binary I don’t think can be turned off though, it’s pretty much the only stable way to use llvm components over time. Perhaps the cmake targets too I suppose, but this is easier for us to get ahold of. |
Now using instance methods, explicitly referencing self.prefix.bin, and removed extra imports. Committing from an env that can't run style, may still be issues there.
I don’t want to do it in this PR, but you make we think we should rework the external detection logic @adamjstewart. As it stands, it will only work for externals that include clang or lldb or similar, but nothing in that list is installed if you have an llvm-only build. The closest is probably lld, but even that isn’t necessarily going to be there. What do you think @haampie? |
For the specific case that I am looking for in #28621 I need the library directory, which should be provided by |
I would love to see this. Our important system is a bit too magical at the moment. Maybe after @tgamblin finishes blackening Spack? |
I don't think we need properties for each and every flag, let's just have a single Now that I think about it, this reminds me of the problem we had with Python packages. When we recursively load Python libs, we set |
That’s a fair point. I seriously considered caching it, but figured it would be better to leave it simple and see if the need appears. My intuition is that there will usually only be one or a very few packages calling this, but if I go and break the llvm package back apart into all of its components then it might be worth it. |
Any further changes you want @adamjstewart? Thoghts @haampie? |
This is my only remaining comment, since we also need to access the libdir I think it makes more sense to only have |
Makes sense, removed the |
Add a helper as a base to build better libs etc. methods
Add a helper as a base to build better libs etc. methods
Add a helper as a base to build better libs etc. methods
Add a helper as a base to build better libs etc. methods. This should help with #28621 @glennpj.
As @haampie pointed out, llvm-config does not get along very well with
libllvm.so
, it's supposed to (it even has an option specifically for that case) but it doesn't. If someone needs that, they should use libdir then libnames to get the appropriate setup then build the path themself. For anything else though, shared-libs, static-libs, paths, flags, it works reliably in my experience.The imports are not really related, but reduce the number of error prompts on this file by an immense amount when linting.