| author | |
| committer | |
| log | 26825e95066c104585d248787c0e56ce4e8413e0 |
| tree | ca505fa2a5cc4a4eff3b66b8e35977bb12940ec9 |
| parent | f58200e3f2967a06f343c9fc9dcae9de18def92a |
| parent | 16c18b835e16bae7a0f85caa29457f4ae4b7b417 |
| signature |
Some changes to prepare for FreeBSD CI10 files changed, 165 insertions(+), 6 deletions(-)
ci/x86_64-freebsd-debug.sh created+71| ... | ... | @@ -0,0 +1,71 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | # Requires cmake ninja-build | |
| 4 | ||
| 5 | set -x | |
| 6 | set -e | |
| 7 | ||
| 8 | ARCH="x86_64" | |
| 9 | TARGET="$ARCH-freebsd-none" | |
| 10 | MCPU="baseline" | |
| 11 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.312+164c598cd" | |
| 12 | PREFIX="$HOME/deps/$CACHE_BASENAME" | |
| 13 | ZIG="$PREFIX/bin/zig" | |
| 14 | ||
| 15 | # Make the `zig version` number consistent. | |
| 16 | # This will affect the cmake command below. | |
| 17 | git fetch --unshallow || true | |
| 18 | git fetch --tags | |
| 19 | ||
| 20 | # Override the cache directories because they won't actually help other CI runs | |
| 21 | # which will be testing alternate versions of zig, and ultimately would just | |
| 22 | # fill up space on the hard drive for no reason. | |
| 23 | export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" | |
| 24 | export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" | |
| 25 | ||
| 26 | mkdir build-debug | |
| 27 | cd build-debug | |
| 28 | ||
| 29 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" | |
| 30 | export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" | |
| 31 | ||
| 32 | cmake .. \ | |
| 33 | -DCMAKE_INSTALL_PREFIX="stage3-debug" \ | |
| 34 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | |
| 35 | -DCMAKE_BUILD_TYPE=Debug \ | |
| 36 | -DZIG_TARGET_TRIPLE="$TARGET" \ | |
| 37 | -DZIG_TARGET_MCPU="$MCPU" \ | |
| 38 | -DZIG_STATIC=ON \ | |
| 39 | -DZIG_NO_LIB=ON \ | |
| 40 | -GNinja \ | |
| 41 | -DCMAKE_C_LINKER_DEPFILE_SUPPORTED=FALSE \ | |
| 42 | -DCMAKE_CXX_LINKER_DEPFILE_SUPPORTED=FALSE | |
| 43 | # https://github.com/ziglang/zig/issues/22213 | |
| 44 | ||
| 45 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | |
| 46 | # so that installation and testing do not get affected by them. | |
| 47 | unset CC | |
| 48 | unset CXX | |
| 49 | ||
| 50 | ninja install | |
| 51 | ||
| 52 | stage3-debug/bin/zig build test docs \ | |
| 53 | --maxrss 32212254720 \ | |
| 54 | -Dstatic-llvm \ | |
| 55 | -Dskip-linux \ | |
| 56 | -Dskip-netbsd \ | |
| 57 | -Dskip-windows \ | |
| 58 | -Dskip-macos \ | |
| 59 | -Dtarget=native-native-none \ | |
| 60 | --search-prefix "$PREFIX" \ | |
| 61 | --zig-lib-dir "$PWD/../lib" | |
| 62 | ||
| 63 | stage3-debug/bin/zig build \ | |
| 64 | --prefix stage4-debug \ | |
| 65 | -Denable-llvm \ | |
| 66 | -Dno-lib \ | |
| 67 | -Dtarget=$TARGET \ | |
| 68 | -Duse-zig-libcxx \ | |
| 69 | -Dversion-string="$(stage3-debug/bin/zig version)" | |
| 70 | ||
| 71 | stage4-debug/bin/zig test ../test/behavior.zig |
ci/x86_64-freebsd-release.sh created+77| ... | ... | @@ -0,0 +1,77 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | # Requires cmake ninja-build | |
| 4 | ||
| 5 | set -x | |
| 6 | set -e | |
| 7 | ||
| 8 | ARCH="x86_64" | |
| 9 | TARGET="$ARCH-freebsd-none" | |
| 10 | MCPU="baseline" | |
| 11 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.312+164c598cd" | |
| 12 | PREFIX="$HOME/deps/$CACHE_BASENAME" | |
| 13 | ZIG="$PREFIX/bin/zig" | |
| 14 | ||
| 15 | # Make the `zig version` number consistent. | |
| 16 | # This will affect the cmake command below. | |
| 17 | git fetch --unshallow || true | |
| 18 | git fetch --tags | |
| 19 | ||
| 20 | # Override the cache directories because they won't actually help other CI runs | |
| 21 | # which will be testing alternate versions of zig, and ultimately would just | |
| 22 | # fill up space on the hard drive for no reason. | |
| 23 | export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" | |
| 24 | export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" | |
| 25 | ||
| 26 | mkdir build-release | |
| 27 | cd build-release | |
| 28 | ||
| 29 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" | |
| 30 | export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" | |
| 31 | ||
| 32 | cmake .. \ | |
| 33 | -DCMAKE_INSTALL_PREFIX="stage3-release" \ | |
| 34 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | |
| 35 | -DCMAKE_BUILD_TYPE=Release \ | |
| 36 | -DZIG_TARGET_TRIPLE="$TARGET" \ | |
| 37 | -DZIG_TARGET_MCPU="$MCPU" \ | |
| 38 | -DZIG_STATIC=ON \ | |
| 39 | -DZIG_NO_LIB=ON \ | |
| 40 | -GNinja \ | |
| 41 | -DCMAKE_C_LINKER_DEPFILE_SUPPORTED=FALSE \ | |
| 42 | -DCMAKE_CXX_LINKER_DEPFILE_SUPPORTED=FALSE | |
| 43 | # https://github.com/ziglang/zig/issues/22213 | |
| 44 | ||
| 45 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | |
| 46 | # so that installation and testing do not get affected by them. | |
| 47 | unset CC | |
| 48 | unset CXX | |
| 49 | ||
| 50 | ninja install | |
| 51 | ||
| 52 | stage3-release/bin/zig build test docs \ | |
| 53 | --maxrss 32212254720 \ | |
| 54 | -Dstatic-llvm \ | |
| 55 | -Dskip-linux \ | |
| 56 | -Dskip-netbsd \ | |
| 57 | -Dskip-windows \ | |
| 58 | -Dskip-macos \ | |
| 59 | -Dtarget=native-native-none \ | |
| 60 | --search-prefix "$PREFIX" \ | |
| 61 | --zig-lib-dir "$PWD/../lib" | |
| 62 | ||
| 63 | # Ensure that stage3 and stage4 are byte-for-byte identical. | |
| 64 | stage3-release/bin/zig build \ | |
| 65 | --prefix stage4-release \ | |
| 66 | -Denable-llvm \ | |
| 67 | -Dno-lib \ | |
| 68 | -Doptimize=ReleaseFast \ | |
| 69 | -Dstrip \ | |
| 70 | -Dtarget=$TARGET \ | |
| 71 | -Duse-zig-libcxx \ | |
| 72 | -Dversion-string="$(stage3-release/bin/zig version)" | |
| 73 | ||
| 74 | # diff returns an error code if the files differ. | |
| 75 | echo "If the following command fails, it means nondeterminism has been" | |
| 76 | echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." | |
| 77 | diff stage3-release/bin/zig stage4-release/bin/zig |
ci/x86_64-linux-release.sh+1| ... | ... | @@ -65,6 +65,7 @@ stage3-release/bin/zig build test docs \ |
| 65 | 65 | -fqemu \ |
| 66 | 66 | -fwasmtime \ |
| 67 | 67 | -Dstatic-llvm \ |
| 68 | -Dskip-freebsd \ | |
| 68 | 69 | -Dtarget=native-native-musl \ |
| 69 | 70 | --search-prefix "$PREFIX" \ |
| 70 | 71 | --zig-lib-dir "$PWD/../lib" \ |
lib/std/posix/test.zig-1| ... | ... | @@ -644,7 +644,6 @@ test "sigrtmin/max" { |
| 644 | 644 | try std.testing.expect(posix.sigrtmin() >= 32); |
| 645 | 645 | try std.testing.expect(posix.sigrtmin() >= posix.system.sigrtmin()); |
| 646 | 646 | try std.testing.expect(posix.sigrtmin() < posix.system.sigrtmax()); |
| 647 | try std.testing.expect(posix.sigrtmax() < posix.NSIG); | |
| 648 | 647 | } |
| 649 | 648 | |
| 650 | 649 | test "sigset empty/full" { |
src/target.zig+1-1| ... | ... | @@ -245,7 +245,7 @@ pub fn hasNewLinkerSupport(ofmt: std.Target.ObjectFormat) bool { |
| 245 | 245 | pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool { |
| 246 | 246 | if (target.cpu.arch.isSpirV()) return true; |
| 247 | 247 | if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) { |
| 248 | if (target.os.tag == .netbsd or target.os.tag == .openbsd) { | |
| 248 | if (target.os.tag.isBSD()) { | |
| 249 | 249 | // Self-hosted linker needs work: https://github.com/ziglang/zig/issues/24341 |
| 250 | 250 | return false; |
| 251 | 251 | } |
test/link/elf.zig+4| ... | ... | @@ -2,6 +2,9 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step { |
| 2 | 2 | _ = build_opts; |
| 3 | 3 | const elf_step = b.step("test-elf", "Run ELF tests"); |
| 4 | 4 | |
| 5 | // https://github.com/ziglang/zig/issues/25323 | |
| 6 | if (builtin.os.tag == .freebsd) return elf_step; | |
| 7 | ||
| 5 | 8 | const default_target = b.resolveTargetQuery(.{ |
| 6 | 9 | .cpu_arch = .x86_64, // TODO relax this once ELF linker is able to handle other archs |
| 7 | 10 | .os_tag = .linux, |
| ... | ... | @@ -4285,6 +4288,7 @@ const addStaticLibrary = link.addStaticLibrary; |
| 4285 | 4288 | const expectLinkErrors = link.expectLinkErrors; |
| 4286 | 4289 | const link = @import("link.zig"); |
| 4287 | 4290 | const std = @import("std"); |
| 4291 | const builtin = @import("builtin"); | |
| 4288 | 4292 | |
| 4289 | 4293 | const Build = std.Build; |
| 4290 | 4294 | const BuildOptions = link.BuildOptions; |
test/src/StackTrace.zig+1-1| ... | ... | @@ -45,7 +45,7 @@ fn addCaseInner(self: *StackTrace, config: Config, use_llvm: bool) void { |
| 45 | 45 | fn shouldTestNonLlvm(target: *const std.Target) bool { |
| 46 | 46 | return switch (target.cpu.arch) { |
| 47 | 47 | .x86_64 => switch (target.ofmt) { |
| 48 | .elf => true, | |
| 48 | .elf => !target.os.tag.isBSD(), | |
| 49 | 49 | else => false, |
| 50 | 50 | }, |
| 51 | 51 | else => false, |
test/stack_traces.zig+2| ... | ... | @@ -803,6 +803,7 @@ pub fn addCases(cases: *tests.StackTracesContext) void { |
| 803 | 803 | .s390x, |
| 804 | 804 | }, |
| 805 | 805 | .exclude_os = &.{ |
| 806 | .freebsd, | |
| 806 | 807 | .openbsd, // integer overflow |
| 807 | 808 | .windows, // TODO intermittent failures |
| 808 | 809 | }, |
| ... | ... | @@ -847,6 +848,7 @@ pub fn addCases(cases: *tests.StackTracesContext) void { |
| 847 | 848 | }, |
| 848 | 849 | .ReleaseSafe = .{ |
| 849 | 850 | .exclude_os = &.{ |
| 851 | .freebsd, | |
| 850 | 852 | .windows, // TODO |
| 851 | 853 | .linux, // defeated by aggressive inlining |
| 852 | 854 | .macos, // Broken in LLVM 20. |
test/standalone/stack_iterator/build.zig+6-2| ... | ... | @@ -61,8 +61,12 @@ pub fn build(b: *std.Build) void { |
| 61 | 61 | .use_llvm = true, |
| 62 | 62 | }); |
| 63 | 63 | |
| 64 | const run_cmd = b.addRunArtifact(exe); | |
| 65 | test_step.dependOn(&run_cmd.step); | |
| 64 | if (builtin.os.tag != .freebsd) { | |
| 65 | const run_cmd = b.addRunArtifact(exe); | |
| 66 | test_step.dependOn(&run_cmd.step); | |
| 67 | } else { | |
| 68 | test_step.dependOn(&exe.step); | |
| 69 | } | |
| 66 | 70 | } |
| 67 | 71 | |
| 68 | 72 | // https://github.com/ziglang/zig/issues/24522 |
test/tests.zig+2-1| ... | ... | @@ -2451,8 +2451,9 @@ pub fn wouldUseLlvm(use_llvm: ?bool, query: std.Target.Query, optimize_mode: Opt |
| 2451 | 2451 | else => return true, |
| 2452 | 2452 | } |
| 2453 | 2453 | const cpu_arch = query.cpu_arch orelse builtin.cpu.arch; |
| 2454 | const os_tag = query.os_tag orelse builtin.os.tag; | |
| 2454 | 2455 | switch (cpu_arch) { |
| 2455 | .x86_64 => if (std.Target.ptrBitWidth_arch_abi(cpu_arch, query.abi orelse .none) != 64) return true, | |
| 2456 | .x86_64 => if (os_tag.isBSD() or std.Target.ptrBitWidth_arch_abi(cpu_arch, query.abi orelse .none) != 64) return true, | |
| 2456 | 2457 | .spirv32, .spirv64 => return false, |
| 2457 | 2458 | else => return true, |
| 2458 | 2459 | } |