Skip to content

wasm-sourcemap.py: fix handling of paths on different drives - #12136

Merged
sbc100 merged 2 commits into
emscripten-core:masterfrom
GeorgRottensteiner:fix_issue_12111
Sep 9, 2020
Merged

wasm-sourcemap.py: fix handling of paths on different drives#12136
sbc100 merged 2 commits into
emscripten-core:masterfrom
GeorgRottensteiner:fix_issue_12111

Conversation

@GeorgRottensteiner

@GeorgRottensteiner GeorgRottensteiner commented Sep 9, 2020

Copy link
Copy Markdown
Contributor

Fixed issue with code files included from different drives (Windows), where wasm-sourcemap.py would bail out with an error

Fixes: #12111

#12111

Fixed issue with code files included from different drives (Windows), where wasm-sourcemap.py would bail out with an error
@welcome

welcome Bot commented Sep 9, 2020

Copy link
Copy Markdown

Thank you for submitting a pull request! If this is your first PR, make sure to add yourself to AUTHORS.

@sbc100 sbc100 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

Have you verified that the resulting source maps with absolute paths actually work?

Comment thread tools/wasm-sourcemap.py Outdated
try:
file_name = os.path.relpath(file_name, base_path)
except Exception:
pass

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can you put the file_name = os.path.abspath(file_name) here in the exception block? Perhaps with a comment relpath can throw ValueError on windows if paths are not on the same drive.

Also can you catch just ValueError?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sounds sensible, I'm on it.

Regarding verifying, it seems to not reliably work. Of course the local web server of course fails to access files that are outside of its root folder. The net win of this PR is that the build does not abort anymore.
Obviously you still have to keep all mapped files inside the web servers reach.

@sbc100

sbc100 commented Sep 9, 2020

Copy link
Copy Markdown
Collaborator

Could you perhaps re-title this PR something like: "wasm-sourcemap.py: fix handling of paths on different drives"?

@GeorgRottensteiner GeorgRottensteiner changed the title Fix issue 12111: wasm-sourcemap.py: fix handling of paths on different drives Sep 9, 2020
Only catch ValueError
@sbc100
sbc100 merged commit 9df4917 into emscripten-core:master Sep 9, 2020
@GeorgRottensteiner
GeorgRottensteiner deleted the fix_issue_12111 branch September 10, 2020 07:21
@kripken

kripken commented Sep 10, 2020

Copy link
Copy Markdown
Member

I think we missed the AUTHORS bot message,

Thank you for submitting a pull request! If this is your first PR, make sure to add yourself to AUTHORS.

If it's not too much trouble, can you open another PR with that @GeorgRottensteiner ?

@GeorgRottensteiner

Copy link
Copy Markdown
Contributor Author

Ah ok, you didn't miss it, I thought it was overkill to add another PR for that. But I'll do that ;)

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.

wasm-sourcemap.py fails if parts of the code are on a different drive on Windows

3 participants