-
Notifications
You must be signed in to change notification settings - Fork 892
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
consistently add context with file path when parsing fails #3853
Conversation
@Skgland Thanks for making this PR! Would you mind explain in detail what is the motivation of this PR and what has been improved with a simple before/after comparison, for example? PS: To make sure we are on the same page, regarding #3851 I would like to underline that the server incident causing bad manifests being downloaded is probably out of the scope of the Rustup project (so it possibly cannot be "fixed"), although improvements regarding error handling are welcomed. |
Your CI failure is #3852, we will be investigating this on our side. |
Having a manifest parsing error while using cargo I initially assumed a mistake in the Cargo.toml, To recreate the error condition I inserted a NUL byte in a valid manifest file, resulting in the following error before/after my change. Before:
After:
Yes, I agree that the source of the manifest corruption is outside of rustup and as such out of scope. My goal with the Issue and this PR was to improve the error reporting. Also, I am pretty sure that there was no server incident involved, but I believe that the export and re-import of the WSL 2 distribution somehow corrupted the disk image file, resulting in the already installed manifest getting corrupted. |
@Skgland Thanks for the clarification! At Rustup the word "manifest" is used specifically to refer to a certain kind of file downloaded from the Rustup release server, and, as you've found out, named This file is specifically used to determine what are available in this channel, however I have no idea how you got that wrong (since we have shasum checks), sorry about that... Lines 280 to 300 in 3ba08da
This PR might have to wait for #3852 before we get our merge CI green again. If you'd like, in the meantime, you can add a regression test in the file above. |
Ok, just pushed a commit with a regression test |
Hm, looks like my regression test fails on windows due to |
Do you have a suggestion for how to deal with the path-separator discrepancy on windows or should I skip the test on windows with e.g. |
@Skgland Please feel free to use what you consider appropriate for the problem. For example you can use two conditionally compiled assertions for Windows and Unix. Or you can compare the path components. |
fixes #3851