Skip to content

Commit 9f4184e

Browse files
authored
GHA: Simplify gathering the bundled imports for cross-compiled packages (#4871)
By installing the bootstrap compiler and using its imports.
1 parent c138058 commit 9f4184e

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,22 @@ runs:
1616
cd ..
1717
1818
if [[ '${{ inputs.cross_compiling }}' != true ]]; then
19-
cd build
20-
ninja install >/dev/null
21-
cd ..
19+
ninja -C build install >/dev/null
2220
else
2321
mkdir -p install/bin
2422
cp build-cross/bin/{ldc2,ldmd2,ldc-build-runtime,ldc-profdata,ldc-profgen,ldc-prune-cache,timetrace2txt} install/bin/
2523
cp build-cross/bin/ldc-build-plugin install/bin/ || true
24+
2625
cp -R build-cross-libs/lib install/
2726
cp build-cross/lib/{libldc_rt.*,libLTO.dylib,LLVMgold-ldc.so} install/lib/ || true
27+
2828
mkdir install/etc
2929
cp build-cross/bin/ldc2_install.conf install/etc/ldc2.conf
3030
cp -R ldc/packaging/bash_completion.d install/etc/
31-
mkdir install/import
32-
cp -R ldc/runtime/druntime/src/{core,etc,ldc,object.d,__importc_builtins.di,importc.h} install/import/
33-
cp bootstrap-ldc/runtime/import/ldc/gccbuiltins_*.di install/import/ldc/
34-
cp -R ldc/runtime/phobos/etc/c install/import/etc/
35-
rm -rf install/import/etc/c/zlib
36-
cp -R ldc/runtime/phobos/std install/import/
31+
32+
# use imports from installed bootstrap compiler
33+
ninja -C bootstrap-ldc install >/dev/null
34+
mv bootstrap-install/import install/
3735
fi
3836
3937
cp ldc/LICENSE install/

.github/workflows/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ jobs:
268268
arch: x86_64
269269
- name: Build bootstrap LDC
270270
uses: ./.github/actions/2-build-bootstrap
271+
with:
272+
# prepare for installing the bootstrap compiler to ../bootstrap-install/
273+
cmake_flags: >-
274+
-DCMAKE_INSTALL_PREFIX="$PWD/../bootstrap-install"
275+
-DINCLUDE_INSTALL_DIR="$PWD/../bootstrap-install/import"
271276
- name: Build LDC with PGO instrumentation & gather profile from compiling default libs
272277
if: matrix.with_pgo
273278
uses: ./.github/actions/2a-build-pgo

0 commit comments

Comments
 (0)