bors fbcd9bb571 Auto merge of #14464 - linyihai:issue-14194, r=weihanglo
fix: avoid inserting duplicate `dylib_path_envvar` when calling `cargo run` recursively

### What does this PR try to resolve?

If the current program started by `cargo run` recursively call into `cargo run`, the second `cargo run` will insert  `search_path`  into `dylib_path_envvar` again.

Fixes #14194

### How should we test and review this PR?

The first commit adds the test to reflect the issue. The first call to `cargo run` stores the dylib search path env var to a file. Subsequent calls verify that env var remains the same.

The second commit fixes the behavior by checking if env vars in `search_path` are a prefix of the slice of env vars in `dylib_path_envvar`.
2024-10-08 12:51:33 +00:00
..