feat(build): Use git to set sl version number#522
Closed
vegerot wants to merge 2 commits intofacebook:mainfrom
Closed
feat(build): Use git to set sl version number#522vegerot wants to merge 2 commits intofacebook:mainfrom
vegerot wants to merge 2 commits intofacebook:mainfrom
Conversation
Summary: Currently, following the recommended documentation for building Sapling will always set the sapling version to the upstream Mercurial version (which has been 4.4.2 for years) ```sh ❯ sl --version Sapling 4.4.2 ``` This isn't very useful when debugging Sapling, and is inconsistenct with the distributed versions of sl. This commit aligns the sl version with the sl version in the distributed versions of sl Test Plan: manual ```sh ❯ (cd eden/scm && make oss && ./sl --version) Sapling 0.2.20230107-190820-h75ace1ad ```
Summary: When building Sapling using `make oss`, the version number is only set to the date and commit when in an sl or hg repo. This commit adds the version number when Sapling is cloned with git Test plan: ```sh $ git clone git@github.com:facebook/sapling.git # apply this patch $ cd sapling/eden/scm $ make oss $ ./sl --version ``` On my machine: Sapling 4.4.2_20230204-131549-hf454128c
Contributor
|
@quark-zju has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
sggutier
approved these changes
Feb 15, 2023
| # if hg is not found, fallback to a fixed version | ||
| out = hgtemplate(template) or "" | ||
| out = hgtemplate(template) or gitversion() or "" | ||
| # Some tools parse this number to figure out if they support this version of |
Contributor
There was a problem hiding this comment.
Wouldn't this error out if the user has hg/sl installed and the current repo is a Git repo?
Contributor
There was a problem hiding this comment.
@vegerot I was wrong about this causing issues. It should be fine given that hgtemplate returns an empty string instead of erroring out.
facebook-github-bot
pushed a commit
that referenced
this pull request
Feb 15, 2023
Summary: (build): Use Sapling HEAD for sl version by default in `make oss` Currently, following the recommended documentation for building Sapling will always set the sapling version to the upstream Mercurial version (which has been 4.4.2 for years) ```sh ❯ sl --version Sapling 4.4.2 ``` This isn't very useful when debugging Sapling, and is inconsistenct with the distributed versions of sl. This commit aligns the sl version with the sl version in the distributed versions of sl Pull Request resolved: #440 Test Plan: manual ```sh ❯ (cd eden/scm && make oss && ./sl --version) Sapling 0.2.20230107-190820-h75ace1ad ``` --- Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/sapling/pull/440). * #522 * __->__ #440 Reviewed By: sggutier Differential Revision: D43329069 Pulled By: quark-zju fbshipit-source-id: 26c39e652c5abd850a8ea28c206e7b4d8651a0e7
Contributor
|
@quark-zju merged this pull request in dc84066. |
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.
feat(build): Use git to set sl version number
Summary: When building Sapling using
make oss, the version number is only setto the date and commit when in an sl or hg repo. This commit adds the version
number when Sapling is cloned with git
Test plan:
$ git clone git@github.com:facebook/sapling.git
apply this patch
$ cd sapling/eden/scm
$ make oss
$ ./sl --version
On my machine:
Sapling 4.4.2_20230204-131549-hf454128c
Stack created with Sapling. Best reviewed with ReviewStack.
make oss#440