Skip to content

Cleanup around subprocess helpers #7995

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

Merged
merged 11 commits into from
Feb 23, 2022
Merged

Conversation

robx
Copy link
Collaborator

@robx robx commented Feb 18, 2022

This is intended to be a mostly-no-op change to provide a basis for a clean take of #7921. The guiding principle was to reduce the number of createProcess calls and collect them in Distribution.Simple.Utils.

Functional changes should be limited to:

  • slightly more consistent logging of command execution
  • more consistently applying the same subprocess defaults (delegate_ctlc and enable_process_jobs)

One of the last commits removes some obsolete functions that I'd previously deprecated. I'm a bit unsure if we need to deprecate these mostly-internal functions.

All those rawSystem helpers still feel a bit messy and I'm sure there's more that could be done, but I think this should already be a step forward, and will allow switching to some kind of bracketed withProcess in the context of #7921 much easier, and hence easier to review.


Please include the following checklist in your PR:

Please also shortly describe how you tested your change. Bonus points for added tests!

@robx

This comment was marked as resolved.

@robx robx marked this pull request as draft February 21, 2022 14:58
robx added 6 commits February 22, 2022 21:56
- Set enable_process_jobs on a variant of System.Process.proc
  instead of just for System.Process.createProcess
- In Distribution.Simple.Utils, only use this proc instance.
- Replace use of printRawCommand* by a unified helper logCommand,
  and use this more consistently. The output format is changed
  slightly.
- New helpers rawSystemProc{,Action} for use with new proc

Aside from the logging changes, this should be a no-op.
@robx robx force-pushed the cleanup-processes branch from dfc0913 to cc8a7af Compare February 22, 2022 23:49
@robx robx force-pushed the cleanup-processes branch from cc8a7af to 91fa33b Compare February 23, 2022 00:44
@robx robx changed the title Clean up around subprocess helpers Cleanup around subprocess helpers Feb 23, 2022
@robx robx marked this pull request as ready for review February 23, 2022 01:20
@robx
Copy link
Collaborator Author

robx commented Feb 23, 2022

Alright, fingers crossed this should be ready for review now. The commits are also in a reasonable state now.

Copy link
Member

@Mikolaj Mikolaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhm, lots of removals, great. I assume this is exercised by many tests and it doesn't add any new functionality, so nothing new needs to be tested.

Copy link
Member

@jneira jneira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for the cleanup

@Mikolaj Mikolaj added the merge me Tell Mergify Bot to merge label Feb 23, 2022
@Mikolaj Mikolaj merged commit ddf3ba2 into haskell:master Feb 23, 2022
@Mikolaj
Copy link
Member

Mikolaj commented Feb 23, 2022

CI jobs are stuck due to #8000 not merged yet, so let me merge manually. BTW. I forgot to rebase this one and caused git commit diagram art. Sorry about that.

jneira added a commit to jneira/cabal that referenced this pull request Jul 16, 2022
jneira added a commit to jneira/cabal that referenced this pull request Jul 17, 2022
jneira added a commit to jneira/cabal that referenced this pull request Jul 17, 2022
jneira added a commit to jneira/cabal that referenced this pull request Jul 20, 2022
jneira added a commit to jneira/cabal that referenced this pull request Jul 22, 2022
Mikolaj added a commit to Mikolaj/cabal that referenced this pull request Jul 25, 2022
jneira added a commit to jneira/cabal that referenced this pull request Jul 25, 2022
Mikolaj added a commit that referenced this pull request Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attention: needs-review merge me Tell Mergify Bot to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants