Skip to content

Commit d4dab47

Browse files
authored
Windows: Bundle official libcurl builds (#4855)
1 parent 29230c3 commit d4dab47

File tree

4 files changed

+27
-14
lines changed

4 files changed

+27
-14
lines changed

.github/actions/1-setup/action.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,19 +162,21 @@ runs:
162162
run: |
163163
set -eux
164164
cd ..
165-
curl -fL --retry 3 --max-time 60 -o libcurl.7z \
166-
https://github.com/ldc-developers/mingw-w64-libs/releases/download/v8.0.0/libcurl-7.74.0-zlib-static-ipv6-sspi-schannel.7z
165+
166+
url='https://curl.se/windows/latest.cgi?p=win64-mingw.zip'
167+
if [[ '${{ inputs.arch }}' == x86 ]]; then
168+
url='https://curl.se/windows/latest.cgi?p=win32-mingw.zip'
169+
fi
170+
171+
curl -fL --retry 3 --max-time 60 -o libcurl.zip "$url"
167172
mkdir libcurl
168173
cd libcurl
169-
7z x ../libcurl.7z >/dev/null
170-
rm ../libcurl.7z
174+
7z x ../libcurl.zip >/dev/null
175+
rm ../libcurl.zip
171176
mkdir ldc2
172-
if [[ '${{ inputs.arch }}' == x64 ]]; then
173-
cp dmd2/windows/bin64/libcurl.dll ldc2/
174-
cp dmd2/windows/lib64/*.* ldc2/
175-
else
176-
cp dmd2/windows/bin/libcurl.dll ldc2/
177-
cp dmd2/windows/lib32mscoff/*.* ldc2/
177+
cp curl-*/bin/{libcurl*.dll,curl-ca-bundle.crt} ldc2/
178+
if [[ '${{ inputs.arch }}' != x86 ]]; then
179+
mv ldc2/libcurl*.dll ldc2/libcurl.dll
178180
fi
179181
ls -lh ldc2/
180182

.github/actions/5-install/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ runs:
6767
set -eux
6868
cd ..
6969
70-
cp libcurl/ldc2/libcurl.dll installed/bin/
71-
cp libcurl/ldc2/*.* installed/lib/
70+
cp libcurl/ldc2/* installed/bin/
7271
7372
curl -fL --retry 3 --max-time 60 -o mingw-w64-libs.7z \
7473
https://github.com/ldc-developers/mingw-w64-libs/releases/download/v8.0.0/mingw-w64-libs-v8.0.0.7z

.github/actions/merge-windows/action.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ runs:
2121
cd ldc2-multilib
2222
mv lib lib64
2323
cp -R ../ldc2-x86/lib lib32
24-
cp ../ldc2-x86/bin/*.{dll,pdb} lib32/
24+
cp ../ldc2-x86/bin/{*.dll,*.pdb,curl-ca-bundle.crt} lib32/
2525
- name: Merge ldc2.conf
2626
shell: pwsh
2727
run: |
@@ -105,6 +105,17 @@ runs:
105105
echo on
106106
ldc2-multilib\bin\ldc2 -mtriple=aarch64-windows-msvc hello.d || exit /b
107107
ldc2-multilib\bin\ldc2 -mtriple=aarch64-windows-msvc -link-defaultlib-shared hello.d || exit /b
108+
- name: Add arm64 libcurl
109+
shell: bash
110+
run: |
111+
set -eux
112+
url='https://curl.se/windows/latest.cgi?p=win64a-mingw.zip'
113+
curl -fL --retry 3 --max-time 60 -o libcurl.zip "$url"
114+
7z x libcurl.zip >/dev/null
115+
rm libcurl.zip
116+
cp curl-*/bin/{libcurl*.dll,curl-ca-bundle.crt} ldc2-multilib/libarm64/
117+
rm -rf curl-*
118+
mv ldc2-multilib/libarm64/libcurl*.dll ldc2-multilib/libarm64/libcurl.dll
108119
109120
- name: Pack multilib package
110121
shell: bash

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
- New prebuilt package for Alpine Linux x86_64 with musl libc. It's currently generated on Alpine v3.20, using its default LLVM 17. Most bundled executables are fully static and can be run on ~all distros. (#4826)
77
- Revived dynamic-compile (JIT) functionality (formerly unsupported since LLVM 12), supporting LLVM 18+ now. (#4774)
88
- ldc2.conf: `%%ldcversion%%` placeholder added, allowing to refer to version-specific directories.
9+
- Windows: The prebuilt packages now bundle an official libcurl build (from https://curl.se/windows/), currently v8.12.1. The static library (`curl_a.lib`) isn't available anymore. (#4855)
910

1011
#### Platform support
1112
- Supports LLVM 15 - 19.
1213
- Initial compiler and runtime support for ppc64 and ppc64le systems that use IEEE 754R 128-bit floating-point as the default 128-bit floating-point format. (#4833)
13-
- Initial support for Windows on ARM64. The prebuilt Windows multilib package/installer bundles prebuilt arm64 druntime and Phobos; cross-compiling works out of the box via `-mtriple=aarch64-windows-msvc`, but you currently need to set up a suited MSVC arm64 build environment before yourself (e.g., by running `vsdevcmd.bat -arch=arm64 -host_arch=x64`). There's no bundled libcurl either yet. (#4835, #4846)
14+
- Initial support for Windows on ARM64. The prebuilt Windows multilib package/installer bundles prebuilt arm64 druntime and Phobos; cross-compiling works out of the box via `-mtriple=aarch64-windows-msvc`, but you currently need to set up a suited MSVC arm64 build environment before yourself (e.g., by running `vsdevcmd.bat -arch=arm64 -host_arch=x64`). (#4835, #4846)
1415

1516
#### Bug fixes
1617
- Building multi-file D applications with control-flow protection will no longer cause LDC to throw an internal compiler error. (#4828)

0 commit comments

Comments
 (0)