Skip to content

Commit

Permalink
Fix: External env vars are detected as cycles #911
Browse files Browse the repository at this point in the history
  • Loading branch information
sagiegurari committed Aug 10, 2023
1 parent 16f7563 commit e53fdf3
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 105 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### v0.36.13

* Fix: External env vars are detected as cycles #911
* Fix: Auto complete bash script #914 (thanks @gw31415)
* Documentation: Arch Linux installation #880 (thanks @CosminGGeorgescu)
* Documentation: Fix Readme about Binary Release Target #915 (thanks @Azuki-bar)
Expand Down
150 changes: 58 additions & 92 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,9 @@ fn run(cli_args: CliArgs, global_config: &GlobalConfig) {

let config = match descriptor_load_result {
Ok(config) => config,
Err(ref min_version) => {
error!(
"{} version: {} does not meet minimum required version: {}",
&cli_args.command, &VERSION, &min_version
);
panic!(
"{} version: {} does not meet minimum required version: {}",
&cli_args.command, &VERSION, &min_version
);
Err(ref error) => {
error!("{}", error);
panic!("{}", error);
}
};
let mut time_summary_vec = vec![];
Expand Down
4 changes: 3 additions & 1 deletion src/lib/descriptor/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ pub(crate) fn merge_env(

// if the env variable is in the current scope add an edge,
// otherwise it is referencing an external variable.
// also, ignore self reference (such as PATH=${PATH})
let is_external = envmnt::exists(&key);
for used in env_depends_on(val).into_iter() {
if graph.contains_node(used) {
if (key != &used || !is_external) && graph.contains_node(used) {
graph.add_edge(*key, used, ());
}
}
Expand Down
Loading

0 comments on commit e53fdf3

Please sign in to comment.