Skip to content

Commit 7e87e5a

Browse files
committed
ci: also build the artifact that links to the runtime DLL
It is no longer clear from the documentation at https://sevenzip.osdn.jp/chm/cmdline/switches/sfx.htm that the `7zSD.sfx` links to MSVCRT.dll (as opposed to `7zS.sfx`, which apparently does not). StackOverflow to the rescue: https://stackoverflow.com/a/15770961/1860823 Since Git for Windows wants to use the minimum amount of dependencies in the self-extracting installers (such as the Portable Git), it used to use the `7zSD.sfx` artifact. However, since we rebuilt the SFX component using a recent Visual C version, which does not link to `msvcrt.dll` but to `vcruntime140.dll`, we ran into problems: git-for-windows/git#1127 In essence, we cannot rely on the presence of `vcruntime140.dll` (where we could always rely on `msvcrt.dll` being there). So we have to go back to using `7zS.sfx`, even if it is a bit larger. As of August 2023, the difference is 155 vs 233 kilobytes. Nevertheless, let's build both artifacts. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 9506d99 commit 7e87e5a

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

.github/workflows/msbuild.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ jobs:
1010
build:
1111
runs-on: windows-latest
1212

13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
config:
17+
# Note: `ReleaseD` builds 7zSD.sfx (which used to be linked to
18+
# `msvcrt.dll` with older Visual C versions, but with recent ones
19+
# links to `vcruntime140.dll`), as opposed to 7zS.sfx, which is
20+
# linked statically.
21+
- name: ReleaseD
22+
artifact: 7zSD
23+
- name: Release
24+
artifact: 7zS
25+
1326
steps:
1427
- uses: actions/checkout@v4
1528

@@ -18,10 +31,10 @@ jobs:
1831

1932
- name: Build
2033
working-directory: ${{ github.workspace }}
21-
run: msbuild /m /p:Configuration=Release ${{ env.SOLUTION_FILE_PATH }}
34+
run: msbuild /m /p:Configuration=${{ matrix.config.name }} ${{ env.SOLUTION_FILE_PATH }}
2235

2336
- name: Upload SFX bundle
2437
uses: actions/upload-artifact@v4
2538
with:
26-
name: sfx-bundle
27-
path: CPP/7zip/Bundles/SFXSetup/Release/7zS.sfx
39+
name: ${{ matrix.config.artifact }}
40+
path: CPP/7zip/Bundles/SFXSetup/${{ matrix.config.name }}/${{ matrix.config.artifact }}.sfx

0 commit comments

Comments
 (0)