Skip to content

Make ‘cabal exec’ not pass -package-env to called executable #10990

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 4 commits into from
Jun 21, 2025

Conversation

sergv
Copy link
Collaborator

@sergv sergv commented Jun 16, 2025

Summary

The cabal exec always passed only the options user explicitly specified but after #10828 started passing -package-env as well.

This is a followup to #10828 that fixes cabal exec that passes -package-env flag to all executables if underlying ghc supports env files. This breaks said executables.

Longer version

cabal exec started passing -package-env=- to all executables if
underlying GHC supports env files. This makes the called executable
fail if it doesn’t support the -package-env flag, which many
executables don’t.

This change restores old cabal exec behaviour to call regular
executables without any extra command-line options and keeps fixes in
PR 10828 that passes -package-env when dealing with GHC in other
cabal commands. GHC is not typically called via cabal exec but the
PR 10828 made other commands like cabal build pass the flag. This PR
attempts to maintain that.

Please read Github PR Conventions and then fill in one of these two templates.


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

It never did previously and it’s a bug that it started to.
@sergv sergv requested a review from mpickering June 16, 2025 23:56
@sergv sergv force-pushed the fix-cabal-exec branch 2 times, most recently from 2a45726 to d2d50cd Compare June 16, 2025 23:58
@ulysses4ever
Copy link
Collaborator

Sounds good to me but it'd be great to have the author of #10828 weigh in, @mpickering

Copy link
Collaborator

@mpickering mpickering left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for the precise fix.

@sergv sergv added the merge me Tell Mergify Bot to merge label Jun 17, 2025
@mergify mergify bot added the ready and waiting Mergify is waiting out the cooldown period label Jun 17, 2025
@mergify mergify bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Jun 21, 2025
mergify bot added a commit that referenced this pull request Jun 21, 2025
Copy link
Contributor

mergify bot commented Jun 21, 2025

This pull request has been removed from the queue for the following reason: checks failed.

The merge conditions cannot be satisfied due to failing checks:

You can check the last failing draft PR here: #11009.

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

Copy link
Contributor

mergify bot commented Jun 21, 2025

This pull request has been removed from the queue for the following reason: pull request branch update failed.

The pull request can't be updated.

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

@mergify mergify bot merged commit d958545 into haskell:master Jun 21, 2025
54 checks passed
@sergv sergv deleted the fix-cabal-exec branch June 21, 2025 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge ready and waiting Mergify is waiting out the cooldown period
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants