Open
Conversation
During test execution, the work directory is a temporary directory, not the actual source directory. Replacing it with $SRC_DIR in log output is misleading and makes CI debugging difficult since users cannot see the actual filesystem paths being used. Add a `replace_work_dir_in_output` flag to `ExecutionArgs` that controls whether the work directory path is replaced with `$SRC_DIR` in script output. Build execution passes `true` (preserving existing behavior), while test execution passes `false` (showing actual paths). Closes #2072 https://claude.ai/code/session_013oRb3swxDZ3guXSxe7tSgc
Introduce a `LogPathReplacements` enum with three variants: - `All`: replace PREFIX, BUILD_PREFIX, and SRC_DIR (build default) - `ExceptSrcDir`: replace PREFIX and BUILD_PREFIX only (test default) - `None`: no path replacements at all (user opt-out) This replaces the previous `replace_work_dir_in_output: bool` with a more expressive enum that supports full user control. Add `--no-log-path-replacement` CLI flag to `CommonOpts`, available for both `build` and `test` subcommands. When set, concrete filesystem paths are shown in log output instead of `$PREFIX`, `$BUILD_PREFIX`, `$SRC_DIR`, which is useful for debugging in CI environments. The flag is threaded through CommonData -> BuildConfiguration / TestConfiguration -> ExecutionArgs, and the Python bindings default to `false` (existing behavior). Closes #2072 https://claude.ai/code/session_013oRb3swxDZ3guXSxe7tSgc
Member
Author
|
I don't think this addresses the root cause of the issue properly. I noticed (when looking at Jinja variabesl / SP_DIR) that there are a few gaps that we need to look at. First of all, I think Jinja should work in tests, too. We should make the script variables and variant values available at test time as well. The tests:
- script:
- echo "PREFIX = $PREFIX"
- echo "JINJA_PREFIX = ${{ PREFIX }}"
- echo "SP DIR = $SP_DIR"
- echo "And from Jinja = ${{ SP_DIR }}"results in: |
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
This PR introduces a new
LogPathReplacementsenum that provides fine-grained control over which filesystem paths are replaced with variable names (like$PREFIX,$SRC_DIR) in script output logs. This allows users to see concrete filesystem paths when needed for debugging.Key Changes
New
LogPathReplacementsenum inrattler_build_script/src/execution.rs:All: ReplacePREFIX,BUILD_PREFIX, andSRC_DIR(default for build scripts)ExceptSrcDir: ReplacePREFIXandBUILD_PREFIXonly (default for test scripts)None: Disable all path replacements (for debugging)Updated
ExecutionArgsto includelog_path_replacementsfield and modified thereplacements()method to respect the configured replacement levelAdded
--no-log-path-replacementCLI flag inCommonOptsto allow users to disable path replacements from the command lineUpdated
TestConfigurationwith:no_log_path_replacementfieldlog_path_replacements()that returnsExceptSrcDirby default (since test working directories are temporary) orNoneif disabledUpdated
BuildConfigurationwithno_log_path_replacementfield to control path replacement behavior during buildsPropagated the setting through all script execution paths:
LogPathReplacements::Allby defaultLogPathReplacements::ExceptSrcDirby defaultno_log_path_replacementflag to disable all replacementsUpdated Python bindings to pass the flag through the CLI API
Implementation Details
The
replacements()method now conditionally builds the replacement map based on theLogPathReplacementssetting, allowing different levels of path obfuscation. Test scripts specifically skipSRC_DIRreplacement by default since the working directory during tests is a temporary directory, not the actual source directory.https://claude.ai/code/session_013oRb3swxDZ3guXSxe7tSgc