Skip to content

Conversation

ramonasuncion
Copy link
Contributor

Convert VAR=value cmd to env VAR=value cmd in Concurrency tests for compatibility with LLVM Lit’s internal shell.

Partially address #84407

…internal shell

Convert `VAR=value cmd` to `env VAR=value cmd` in Concurrency tests for compatibility with LLVM Lit’s internal shell.

Partially address swiftlang#84407
// RUN: %target-build-swift -target %target-swift-5.1-abi-triple -parse-as-library %s -o %t/a.out
// RUN: %target-codesign %t/a.out
// RUN: %env-SWIFT_IS_CURRENT_EXECUTOR_LEGACY_MODE_OVERRIDE=legacy %target-run %t/a.out
// RUN: env SWIFT_IS_CURRENT_EXECUTOR_LEGACY_MODE_OVERRIDE=legacy %target-run %t/a.out
Copy link
Contributor

Choose a reason for hiding this comment

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

The %env- here is replaced by lit with this substitution rule in test/lit.cfg (substitutions generally start with %):

# Different OS's require different prefixes for the environment variables to be
# propagated to the calling contexts.
# In order to make tests OS-agnostic, names of environment variables should be
# prefixed with `%env-`, which is then expanded to the appropriate prefix.
config.substitutions.append(('%env-', config.target_env_prefix))

We still want this expansion to occur, so that env vars use the appropriate prefix for the relevant context. Could you instead change it to be env %env-SWIFT_IS_CURRENT_EXECUTOR_LEGACY_MODE_OVERRIDE=legacy %target-run %t/a.out?

@hnrklssn
Copy link
Contributor

@swift-ci please smoke test

@hnrklssn hnrklssn enabled auto-merge September 30, 2025 15:50
@hnrklssn hnrklssn merged commit 4f9c3d9 into swiftlang:main Sep 30, 2025
3 checks passed
@ramonasuncion ramonasuncion deleted the fix-test-env-concurrency branch September 30, 2025 21:39
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 this pull request may close these issues.

2 participants