Skip to content

Commit 768759b

Browse files
committed
GHA Alpine: include shared druntime+Phobos too
1 parent 094ab42 commit 768759b

File tree

5 files changed

+28
-27
lines changed

5 files changed

+28
-27
lines changed

.github/actions/6-integration-test/action.yml

-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ runs:
1515
run: |
1616
set -eux
1717
cd ..
18-
if type -P apk &>/dev/null; then
19-
exit 0 # Alpine: no shared libs
20-
fi
2118
if [[ '${{ runner.os }}' == Windows ]]; then
2219
# add druntime/Phobos DLL dir to PATH
2320
export PATH="$PWD/installed/bin:$PATH"

.github/workflows/main.yml

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ jobs:
6161
# TSan and XRay do not work.
6262
extra_cmake_flags: >-
6363
-DBUILD_LTO_LIBS=ON
64-
-DBUILD_SHARED_LIBS=OFF
6564
-DLLVM_IS_SHARED=OFF
6665
-DLDC_ENABLE_PLUGINS=OFF
6766
-DLDC_DYNAMIC_COMPILE=OFF

runtime/druntime/test/shared/Makefile

+4-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LINK_SHARED:=$(SHARED)
44
include ../common.mak # affected by LINK_SHARED!
55

66
ifneq (,$(LINK_SHARED))
7-
# LDC: disable 3 tests on Mac, 1 on Windows
7+
# LDC: disable 2 tests on Mac, 1 on Windows
88
ifeq (,$(findstring ldmd2,$(DMD)))
99
# TODO: enable tests on Windows
1010
ifeq (windows,$(OS))
@@ -14,20 +14,18 @@ ifneq (,$(LINK_SHARED))
1414
link_linkdep load_linkdep link_loaddep load_loaddep load_13414
1515
endif
1616
else
17-
TESTS:=link load linkD linkDR loadDR dynamiccast \
17+
TESTS:=link load linkD linkDR loadDR finalize dynamiccast \
1818
link_linkdep link_loaddep load_loaddep load_13414
1919
ifneq ($(OS),osx)
2020
# * `host` loads two modules with the same name, which is currently disallowed
2121
# by the (potentially overly eager) module collision detection on OS X.
22-
# * `finalize` fails starting with macOS 10.13, as .dylibs with TLS can't be
23-
# unloaded anymore (https://github.com/ldc-developers/ldc/issues/3002).
2422
# * FIXME: `load_linkdep`
2523
# it might fail because of unimplemented `getDependencies()` in rt.sections_elf_shared
2624
ifeq (windows,$(OS))
2725
# LDC FIXME: disable `load_linkdep` on Windows - needs `getDependencies()`
28-
TESTS+=host finalize
26+
TESTS+=host
2927
else
30-
TESTS+=host finalize load_linkdep
28+
TESTS+=host load_linkdep
3129
endif
3230
endif
3331
endif

runtime/druntime/test/shared/src/finalize.d

+15-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void main(string[] args)
4545
auto nf1 = new NoFinalize;
4646
auto nf2 = new NoFinalizeBig;
4747

48-
shared size_t finalizeCounter;
48+
shared static size_t finalizeCounter;
4949
SetFinalizeCounter setFinalizeCounter;
5050
loadSym(h, setFinalizeCounter, "setFinalizeCounter");
5151
setFinalizeCounter(&finalizeCounter);
@@ -58,8 +58,20 @@ void main(string[] args)
5858
auto r = Runtime.unloadLibrary(h);
5959
if (!r)
6060
assert(0);
61-
if (finalizeCounter != 4)
62-
assert(0);
61+
version (darwin)
62+
{
63+
// Fails starting with macOS 10.13, as .dylibs with TLS can't be
64+
// unloaded anymore (https://github.com/ldc-developers/ldc/issues/3002).
65+
}
66+
else version (CRuntime_Musl)
67+
{
68+
// On Musl, dlclose is a no-op
69+
}
70+
else
71+
{
72+
if (finalizeCounter != 4)
73+
assert(0);
74+
}
6375
if (nf1._finalizeCounter)
6476
assert(0);
6577
if (nf2._finalizeCounter)

runtime/druntime/test/shared/src/load_13414.d

+9-14
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,20 @@ void runTest(string name)
2222
*pLibSharedStaticDtorHook = &sharedStaticDtorHook;
2323

2424
const unloaded = Runtime.unloadLibrary(h);
25-
version (CRuntime_Musl)
25+
assert(unloaded);
26+
assert(tlsDtor == 1);
27+
version (LDC_darwin)
2628
{
27-
// On Musl, unloadLibrary is a no-op because dlclose is a no-op
28-
assert(!unloaded);
29-
assert(tlsDtor == 0);
29+
// Since 10.13: https://github.com/ldc-developers/ldc/issues/3002
3030
assert(dtor == 0);
3131
}
32-
else
32+
else version (CRuntime_Musl)
3333
{
34-
assert(unloaded);
35-
assert(tlsDtor == 1);
36-
version (LDC_darwin)
37-
{
38-
// Since 10.13: https://github.com/ldc-developers/ldc/issues/3002
39-
assert(dtor == 0);
40-
}
41-
else
42-
assert(dtor == 1);
34+
// On Musl, dlclose is a no-op
35+
assert(dtor == 0);
4336
}
37+
else
38+
assert(dtor == 1);
4439
}
4540

4641
void main(string[] args)

0 commit comments

Comments
 (0)