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: TODO: Update maintainers and add an update script #100725
Comments
There is a way to update hashes: $ cat fix-wanted.awk # hash mismatch in fixed-output derivation '/nix/store/gkixca1c9jcqs0qwj0pns4gfkycjn117-Xlldb-11-init.tar.gz':
# wanted: sha256:02gb3fbz09kyw8n71218v5v77ip559x3gqbcp8y3w6n3jpbryywa
# got: sha256:1cjsvyrq759hmp4cki2l2q62pdasqmjcpqkb5rdgx0rpmnrja1i2
# invoke `awk -f fix-wanted.awk -F: <mismatch-log>` > script.sh && sh script.sh
# or build like this: `nix-build -j8 -A llvmPackages_10 |& tee /dev/tty | awk -f fix-wanted.awk -F: | sh`
/wanted: / { wanted = $3 }
/got: / { got = $3; print "git grep", wanted, "|", "awk -F: '{print $1}' | xargs perl -pi -e s/"wanted"/"got"/g" } and then I build like this: nix-build -j8 -A llvmPackages_11 --keep-going |& tee /dev/tty | awk -f fix-wanted.awk -F: | sh The first build fails but the second try sees the updated hashes in the repo, so it passes. |
Becoming maintainer might make sense. I wanted to take a look at packaging llvm using the monorepo, since this is is default now and should be less error-prone regarding cmake-flags. Regarding the hash updates: I think if you can get something to work easily it would be nice, but all major updates required some kind of manual intervention, so the script above should be sufficient in most cases. |
Because I maintain Chromium which always requires the most recent LLVM release (would be good to get notified on any PRs/issues, especially since I seem to end up merging most of the PRs anyway). See #100725.
I didn't have time to extend/improve it but here is my script in case anyone ever needs to verify (or manually update) the LLVM source hashes (e.g. #110631 (comment)): #!/usr/bin/env bash
# Usage example: ./llvm.sh 11
set -eu
export VERSION="$1"
export ATTRSET="llvmPackages_$VERSION"
export SOURCES=(
"clang-unwrapped.src"
"compiler-rt.src"
"clang-unwrapped.clang-tools-extra_src"
"libcxx.src"
"libcxxabi.src"
"libunwind.src"
"lld.src"
"lldb.src"
"llvm.src"
"llvm.polly_src"
"openmp.src"
)
for SOURCE in "${SOURCES[@]}"; do
nix-build -A "$ATTRSET.$SOURCE"
nix-build -A "$ATTRSET.$SOURCE" --check
done
echo OK Note: This isn't ideal though as it e.g. should still be susceptible to MITM attacks (using |
This is based on a combination of Gabor Greif's update script [0] and my script to verify the hashes [1]. It's a bit hacky / unconventional but it should be very useful and worked fine so far (but it might require changes for some edge-cases). [0]: #100725 (comment) [1]: #100725 (comment)
I've pushed an update script in 493131d. Hopefully that should work well (I tested it with |
@ggreif @DieGoldeneEnte would you be interested to add yourself as maintainers for LLVM? IMO that would make sense since you've e.g. taken care of adding LLVM 10 and 11 and might be interested to get notified of changes from other users. Though in case you don't want to quickly review PRs or be cc'ed on issues it would make less sense (but being in
meta.maintainers
doesn't require that much commitment). I'll probably add myself as maintainer as well so that I get notified of new PRs (due to Chromium I often have to review/merge them anyway; at least in the case of new releases).And I was wondering if there's already a way to automatically update the hashes after new releases. If not that would be great to have. I could probably extend my hacky script to verify the hashes so that it can update them as well.
The text was updated successfully, but these errors were encountered: