Fix devx container failures: Bash 3.2 and impure path errors#226
Merged
Fix devx container failures: Bash 3.2 and impure path errors#226
Conversation
Two fixes for CI failures when consuming devx containers: 1. Use Nix-provided Bash in shebang instead of /usr/bin/env bash. On macOS GitHub Actions runners, /usr/bin/env bash resolves to Apple's Bash 3.2 (GPLv2), but nixpkgs' setup.sh requires Bash 5+. pkgs.bash is already in the closure via stdenv. 2. Disable NIX_ENFORCE_PURITY before sourcing stdenv/setup. The stdenv preHook defaults NIX_ENFORCE_PURITY to 1, causing cc-wrapper to reject -I/-L flags outside /nix/store/. This breaks cabal builds that use $HOME/.cabal-devx/store/. Setting it to empty before sourcing setup.sh matches nix develop behavior.
There was a problem hiding this comment.
Pull request overview
Updates the generated devx development-environment wrapper to be more reliable in CI/containers and on macOS by pinning the interpreter and disabling Nix purity enforcement before initializing stdenv.
Changes:
- Switch the
devxwrapper shebang to Nix-provided Bash (${pkgs.bash}/bin/bash) to avoid macOS runner Bash 3.2. - Export
NIX_ENFORCE_PURITY=before sourcing"$stdenv/setup"so cc-wrapper doesn’t reject non-store-I/-Lpaths in dev shells.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pkgs.bash) in the devx wrapper shebang instead of/usr/bin/env bash, fixing Bash 3.2 rejection on macOS GitHub Actions runnersNIX_ENFORCE_PURITYbefore sourcingstdenv/setup, fixing cc-wrapper rejecting-I/-Lflags pointing outside/nix/store/(e.g. the cabal package store)Fixes all 4 failing jobs in stable-haskell/ghc CI.
Test plan
/nix/store/.../bin/bashNIX_ENFORCE_PURITY=is set beforesource "$stdenv/setup"