Skip to content

Editing asset cache output when using x-script#1541

Merged
JavierMatosD merged 5 commits intomicrosoft:mainfrom
JavierMatosD:reorder_script_messages
Nov 19, 2024
Merged

Editing asset cache output when using x-script#1541
JavierMatosD merged 5 commits intomicrosoft:mainfrom
JavierMatosD:reorder_script_messages

Conversation

@JavierMatosD
Copy link
Copy Markdown
Contributor

@JavierMatosD JavierMatosD changed the title Tweaking asset cache output when using x-script Editing asset cache output when using x-script Nov 13, 2024
@JavierMatosD
Copy link
Copy Markdown
Contributor Author

return urls[0];
}

errors.push_back(std::move(maybe_success).error());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This function is being fairly careful to put the errors in errors rather than emitting them here directly; can you explain why this case is different than the others?

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.

I believe this error occurs when there is a sha mismatch. I'm printing rather than putting in errors so that the order of the failure messages makes sense and is consistent with the download failure messages below.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess I would really like to see at least a comment here explaining what the criteria for 'errors' vs being printed directly is, since changing which is which on and ad-hoc basis like this seems likely to create as many bugs as solved every time it is touched.

However, this function is already awful about that so not going to block over this.

@JavierMatosD JavierMatosD merged commit 99de266 into microsoft:main Nov 19, 2024
BillyONeal added a commit that referenced this pull request Jan 15, 2025
…utput (#1565)

Extensive overhaul of our downloads handling and console output; @JavierMatosD and I have gone back and forth several times and yet kept introducing unintended bugs in other places, which led me to believe targeted fixes would no longer cut it.

Fixes many longstanding bugs and hopefully makes our console output for this more understandable:
* We no longer print 'error' when an asset cache misses but the authoritative download succeeds. This partially undoes #1541. It is good to print errors immediately when they happen, but if a subsequent authoritative download succeeds we need to not print those errors.
* We now always and consistently print output from x-script s at the time that actually happens. Resolves https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2300063
* We don't tell the user that proxy settings might fix a hash mismatch problem.
* We do tell the user that proxy settings might fix a download from asset cache problem.
* We now always tell the user the full command line we tried when invoking an x-script that fails.
* We don't crash if an x-script doesn't create the file we expect, or creates a file with the wrong hash.
* We now always print what we are doing *before* touching the network, so if we hang the user knows which server is being problematic. Note that this includes storing back to asset caches which we were previously entirely silent about except in case of failure.

Other changes:
* Removed debug output about asset cache configuration. The output was misleading / wrong depending on readwrite settings, and echoing to the user exactly what they said before we've interpreted it is not useful debug output. (Contrast with other `VcpkgPaths` debug output which tend to be paths we have likely changed from something a user said) 

Other notes:
* This makes all dependencies of #908 speak `DiagnosticContext` so it will be easy to audit that the foreground/background thread behavior is correct after this.
* I did test the curl status parsing on old Ubuntu again.

Special thanks to @JavierMatosD for his help in review of the first console output attempts and for blowing the dust off this area in the first place.
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.

2 participants