Skip to content

Conversation

@dscho
Copy link
Member

@dscho dscho commented Aug 25, 2023

Sadly, the validation of the installer did not do what was intended, and hence did not verify the installation at all. This PR fixes it.

This is a companion to git-for-windows/build-extra#524 and to git-for-windows/git-sdk-64#73.

dscho added 5 commits August 24, 2023 22:16
This helps debugging a lot.

Signed-off-by: Johannes Schindelin <[email protected]>
Ever since c800a3f60 (installer: loudly warn when installing a 32-bit
Git for Windows, 2023-02-21), we complained loudly when a user tried to
install a 32-bit Git for Windows on a 64-bit Windows.

As somewhat intended side effect, it became impossible to install a
32-bit Git for Windows on a 64-bit Windows.

One of the unintended consequences, though, was that the automated
workflow runs that verify the installer could no longer run the 32-bit
installer successfully.

Unfortunately, due to a bug in the workflow definition (which will be
fixed after this here commit), this problem never caused the workflow
runs to fail, and therefore both bugs went undetected for months.

This commit fixes the bug where the 32-bit installer would not complete
successfully in the workflow runs.

Signed-off-by: Johannes Schindelin <[email protected]>
When running a PowerShell script, the exit code will be determined
by the last command that was run.

Unfortunately, in the PR build, we run a couple of commands _after_
running the installer, and since we do not check for the exit code
of the installer process, we miss failures.

This is particularly bad because we missed the fact that we failed to
run the 32-bit installer tests ever since we deprecated installing the
32-bit variant on a 64-bit system (such as the GitHub Actions build
agent where the PR build runs...) in c800a3f60 (installer: loudly warn
when installing a 32-bit Git for Windows, 2023-02-21).

Let's check explictly if the installer failed.

Note: We cannot simply use `$?` but need to look at the `ExitCode`
attribute of the process returned by `Start-Process`, _and_ we need to
pass `-PassThru` for this to work, due to a bug in `Start-Process`. See
https://stackoverflow.com/a/16018287/1860823 for a more complete
explanation.

Signed-off-by: Johannes Schindelin <[email protected]>
In addition to the exit code, let's make extra certain that the
installation succeeded.

Signed-off-by: Johannes Schindelin <[email protected]>
We really want no failures to be hidden, whether fatal or non-fatal.
Regular installations should always succeed without any failures.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho self-assigned this Aug 25, 2023
@dscho dscho merged commit ba360cf into git-for-windows:main Aug 25, 2023
@dscho dscho deleted the fix-git-artifacts-installer-validation branch August 25, 2023 08:34
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.

1 participant