-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(remappings): ignore remappings of root proj dirs when merging #9258
Conversation
crates/cli/src/opts/build/core.rs
Outdated
if !config_path.exists() { | ||
panic!("error: config-path `{}` does not exist", config_path.display()) | ||
} | ||
if !config_path.ends_with(Config::FILE_NAME) { | ||
panic!("error: the config-path must be a path to a foundry.toml file") | ||
} | ||
let config_path = canonicalized(config_path); | ||
Config::figment_with_root(config_path.parent().unwrap()) | ||
let root_path = config_path.parent().unwrap(); | ||
(Config::figment_with_root(root_path), Config::load_with_root(root_path)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this could be an issue for different profile (than the default one) specific paths
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is very expensive and now does Config::figment_with_root(root_path)
twice under the hood.
especially because this is only used to apply smth to arguments?
feels like the wrong location to do this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like we only need the project paths and not the entire config to modify the remappings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, good point, I changed this in 8b2d7b0 to load them from figment, this also correctly loads the current profile src/script/test dirs.
Hope this makes sense, pls check. thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 👍
…undry-rs#9258) * fix(remappings): ignore remappings of root proj dir when merging * Remove unused code * Add test * Update * Load project paths from figment --------- Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>
Motivation
Closes #3440
Solution