Skip to content

configure: quote generated shell environment values#752

Open
moreaki wants to merge 1 commit into
VirtualBox:mainfrom
moreaki:agent/configure-env-shell-quote
Open

configure: quote generated shell environment values#752
moreaki wants to merge 1 commit into
VirtualBox:mainfrom
moreaki:agent/configure-env-shell-quote

Conversation

@moreaki

@moreaki moreaki commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Quote non-Windows generated env.sh values before writing export KEY=value lines.

This keeps source ./env.sh working when inherited environment values contain spaces, for example a PATH entry under a macOS .app bundle. Windows env.bat output is unchanged.

The formatting helper converts the value to a string before passing it to shlex.quote, so scalar environment values remain robust as well.

Reproduction

Without quoting, a generated line such as:

export PATH=/usr/bin:/Applications/Little Snitch.app/Contents/Components:/bin

is parsed as a split assignment and an additional invalid export argument.

Validation

  • Rebased and applied independently to current origin/main (5ac81eda).
  • One file; git diff --check and python3 -m py_compile configure.py pass.
  • Ran a clean Darwin configure with the inherited PATH containing /Applications/Little Snitch.app/Contents/Components.
  • The generated line is shell-quoted; sourcing env.sh succeeds and restores the exact original PATH, including the space-containing entry.
  • The integrated full Darwin/Arm build completed with exit 0 after sourcing that environment and supplying the separate kBuild SDK/tool overrides required by the current tree.

Scope

This PR fixes shell serialization only. It does not claim that all configure SDK selections are propagated into AutoConfig.kmk; the current local Darwin build still requires explicit PATH_SDK_MACOSX* and tool overrides at kmk invocation time.

Closes #750.

@oracle-contributor-agreement

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Jul 8, 2026
Quote non-Windows env.sh values when writing generated build environment files. This keeps source ./env.sh working when inherited environment values such as PATH contain spaces.

Windows env.bat output is left unchanged.

Signed-off-by: Roberto Nibali <rnibali@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

configure.py: quote generated shell environment values

1 participant