Skip to content

llvmPackages.bolt: init at 17.0.6#289587

Closed
pca006132 wants to merge 3 commits intoNixOS:masterfrom
pca006132:llvm-bolt
Closed

llvmPackages.bolt: init at 17.0.6#289587
pca006132 wants to merge 3 commits intoNixOS:masterfrom
pca006132:llvm-bolt

Conversation

@pca006132
Copy link
Copy Markdown
Contributor

@pca006132 pca006132 commented Feb 17, 2024

Description of changes

adds llvm-bolt for llvm 17.

Closes #176536. Note that we need quite a large patch, we probably want to upstream some changes to allow bolt standalone build.

Upstream PR: llvm/llvm-project#87196

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@pca006132
Copy link
Copy Markdown
Contributor Author

I tested the binary a bit, llvm-bolt (with instrumentation) is working, but perf2bolt seems to be a bit problematic and I am not sure why. There is no error, but the profile result is not useful.

@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label Feb 17, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Feb 17, 2024
@Ericson2314
Copy link
Copy Markdown
Member

I would create an upstream PR for that part of the patch and mention it here https://discourse.llvm.org/t/building-llvm-out-of-per-subproject-tar-balls-still-is-not-working/72829/11

I have helped shepherd such things upstream before.

@nixos-discourse
Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/3555

@alyssais
Copy link
Copy Markdown
Member

alyssais commented Mar 2, 2024

We probably need to add this for LLVM 16 as well until Darwin's default LLVM version has caught up, for the same reasons as in ee9c2b7.

@pca006132
Copy link
Copy Markdown
Contributor Author

I think the patch should work for LLVM 16, but may need some minor tweaks. I can try to add it later today.

@alyssais
Copy link
Copy Markdown
Member

alyssais commented Mar 2, 2024

It'd also be fine to have it be marked broken for LLVM 16. The attribute just needs to exist for silly reasons. mlir is a good example of how to have a common package definition between multiple LLVM versions, btw.

@pca006132
Copy link
Copy Markdown
Contributor Author

Added the attribute for llvm 16 as well. It does not work because there is a large cmake file change in llvm 17, need large effort to make it work for llvm 16...

@pca006132
Copy link
Copy Markdown
Contributor Author

btw not sure how should I name the commit(s), I can do a rebase later if needed.
while this adds bolt for llvm 16 as well, it is marked as broken so not sure if this counts as adding the package

@alyssais
Copy link
Copy Markdown
Member

alyssais commented Mar 2, 2024

I think the commit message should be titled "llvmPackages.bolt: init at 17.0.6", since there's no "llvm-bolt" attribute at the top level. In the commit message body you could explain that there needs to be an llvmPackages_16.bolt attribute, even if it doesn't work, referencing the commit I referred to before.

BTW: what about the upstream PR @Ericson2314 suggested?

@pca006132 pca006132 changed the title llvm-bolt: init at 17.0.6 llvmPackages.bolt: init at 17.0.6 Mar 2, 2024
@ofborg ofborg bot requested a review from alyssais March 2, 2024 15:20
@RossComputerGuy
Copy link
Copy Markdown
Member

Curious as to what the status of this is since I know someone who is wanting this in LLVM 18. If this is merged before 18 is merged then I can merge this into 18 and git.

@pca006132
Copy link
Copy Markdown
Contributor Author

This is working, but perhaps people are hesitant to merge it due to the relatively large patch?

@RossComputerGuy
Copy link
Copy Markdown
Member

Maybe, I'd consider this to be kinda small. I don't see anything bad and I'm testing this on an M1 Pro running NixOS. Only thing I can think of is adding bolt_17 and bolt_16 as aliases to the bolt packages in llvmPackages_16/17. I also didn't see it run any sort of tests, maybe getting it to run tests would be good.

@pca006132
Copy link
Copy Markdown
Contributor Author

I thought of running tests, but it seems that bolt tests are disabled when not built together with clang. I can look into it later when I have more time.

@RossComputerGuy
Copy link
Copy Markdown
Member

Alright then just add the aliases and I'd say this is all good.

@pca006132
Copy link
Copy Markdown
Contributor Author

Do note that bolt_16 is broken, so I think we should only add bolt_17?

@Ericson2314
Copy link
Copy Markdown
Member

I mean do you have a link for here? Or else do I find the upstream PR?

@RossComputerGuy
Copy link
Copy Markdown
Member

@pca006132 Yes, you can find it by scrolling up and seeing the line that says this PR was mentioned in another one.

Copy link
Copy Markdown
Member

@alyssais alyssais left a comment

Choose a reason for hiding this comment

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

Please link to the upstream PRs in comments where the patches are used, so it's easy to find them.

@pca006132
Copy link
Copy Markdown
Contributor Author

@alyssais I will wait until the upstream give more comments about the patch and fix it all together.

@Ericson2314
Copy link
Copy Markdown
Member

Discussion in that upstream PR has reminded me that we should not build the runtime as part of bolt, but in a separate package instead (just like LLVM and compiler-rt), in order to be cross friendly.

@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Apr 2, 2024
@wegank wegank added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Apr 22, 2024
@pwaller
Copy link
Copy Markdown
Contributor

pwaller commented May 17, 2024

Ping, this has an approval, is this still blocked, if so, on what? Can it be merged as-is and then improved?

@pca006132
Copy link
Copy Markdown
Contributor Author

@pwaller Probably missing link from the upstream PR. I wanted to add a reproducer for the upstream PR using nix (because I somehow cannot make the docker build works), but I am stuck with the lit script. Was busy last month, and I am not at home right now, will revisit this next week.

@rrbutani rrbutani added the 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related label May 27, 2024
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 4, 2024
@RossComputerGuy
Copy link
Copy Markdown
Member

@pca006132 Is there any interest or progress in updating this PR?

@pca006132
Copy link
Copy Markdown
Contributor Author

Sorry but probably no, I am busy with other projects.

I can close this one and let you open a new one?

@RossComputerGuy
Copy link
Copy Markdown
Member

I can close this one and let you open a new one?

Yeah, that sounds good. I already rebased this in my own fork to work with the most recent changes.

@pca006132
Copy link
Copy Markdown
Contributor Author

Thanks a lot! And really sorry about having no progress for months.

@RossComputerGuy
Copy link
Copy Markdown
Member

Yeah, it's all good. I've opened #326240.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LLVM Bolt

9 participants