dlang / dub

Package and build management system for D
MIT License
661 stars 227 forks source link

[stable] Upgrade CI configuration following macOS-11 deprecation #2933

Closed Geod24 closed 1 week ago

Geod24 commented 1 week ago

macOS-11 is going away at the end of June.

github-actions[bot] commented 1 week ago

✅ PR OK, no changes in deprecations or warnings

Total deprecations: 0

Total warnings: 0

Build statistics:

 statistics (-before, +after)
 executable size=5242696 bin/dub
-rough build time=60s
+rough build time=61s
Full build output ``` DUB version 1.37.0, built on May 11 2024 LDC - the LLVM D compiler (1.38.0): based on DMD v2.108.1 and LLVM 18.1.5 built with LDC - the LLVM D compiler (1.38.0) Default target: x86_64-unknown-linux-gnu Host CPU: znver3 http://dlang.org - http://wiki.dlang.org/LDC Registered Targets: aarch64 - AArch64 (little endian) aarch64_32 - AArch64 (little endian ILP32) aarch64_be - AArch64 (big endian) amdgcn - AMD GCN GPUs arm - ARM arm64 - ARM64 (little endian) arm64_32 - ARM64 (little endian ILP32) armeb - ARM (big endian) avr - Atmel AVR Microcontroller bpf - BPF (host endian) bpfeb - BPF (big endian) bpfel - BPF (little endian) hexagon - Hexagon lanai - Lanai loongarch32 - 32-bit LoongArch loongarch64 - 64-bit LoongArch mips - MIPS (32-bit big endian) mips64 - MIPS (64-bit big endian) mips64el - MIPS (64-bit little endian) mipsel - MIPS (32-bit little endian) msp430 - MSP430 [experimental] nvptx - NVIDIA PTX 32-bit nvptx64 - NVIDIA PTX 64-bit ppc32 - PowerPC 32 ppc32le - PowerPC 32 LE ppc64 - PowerPC 64 ppc64le - PowerPC 64 LE r600 - AMD GPUs HD2XXX-HD6XXX riscv32 - 32-bit RISC-V riscv64 - 64-bit RISC-V sparc - Sparc sparcel - Sparc LE sparcv9 - Sparc V9 spirv - SPIR-V Logical spirv32 - SPIR-V 32-bit spirv64 - SPIR-V 64-bit systemz - SystemZ thumb - Thumb thumbeb - Thumb (big endian) ve - VE wasm32 - WebAssembly 32-bit wasm64 - WebAssembly 64-bit x86 - 32-bit X86: Pentium-Pro and above x86-64 - 64-bit X86: EM64T and AMD64 xcore - XCore Upgrading project in /home/runner/work/dub/dub/ Starting Performing "release" build using /opt/hostedtoolcache/dc/ldc2-1.38.0/x64/ldc2-1.38.0-linux-x86_64/bin/ldc2 for x86_64. Building dub 1.38.1-rc.1+commit.3.g9c83a7d7: building configuration [application] Linking dub STAT:statistics (-before, +after) STAT:executable size=5242696 bin/dub STAT:rough build time=61s ```
Geod24 commented 1 week ago
[INFO] Running /Users/runner/work/dub/dub/test/issue2377-dynLib-dep-extra-files.script.d...
    Starting Performing "debug" build using dmd for x86_64.
    Building dep2 ~master: building configuration [dynlib]
     Linking dep2
    Building dep1 ~master: building configuration [dynlib]
     Linking dep1
    Building parent ~master: building configuration [dynlib]
     Linking parent
    Starting Performing "debug" build using dmd for x86_64.
    Building dep2 ~master: building configuration [library]
    Building dep1 ~master: building configuration [library]
    Building parent ~master: building configuration [dynlib_static]
     Linking parent
    Starting Performing "debug" build using dmd for x86_64.
    Building dep2 ~master: building configuration [library]
    Building dep1 ~master: building configuration [library]
    Building parent ~master: building configuration [exe_static]
     Linking parent
    Starting Performing "debug" build using dmd for x86_64.
  Up-to-date dep2 ~master: target for configuration [dynlib] is up to date.
  Up-to-date dep1 ~master: target for configuration [dynlib] is up to date.
    Building parent ~master: building configuration [exe_dynamic]
     Linking parent
    Finished To force a rebuild of up-to-date targets, run again with --force
dyld[9574]: Library not loaded: '@rpath/libdep1.dylib'
  Referenced from: '/Users/runner/work/dub/dub/test/issue2377-dynLib-dep-extra-files/parent/output/exe_dynamic/parent'
  Reason: tried: '/usr/local/lib/libdep1.dylib' (no such file), '/usr/lib/libdep1.dylib' (no such file)
object.Exception@test/issue2377-dynLib-dep-extra-files.script.d(110): command 'LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH:-}" ./parent' failed
----------------
/Users/runner/hostedtoolcache/dc/dmd-2.109.0/x64/dmd2/osx/bin/../../src/phobos/std/exception.d:521 pure @safe noreturn std.exception.bailOut!(Exception).bailOut(immutable(char)[], ulong, scope const(char)[]) [0x10e4395fb]
/Users/runner/hostedtoolcache/dc/dmd-2.109.0/x64/dmd2/osx/bin/../../src/phobos/std/exception.d:442 pure @safe bool std.exception.enforce!().enforce!(bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong) [0x10e439576]
/Users/runner/work/dub/dub/test/issue2377-dynLib-dep-extra-files.script.d:110 void issue2377_dynlib_dep_extra_files.script.run(immutable(char)[]) [0x10e438de7]
/Users/runner/work/dub/dub/test/issue2377-dynLib-dep-extra-files.script.d:81 _Dmain [0x10e438ae1]
Error Program exited with code 1
[ERROR] Script failure.

@jacob-carlborg : Any chance you could take a look ? I don't have a Macbook anymore so I haven't kept on top of things. I'm mostly concerned about whether there's a bugfix needed in Dub or the test just need to be adjusted ?

jacob-carlborg commented 1 week ago

@Geod24 I can take a quick look, but I'm lazy. How do I run the tests?

Geod24 commented 1 week ago

This is what we do on POSIX: https://github.com/dlang/dub/blob/dd94e4854d5c2b640091651ea22d62844286ee6d/.github/workflows/main.yml#L100-L109

In particular, ./scripts/ci/ci.sh.

jacob-carlborg commented 1 week ago

@Geod24 I gave it a quick try, I can't easily get it to work. Probably because I have an Apple Silicon Mac. I'm not the only one with a Mac. Both @schveiguy and @thewilsonator are using Mac. At least the last time I met them. I'm sure there are others as well. Alternatively you can use this action [1] to get a shell into the runner and debug it from there.

[1] https://github.com/mxschmitt/action-tmate

Geod24 commented 1 week ago

Long story short: install_name_tool -add_rpath [@executable_path](http://twitter.com/executable_path) parent Source: https://medium.com/@donblas/fun-with-rpath-otool-and-install-name-tool-e3e41ae86172

jacob-carlborg commented 1 week ago

@Geod24 why not bump to macOS 13 while you're at it?

Geod24 commented 1 week ago

We test (and release) on the oldest available runner. My understanding is that you can run a macOS-12 binary on 13 but not the other way around unless you set the SDK version explicitly?

jacob-carlborg commented 1 week ago

My understanding is that you can run a macOS-12 binary on 13 but not the other way around unless you set the SDK version explicitly?

Yes, that's correct. I would use the latest runner (latest for x86-64) and set the minimum deployment target. Then we're in control of which platforms we want to support. Also less often the runner version needs to be bumped. Set the MACOSX_DEPLOYMENT_TARGET environment variable to the oldest version of macOS you want to support.

Geod24 commented 1 week ago

macOS-14 is out so we could probably bump to that. I'll give it a shot in the not-so-distant future - this was really just a band-aid as we were hit by macOS-11 brownout when trying to merge other MRs.

jacob-carlborg commented 6 days ago

The macOS-14 runner is ARM64 only, unless GitHub added x86-64 recently.

jacob-carlborg commented 6 days ago

we were hit by macOS-11 brownout

Yeah, I've learned the hard way that, if you can, stay on *-latest and try not to depend on anything in the runner image.