-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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(compile): never include the specified output executable in itself #27877
fix(compile): never include the specified output executable in itself #27877
Conversation
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.
Thanks! See comment though.
cli/tools/compile.rs
Outdated
let file_index = include_files.iter().position(|file_included| { | ||
file_included | ||
.path() | ||
.ends_with(output_path.to_str().unwrap().replace(" ", "%20").as_str()) |
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.
I don't think this will work on windows. It should probably be converted to a url first. Can you add a test for this change?
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.
I investigated this and found out the reason it was working is because output_path happened to be the filename in the tests. I updated it to use the full path instead.
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 won't work on Windows because urls use forward slashes, but windows uses backslashes)
Signed-off-by: David Sherret <[email protected]>
Co-authored-by: David Sherret <[email protected]> Signed-off-by: HasanAlrimawi <[email protected]>
…Alrimawi/deno into compile-exclude-executable
…Alrimawi/deno into compile-exclude-executable
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. Thanks!
closes #27796
Change
Check if the output executable file is within the included files to be compiled, and remove it if so.