Skip to content
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

Allow usage of pants2 script from other directories #7409

Conversation

Projects
None yet
2 participants
@stuhood
Copy link
Member

commented Mar 20, 2019

Problem

The pants script supports usage from other repositories in order to allow for running pants from sources in another buildroot. But the pants2 script was not accounting for that usecase.

Solution

Adapt pants2 to locate itself in order to exec pants.

@stuhood stuhood requested review from cosmicexplorer and Eric-Arellano Mar 20, 2019

@Eric-Arellano

This comment has been minimized.

Copy link
Contributor

commented Mar 20, 2019

@stuhood branch was checked out on top of your glob fixes, rather than from master, so it includes a lot of unnecessary changes. Please rebase and push again.

@stuhood stuhood force-pushed the twitter:stuhood/allow-usage-of-pants2-script-from-other-directories branch from 6a82fd5 to 519621a Mar 20, 2019

@stuhood

This comment has been minimized.

Copy link
Member Author

commented Mar 20, 2019

Thanks... need to get more sleep.

@Eric-Arellano
Copy link
Contributor

left a comment

Thanks!

pants2 Outdated
export PY="${PY:-python2.7}"

# Allow spawned subprocesses, such as unit tests, to execute with either Python 2 and Python 3.
# So long as the target does not have a compatibility constraint that requires only Python 3, the
# interpreter selection will default to using Python 2 as this is the minimum acceptable interpreter.
export PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS="${PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS:-['CPython>=2.7,<3','CPython>=3.6,<4']}"

./pants "$@"
${REPO_ROOT}/pants "$@"

This comment has been minimized.

Copy link
@Eric-Arellano

Eric-Arellano Mar 20, 2019

Contributor

Should we be using exec here? This was my fault for not originally using it, as I didn't know what exec did.

I think it's fine as is, but more correct to add exec.

@stuhood stuhood merged commit e60e665 into pantsbuild:master Mar 20, 2019

@stuhood stuhood deleted the twitter:stuhood/allow-usage-of-pants2-script-from-other-directories branch Mar 20, 2019

@stuhood stuhood added this to the 1.15.x milestone Mar 20, 2019

stuhood added a commit that referenced this pull request Mar 21, 2019

Allow usage of pants2 script from other directories (#7409)
### Problem

The `pants` script supports usage from other repositories in order to allow for running pants from sources in another buildroot. But the `pants2` script was not accounting for that usecase.

### Solution

Adapt `pants2` to locate itself in order to exec `pants`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.