build-remote: Fix missing log output #1699
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
storeUri
variable in the build-remote hook is declared very much to the start of themain
function and a bunch of lines later, the same variable gets checked viahasPrefix()
but it gets assigned after that check when the most suitable machine for the build was choosen.So I guess this was just a typo in d16fd24 and what we really want is to either check the prefix after assigning
storeUri
or usebestMachine->storeUri
directly.I choose the latter, because the former could introduce even more regressions if the try block where the variable gets assigned terminates early.
Nevertheless, the reason why the log output didn't work is because
hasPrefix()
checked forssh://
in front ofstoreUri
, but if thestoreUri
isn't set correctly (or at all), we don't get the log file descriptor set up properly, leading to no log output.I've adjusted the remote-builds test to include a regression test for this, so that we can make sure we get a build output when using remote builds.
In addition to that I've tested this with two of my build farms and the build logs are emitted correctly again.