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

Consider adding a native relocatable-Process/InteractiveProcess facility to ease run implementations #14386

Closed
stuhood opened this issue Feb 7, 2022 · 1 comment · Fixed by #16093
Assignees

Comments

@stuhood
Copy link
Member

stuhood commented Feb 7, 2022

When we run an InteractiveProcess, all use of relative paths in any input Process definition must be converted to absolute usage in order to allow the cwd of the process to be different (usually, the build root) from the sandbox directory containing its inputs (usually a temporary directory). But we don't currently have any explicit support for this, and so Python and the JVM each have slightly different solutions (#14352 and the PEX venv script).

Native support for this might look like adding a well-known env var and template variable for args, which the InteractiveProcess runner would fill with an absolute path, and which the Process runner(s) would define/template to be empty.

@stuhood
Copy link
Member Author

stuhood commented May 26, 2022

#15340 added support for templating {chroot} into the env of a Process, which represents ... 95% of this probably? Actually calling this done might mean proving that the {chroot} variable can be used interchangeable during conversion of a Process to an InteractiveProcess in one of the usecases from the description.

@stuhood stuhood self-assigned this Jul 7, 2022
stuhood added a commit that referenced this issue Jul 12, 2022
…orkspace=True` (#16093)

As described in #16105, blocking code in `@rule` bodies can trigger a shutdown race condition when `pantsd` is disabled and `Ctrl+C` is sent.

Longer term solutions are discussed on that issue, but in the short term, we can avoid using blocking code for `InteractiveProcess`, such that `run` uses the same sandbox creation, async teardown, and relativizing code as `Process` does.

Fixes #13852, fixes #14386, fixes #16120, and fixes #15771.
stuhood added a commit to stuhood/pants that referenced this issue Jul 12, 2022
…orkspace=True` (pantsbuild#16093)

As described in pantsbuild#16105, blocking code in `@rule` bodies can trigger a shutdown race condition when `pantsd` is disabled and `Ctrl+C` is sent.

Longer term solutions are discussed on that issue, but in the short term, we can avoid using blocking code for `InteractiveProcess`, such that `run` uses the same sandbox creation, async teardown, and relativizing code as `Process` does.

Fixes pantsbuild#13852, fixes pantsbuild#14386, fixes pantsbuild#16120, and fixes pantsbuild#15771.

[ci skip-build-wheels]
stuhood added a commit that referenced this issue Jul 12, 2022
…orkspace=True` (Cherry-pick of #16093) (#16148)

As described in #16105, blocking code in `@rule` bodies can trigger a shutdown race condition when `pantsd` is disabled and `Ctrl+C` is sent.

Longer term solutions are discussed on that issue, but in the short term, we can avoid using blocking code for `InteractiveProcess`, such that `run` uses the same sandbox creation, async teardown, and relativizing code as `Process` does.

Fixes #13852, fixes #14386, fixes #16120, and fixes #15771.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant