Allow for using the native engine from-source in another repo #4105

Merged
merged 1 commit into from Dec 1, 2016

Conversation

Projects
None yet
3 participants
@stuhood
Member

stuhood commented Dec 1, 2016

Problem

Currently, running the pantsbuild/pants repo from source in another repo (ie, cd ${other_repo}; ../pantsbuild/pants list ::) is broken due to use of relative paths in file fingerprinting. We use this workflow internally to iterate on new unreleased pants code.

Solution

Execute file fingerprinting in a subshell that cds to the buildroot of pantsbuild/pants. Note that using the git --work-tree option didn't work... possible due to reads of .gitignore files ignoring that option.

Allow for a from-source workflow (whereby the `pants` script in the r…
…oot of the pantsbuild/pants repo is used to run pants from source in another repo).
@kwlzn

kwlzn approved these changes Dec 1, 2016

lgtm, one quick thought.

+ # NB: We fork a subshell because one or both of `ls-files`/`hash-object` are
+ # sensitive to the CWD, and the `--work-tree` option doesn't seem to resolve that.
+ (
+ cd ${REPO_ROOT}

This comment has been minimized.

@kwlzn

kwlzn Dec 1, 2016

Member

this wfm, but I think general precedent for "twitter style bash" prefers pushd/popd with indentation which reads a little cleaner e.g.:

pushd ${REPO_ROOT}
  ..cmds here..
popd
@kwlzn

kwlzn Dec 1, 2016

Member

this wfm, but I think general precedent for "twitter style bash" prefers pushd/popd with indentation which reads a little cleaner e.g.:

pushd ${REPO_ROOT}
  ..cmds here..
popd

This comment has been minimized.

@jsirois

jsirois Dec 1, 2016

Member

But it's Twitter style and not pants style, hidden styles are not great to have imo, it's like inside jokes in an otherwise inclusive community. Not necessarily opposed to the style, just the motivation.

@jsirois

jsirois Dec 1, 2016

Member

But it's Twitter style and not pants style, hidden styles are not great to have imo, it's like inside jokes in an otherwise inclusive community. Not necessarily opposed to the style, just the motivation.

This comment has been minimized.

@kwlzn

kwlzn Dec 1, 2016

Member

roger that. and to be clear, I'm not trying to enforce Twitter style externally - just think that generally this form leads to cleaner code.

@kwlzn

kwlzn Dec 1, 2016

Member

roger that. and to be clear, I'm not trying to enforce Twitter style externally - just think that generally this form leads to cleaner code.

@stuhood stuhood merged commit 2615365 into pantsbuild:master Dec 1, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

lenucksi added a commit to lenucksi/pants that referenced this pull request Apr 25, 2017

Allow for using the native engine from-source in another repo (#4105)
### Problem

Currently, running the pantsbuild/pants repo from source in another repo (ie, `cd ${other_repo}; ../pantsbuild/pants list ::`) is broken due to use of relative paths in file fingerprinting. We use this workflow internally to iterate on new unreleased pants code.

### Solution

Execute file fingerprinting in a subshell that cds to the buildroot of pantsbuild/pants. Note that using the `git --work-tree` option didn't work... possible due to reads of `.gitignore` files ignoring that option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment