-
Notifications
You must be signed in to change notification settings - Fork 98
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
Inject a source identifer into moc
#1631
Merged
Merged
Commits on Jun 20, 2020
-
Inject a source identifer into
moc
I have been preaching this for so long to other teams, I really better clean up my own backyard: Make sure that you can run moc --version and get a somewhat useful indication what version that is. This is important for when random people use `moc` from random versions of SDK or – later – build it themselves and then provide bug reports. When building locally, with `.git` around, this now injects the git revision: $ ./moc --version Motoko compiler (revision 9abae15e-dirty) (the `-dirty` indicates that my work-tee is not clean). When `.git` is _not_ available, as typially (and rightfully) when building with nix, it looks if Nix’s `$out` variable is set, and includes that: ~/dfinity/motoko $ $(nix-build -A moc)/bin/moc --version Motoko compiler (revision xx6fmamdh5bjph9law6x02d7f4hw8f84-moc-bin) This is less useful for end-users, but it still allows us to (hopefully) identify the version, in the worst case by running this command on all revisions to find the right one: $ nix-store --query --outputs $(nix-instantiate -A moc-bin) /nix/store/xx6fmamdh5bjph9law6x02d7f4hw8f84-moc-bin Or by querying hydra (as @basvandijk suggests in dfinity/sdk#383 (comment)) Once we do versioned releases, we can of course extend this to inject the version number there, and use `git describe --tag` to have `v1.0-200-9abae15e` like derscriptions. I _hope_ this will not cause extra recompilations with `dune`, and will work out-of-the box for everyone, but we’ll see.
Configuration menu - View commit details
-
Copy full SHA for 0c12f55 - Browse repository at this point
Copy the full SHA 0c12f55View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d9e685 - Browse repository at this point
Copy the full SHA 0d9e685View commit details -
Configuration menu - View commit details
-
Copy full SHA for 817b6a8 - Browse repository at this point
Copy the full SHA 817b6a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1a9b4ca - Browse repository at this point
Copy the full SHA 1a9b4caView commit details -
so that it will hopefully not be picked up as a “dependency”
Configuration menu - View commit details
-
Copy full SHA for 6f571b8 - Browse repository at this point
Copy the full SHA 6f571b8View commit details -
so that it does not get picked up by `common.lib.standaloneRust`
Configuration menu - View commit details
-
Copy full SHA for 8ed661d - Browse repository at this point
Copy the full SHA 8ed661dView commit details
Commits on Jun 21, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 8cd5c20 - Browse repository at this point
Copy the full SHA 8cd5c20View commit details
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.