Replace the version scripts#392
Merged
Merged
Conversation
Collaborator
Author
|
For reference, |
51aa8ac to
d4f5bbf
Compare
Collaborator
Author
|
Looks like the Docker issue, when replicated locally, is due to the |
sbc100
reviewed
Mar 8, 2024
sbc100
reviewed
Mar 8, 2024
abrown
added a commit
to abrown/wasi-sdk
that referenced
this pull request
Mar 8, 2024
I came across this in WebAssembly#392, where it became clear that Ubuntu's 18.04 release (now several years old) was using quite ancient versions of certain tools.
sbc100
reviewed
Mar 8, 2024
In the past, I've had trouble keeping the current set of version scripts to correctly output the version, especially in light of how we append Git suffixes for a non-tagged commit and dirty state. This change replaces those scripts with a single Python one which, though much more wordy than the previous one, may be easier for contributors to read and modify. The original scripts relied on Perl; this one relies on Python, which seems like a fair exchange. Having a single script also makes it easier to solve WebAssembly#372.
As noted in WebAssembly#372, some users may need to identify which version of wasi-sdk they are using after it has been downloaded. There are many ways to solve this, but the one I chose here is to dump the wasi-sdk version into a `VERSION` file and follow that up with several dependency versions that may be helpful to note when troubleshooting. Ideally someone could paste the contents of that file when filing a bug. If we adopt this approach, this fixes WebAssembly#372.
When running Git commands inside this Docker container (i.e., commands
that the `version.py` script needs for determining version information),
the Docker build would run into issues like:
```
fatal: detected dubious ownership in repository at '/workspace'
To add an exception for this directory, call:
git config --global --add safe.directory /workspace
```
This is due to an extra Git check that detects that the Docker user is
not the same one who owns the `.git` directory of this project. After
looking into this, the best solution the internet has to offer is to
thread the current user's UID and GID through the Docker image (i.e.,
the new `builder` user) and then `docker run --user ...`. This both
avoids the Git check but also seems to be considered a best practice in
some circles (?).
In WebAssembly#399, @glandium points out that newer versions of LLVM will place their version information at a different path. This change adapts WebAssembly#399 to the new Python version script.
Collaborator
Author
|
@sbc100, @sunfishcode: I rebased this change and re-split the commits as atomic changes on top of |
sbc100
approved these changes
Mar 18, 2024
alexcrichton
added a commit
to alexcrichton/wasi-sdk
that referenced
this pull request
Apr 12, 2024
This commit fixes a minor mistake from WebAssembly#392 where the previous perl script had a special case that if the "minor" version was zero then the git hash information wouldn't be printed.
abrown
pushed a commit
that referenced
this pull request
Apr 15, 2024
This commit fixes a minor mistake from #392 where the previous perl script had a special case that if the "minor" version was zero then the git hash information wouldn't be printed.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In the past, I've had trouble keeping the current set of version scripts
to correctly output the version, especially in light of how we append
Git suffixes for a non-tagged commit and dirty state. This change
replaces those scripts with a single Python one which, though much more
wordy than the previous one, may be easier for contributors to read and
modify. The original scripts relied on Perl; this one relies on Python,
which seems like a fair exchange. Having a single script also makes it
easier to solve #372.
As noted in #372, some users may need to identify which version of
wasi-sdk they are using after it has been downloaded. There are many
ways to solve this, but the one I chose here is to dump the wasi-sdk
version into a
VERSIONfile and follow that up with several dependencyversions that may be helpful to note when troubleshooting. Ideally
someone could paste the contents of that file when filing a bug. If we
adopt this approach, this fixes #372.