Update to 0.13.0

This commit is contained in:
Jan200101 2024-06-11 14:03:34 +02:00
parent 932de196c3
commit 7a78a337a5
No known key found for this signature in database
GPG Key ID: 5B71B1D78B882E05
7 changed files with 98 additions and 38 deletions

View File

@ -11,55 +11,49 @@ Subject: [PATCH] Fedora: bootstrap and extra build flags support
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
---
CMakeLists.txt | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
CMakeLists.txt | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e677ee0947..1fb4821b60 100644
index 22051f1902..06df068919 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.14)
include(CheckSymbolExists)
if(NOT CMAKE_BUILD_TYPE)
@@ -910,6 +910,10 @@ else()
set(ZIG_DYNAMIC_LINKER_ARG "-Ddynamic-linker=${ZIG_TARGET_DYNAMIC_LINKER}")
@@ -922,6 +922,9 @@ if(MSVC OR MINGW)
target_link_libraries(zig2 LINK_PUBLIC version)
endif()
+# Fedora customizations
+set(ZIG_EXTRA_BUILD_ARGS "" CACHE STRING "Extra flags for stage3 build")
+set(ZIG_EXECUTABLE "$<TARGET_FILE:zig2>" CACHE STRING "Compiler command to use for stage3 build")
+
# -Dno-langref is currently hardcoded because building the langref takes too damn long
# "-Dno-langref" and "-Dstd-docs=false" are hardcoded because they take too long to build.
# To obtain these two forms of documentation, run zig build against stage3 rather than stage2.
set(ZIG_BUILD_ARGS
@@ -926,6 +930,7 @@ set(ZIG_BUILD_ARGS
"-Dcpu=${ZIG_TARGET_MCPU}"
${ZIG_DYNAMIC_LINKER_ARG}
"-Dversion-string=${RESOLVED_ZIG_VERSION}"
@@ -937,6 +940,8 @@ set(ZIG_BUILD_ARGS
-Dno-langref
-Dstd-docs=false
+
+ ${ZIG_EXTRA_BUILD_ARGS}
)
add_custom_target(stage3 ALL
@@ -934,17 +939,12 @@ add_custom_target(stage3 ALL
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
@@ -976,17 +981,12 @@ set(ZIG2_WORKING_DIR "${PROJECT_SOURCE_DIR}")
add_custom_command(
OUTPUT "${CMAKE_BINARY_DIR}/stage3/bin/zig"
- COMMAND zig2 build --prefix "${CMAKE_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS}
+ COMMAND ${ZIG_EXECUTABLE} build --prefix "${CMAKE_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS}
OUTPUT "${PROJECT_BINARY_DIR}/stage3/bin/zig"
- COMMAND zig2 build --prefix "${PROJECT_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS}
+ COMMAND ${ZIG_EXECUTABLE} build --prefix "${PROJECT_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS}
COMMENT STATUS "Building stage3"
+ DEPENDS zigcpp
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
WORKING_DIRECTORY "${ZIG2_WORKING_DIR}"
)
-if(WIN32)
- set(ZIG_EXECUTABLE "${CMAKE_BINARY_DIR}/zig2.exe")
- set(ZIG_EXECUTABLE "${PROJECT_BINARY_DIR}/zig2.exe")
-else()
- set(ZIG_EXECUTABLE "${CMAKE_BINARY_DIR}/zig2")
- set(ZIG_EXECUTABLE "${PROJECT_BINARY_DIR}/zig2")
-endif()
-
install(CODE "set(ZIG_EXECUTABLE \"${ZIG_EXECUTABLE}\")")
install(CODE "set(ZIG_BUILD_ARGS \"${ZIG_BUILD_ARGS}\")")
install(CODE "set(CMAKE_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\")")
install(CODE "set(ZIG2_WORKING_DIR \"${ZIG2_WORKING_DIR}\")")

View File

@ -9,7 +9,7 @@ Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 7af3d7bfd1..78bc2b65c8 100644
index 507cbfc6d5..d946956b05 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1230,7 +1230,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil

View File

@ -9,10 +9,10 @@ Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
1 file changed, 21 insertions(+), 12 deletions(-)
diff --git a/src/Package/Fetch.zig b/src/Package/Fetch.zig
index 506075e921..ca11f4c579 100644
index f45a5cc93e..f21409ae76 100644
--- a/src/Package/Fetch.zig
+++ b/src/Package/Fetch.zig
@@ -1248,6 +1248,7 @@ fn unpackGitPack(f: *Fetch, out_dir: fs.Dir, resource: *Resource) anyerror!Unpac
@@ -1343,6 +1343,7 @@ fn unpackGitPack(f: *Fetch, out_dir: fs.Dir, resource: *Resource) anyerror!Unpac
fn recursiveDirectoryCopy(f: *Fetch, dir: fs.Dir, tmp_dir: fs.Dir) anyerror!void {
const gpa = f.arena.child_allocator;
@ -20,7 +20,7 @@ index 506075e921..ca11f4c579 100644
// Recursive directory copy.
var it = try dir.walk(gpa);
defer it.deinit();
@@ -1255,18 +1256,26 @@ fn recursiveDirectoryCopy(f: *Fetch, dir: fs.Dir, tmp_dir: fs.Dir) anyerror!void
@@ -1350,18 +1351,26 @@ fn recursiveDirectoryCopy(f: *Fetch, dir: fs.Dir, tmp_dir: fs.Dir) anyerror!void
switch (entry.kind) {
.directory => {}, // omit empty directories
.file => {

View File

@ -0,0 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jan200101 <sentrycraft123@gmail.com>
Date: Sun, 26 May 2024 15:13:33 +0200
Subject: [PATCH] cmake: correct PIE support detection, add error output for
debugging `check_pie_supported` only uses the `OUTPUT_VARIABLE` to to signify
errors if PIE is actually supported is signaled by
`CMAKE_<lang>_LINK_PIE_SUPPORTED`.
Checking if `OUTPUT_VARIABLE` is empty is not enough either since the check
is bypassed if its results are cached but the output variable is not cached.
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
---
CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 06df068919..a1b8aa57a0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -125,8 +125,8 @@ check_pie_supported(
OUTPUT_VARIABLE ZIG_PIE_SUPPORTED_BY_CMAKE
LANGUAGES C CXX
)
-if(ZIG_PIE AND NOT ZIG_PIE_SUPPORTED_BY_CMAKE)
- message(SEND_ERROR "ZIG_PIE was requested but CMake does not support it for \"zigcpp\" target")
+if(ZIG_PIE AND NOT CMAKE_CXX_LINK_PIE_SUPPORTED)
+ message(SEND_ERROR "ZIG_PIE was requested but CMake does not support it for \"zigcpp\" target: ${ZIG_PIE_SUPPORTED_BY_CMAKE}")
endif()

View File

@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jan200101 <sentrycraft123@gmail.com>
Date: Tue, 11 Jun 2024 13:35:37 +0200
Subject: [PATCH] remove native lib directories from rpath
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
---
src/main.zig | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/main.zig b/src/main.zig
index 21f7281d74..854dfb48cc 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -3740,6 +3740,15 @@ fn createModule(
try create_module.framework_dirs.appendSlice(arena, paths.framework_dirs.items);
try create_module.lib_dirs.appendSlice(arena, paths.lib_dirs.items);
try create_module.rpath_list.appendSlice(arena, paths.rpaths.items);
+
+ for (paths.lib_dirs.items) |native_lib_dir| {
+ for (0.., create_module.rpath_list.items) |i, rpath_dir| {
+ if (std.mem.eql(u8, native_lib_dir, rpath_dir)) {
+ _ = create_module.rpath_list.orderedRemove(i);
+ break;
+ }
+ }
+ }
}
if (create_module.libc_paths_file) |paths_file| {

View File

@ -1,2 +1,2 @@
SHA512 (zig-0.12.1.tar.xz) = 6242b37420954792834f48b27b6d325e78908e51fcf4d05cd2f5c65b82209a38cf1fef2914630846d40b57cc55d64adbfd67f88e939d2e493b58bc0f1ef3520b
SHA512 (zig-0.12.1.tar.xz.minisig) = 12da0f1a92f980fa04506b97f348aaf9cb18880e1047fc41e6cff01066a3c54dc36146ac4bd1bcc3110d6ebcb3d7cd36f7b3e434e9a5953d6a274681434ff173
SHA512 (zig-0.13.0.tar.xz) = 6f5f31f4ba71a11d8b16c7a5a613e124095e503fa6b02d2b77e5b177674c739287e81d98d96dc261fed24bc836caf196f71c3fcc7a6518387df86ba9e03df4dd
SHA512 (zig-0.13.0.tar.xz.minisig) = 21c6139c06cba6c5e23a3305fed0c0f1b9b32d9140bd686c26365ce0279d5f53cd081894eaba29f0c1ed51b2e831edf7bd4ae6a7eaee5018a252e312e9b65507

View File

@ -4,11 +4,11 @@
%global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U
# note here at which Fedora or EL release we need to use compat LLVM packages
%if 0%{?fedora} >= 40 || 0%{?rhel} >= 9
%define llvm_compat 17
%if 0%{?fedora} >= 42 || 0%{?rhel} >= 9
%define llvm_compat 18
%endif
%global llvm_version 17.0.0
%global llvm_version 18.0.0
%bcond bootstrap 0
%bcond docs %{without bootstrap}
@ -16,8 +16,8 @@
%bcond test 1
Name: zig
Version: 0.12.1
Release: 1%{?dist}
Version: 0.13.0
Release: 0%{?dist}
Summary: Programming language for maintaining robust, optimal, and reusable software
License: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1
@ -33,6 +33,11 @@ Patch: 0002-Enable-build-id-by-default.patch
# Zig fetch will recurse onto the cache directory, prevent that from happening.
# https://github.com/ziglang/zig/pull/19951
Patch: 0003-fetch-prevent-global-cache-from-being-copied.patch
# Fix broken PIE capability detection
# https://github.com/ziglang/zig/pull/20072
Patch: 0004-cmake-correct-PIE-support-detection-add-error-output.patch
# Remove native libr directories from rpath
Patch: 0005-remove-native-lib-directories-from-rpath.patch
BuildRequires: gcc
BuildRequires: gcc-c++