Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upShow the real commit hash for `./servo --version`, not the bundle hash #26720
Conversation
It's extracted from the commit message of the bundle.
highfive
commented
May 31, 2020
|
Heads up! This PR modifies the following files:
|
|
I can't check to see if these changes work because I don't have access to the CI, so let me know if anything seems off! |
|
Oops, this code will fail when you run |
|
r? @SimonSapin |
|
@bors-servo try=linux |
Show the real commit hash for `./servo --version`, not the bundle hash
<!-- Please describe your changes on the following line: -->
Show the real commit hash of the build when run on a bundle commit, rather than showing the bundle's hash.
It gets the real commit hash by extracting it from the bundle commit message, which has the form `Shallow version of commit {sha1}`, where `{sha1}` is the real commit hash.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors (edits Python code, no Rust changes)
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #26386 (GitHub issue number if applicable)
<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because this only changes infrastructure
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
|
|
|
Weird... it seemed to work fine on my machine. Must be a Python version incompatibility with byte strings vs regular strings or something like that. Sigh. The error:
|
|
Rigth, this line Shows that the error happens with Python 3. We’re in the middle of the transition #23607, so IIRC most of
|
|
Ah, I see. I guess I should run mach with Python 3 on my system so that I catch those breaking changes :) |
|
It seems that the version is only updated if the config crate is changed or you do a fresh build. Is there a way to fix that? |
|
It looks like We could potentially fix this by adding a build script that prints The problem is that this seems to disable the default dependency tracking: rust-lang/cargo#4587 so we’d need to also print However there is ongoing work in rustc rust-lang/rust#71858 to expose data about dependencies on environment variables. Cargo can eventually read that data and do the right thing. So, given that this will be fixed upstream eventually, I think it’s not worth doing the build script work-around. In the meantime you can run |
|
@bors-servo try=linux |
Show the real commit hash for `./servo --version`, not the bundle hash
<!-- Please describe your changes on the following line: -->
Show the real commit hash of the build when run on a bundle commit, rather than showing the bundle's hash.
It gets the real commit hash by extracting it from the bundle commit message, which has the form `Shallow version of commit {sha1}`, where `{sha1}` is the real commit hash.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors (edits Python code, no Rust changes)
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #26386 (GitHub issue number if applicable)
<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because this only changes infrastructure
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Could we just have mach run |
|
I would not be in favor:
|
|
|
|
@SimonSapin could you review this? Thanks! |
|
In short, looks good, thanks! @bors-servo r+ |
|
|
|
Thank you! :) |
|
|
camelid commentedMay 31, 2020
•
edited
Show the real commit hash of the build when run on a bundle commit, rather than showing the bundle's hash.
It gets the real commit hash by extracting it from the bundle commit message, which has the form
Shallow version of commit {sha1}, where{sha1}is the real commit hash../mach build -ddoes not report any errors (edits Python code, no Rust changes)./mach test-tidydoes not report any errors