wasm-sourcemap.py: fix handling of paths on different drives - #12136
Conversation
#12111 Fixed issue with code files included from different drives (Windows), where wasm-sourcemap.py would bail out with an error
|
Thank you for submitting a pull request! If this is your first PR, make sure to add yourself to AUTHORS. |
| try: | ||
| file_name = os.path.relpath(file_name, base_path) | ||
| except Exception: | ||
| pass |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
Could you perhaps re-title this PR something like: "wasm-sourcemap.py: fix handling of paths on different drives"? |
Only catch ValueError
|
I think we missed the AUTHORS bot message,
If it's not too much trouble, can you open another PR with that @GeorgRottensteiner ? |
|
Ah ok, you didn't miss it, I thought it was overkill to add another PR for that. But I'll do that ;) |
Fixed issue with code files included from different drives (Windows), where wasm-sourcemap.py would bail out with an error
Fixes: #12111