-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ci: Build gccjit from a git archive #122658
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
GIT_REPO="https://github.com/rust-lang/gcc" | ||
|
||
# This commit hash needs to be updated to use a more recent gcc fork version. | ||
GIT_COMMIT="78dc50f0e50e6cd1433149520bd512a4e0eaa1bc" | ||
|
||
set -ex | ||
|
||
cd $1 | ||
|
||
source shared.sh | ||
|
||
# Setting up folders for GCC | ||
git clone https://github.com/antoyo/gcc gcc-src | ||
cd gcc-src | ||
# This commit hash needs to be updated to use a more recent gcc fork version. | ||
git checkout 78dc50f0e50e6cd1433149520bd512a4e0eaa1bc | ||
curl -L "$GIT_REPO/archive/$GIT_COMMIT.tar.gz" | | ||
tar -xz --transform "s/gcc-$GIT_COMMIT/gcc-src/" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If for some reason we do want git metadata on disk, AFAIK shallow clones are not possible with specific commit hashes, but you can get there with |
||
|
||
mkdir ../gcc-build ../gcc-install | ||
cd ../gcc-build | ||
mkdir gcc-build gcc-install | ||
pushd gcc-build | ||
|
||
# Building GCC. | ||
hide_output \ | ||
|
@@ -28,6 +31,7 @@ hide_output \ | |
hide_output make -j$(nproc) | ||
hide_output make install | ||
|
||
rm -rf ../gcc-src | ||
popd | ||
rm -rf gcc-src gcc-build | ||
ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so | ||
ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so.0 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We should probably also
retry
the download if it fails for some reason.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.
I think it's not that simple -- if a partial download fails and restarts, the latter
| tar
is not likely to fare well. We could download to disk first, or wrap the pipeline in a bash function to be retried. But I wonder if this is useful, because if a GitHub CI runner can't download fromgit.cakeli.workers.dev
, we likely have bigger issues...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.
The issue here is not so much the download but the transient DNS failures, they happened in the past, even for
github.com
(can't find a example right now).Sure, we may want to download first to disk; I didn't look to closely at the retry function.
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.
I wouldn't worry about it. The whole docker build is already retried 5 times IIRC. This is maybe nice cleanup in the future but isn't worth it for now.