Skip to content
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(forge debug): dunce canonicalize provided path #9252

Closed
wants to merge 1 commit into from

Conversation

grandizzy
Copy link
Collaborator

@grandizzy grandizzy commented Nov 2, 2024

Motivation

Closes #9136
Also outputs proper file does not exist err message

Solution

@grandizzy grandizzy marked this pull request as ready for review November 2, 2024 19:54
Copy link
Member

@klkvr klkvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already do this here

let target_path = if let Ok(path) = dunce::canonicalize(&args.path) {

looks like the error is coming from here

let source = Source::read(path).wrap_err_with(|| {

I think it likely needs to be fixed on compilers side. We need to also normalize paths in build_infos: https://github.com/foundry-rs/compilers/blob/21617d05ae9bab42a509c8c2021977d31b93809a/crates/compilers/src/compile/output/mod.rs#L535

@grandizzy
Copy link
Collaborator Author

we already do this here

I see, was thinking that since this comes from ValueHint::FilePath we might want to apply early, same as we do here

let target_path = dunce::canonicalize(self.target_path)?;

@klkvr
Copy link
Member

klkvr commented Nov 2, 2024

we already do this here

I see, was thinking that since this comes from ValueHint::FilePath we might want to apply early, same as we do here

let target_path = dunce::canonicalize(self.target_path)?;

value hint doesn't affect the input values and eip712 has different flow which doesn't reach the script specific compilation logic which I've linked

@grandizzy
Copy link
Collaborator Author

Closing per comments above, will fix in compilers

@grandizzy grandizzy closed this Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(debugger): forge debug uses backslash in path when compiling on Windows
2 participants