make local worker execute command with canonicalized path,#2221
Open
zhizhi-dev wants to merge 4 commits intoTraceMachina:mainfrom
Open
make local worker execute command with canonicalized path,#2221zhizhi-dev wants to merge 4 commits intoTraceMachina:mainfrom
zhizhi-dev wants to merge 4 commits intoTraceMachina:mainfrom
Conversation
as rust doc [current_dir](https://doc.rust-lang.org/std/process/struct.Command.html#method.current_dir) say `current_dir` is ambiguous
Author
// The arguments to the command.
//
// The first argument specifies the command to run, which may be either an
// absolute path, a path relative to the working directory, or an unqualified
// path (without path separators) which will be resolved using the operating
// system's equivalent of the PATH environment variable. Path separators
// native to the operating system running on the worker SHOULD be used. If the
// `environment_variables` list contains an entry for the PATH environment
// variable, it SHOULD be respected. If not, the resolution process is
// implementation-defined.
//
// Changed in v2.3. v2.2 and older require that no PATH lookups are performed,
// and that relative paths are resolved relative to the input root. This
// behavior can, however, not be relied upon, as most implementations already
// followed the rules described above.
repeated string arguments = 1; |
Open
Author
thread 'test_sentinel_connect_with_url_specified_master' panicked at nativelink-store/tests/redis_store_test.rs:848:42:
Working spec: Error { code: DeadlineExceeded, messages: ["deadline has elapsed", "Timeout while connecting to redis with url: redis+sentinel://127.0.0.1:46093/?sentinelServiceName=specific_master"] }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtraceWhy ? |
Author
|
Hi, @MarcusSorealheis |
Collaborator
|
@zhizhi-dev I'm reviewing now but in the short term, the tests fail, so we need to get over that issue. |
Member
Test failure was which is weird and I'm not sure why that one occurs as the logs before it seem fine, and it feels unrelated to this issue so re-running. |
palfrey
reviewed
Mar 17, 2026
| PathBuf::from(&args[0]) | ||
| }; | ||
|
|
||
| let mut command_builder = process::Command::new(program); |
Member
There was a problem hiding this comment.
@zhizhi-dev Can you add a test for this please? Possibly split out the canonicalisation as a new function and test that?
palfrey
reviewed
Mar 17, 2026
| let program = if Path::new(&args[0]).components().count() > 1 { | ||
| PathBuf::from(&self.work_directory) | ||
| .join(&command_proto.working_directory) | ||
| .join(&args[0]) |
Member
There was a problem hiding this comment.
BTW there's a warning flag on this one
warning: the borrowed expression implements the required traits
--> nativelink-worker/src/running_actions_manager.rs:937:23
|
937 | .join(&args[0])
| ^^^^^^^^ help: change this to: `args[0]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
Collaborator
There was a problem hiding this comment.
Could this be a false positive?
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.
as rust doc current_dir say
current_diris ambiguousThis change is