From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5A69C158042 for ; Fri, 25 Oct 2024 21:25:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4D634E0949; Fri, 25 Oct 2024 21:24:56 +0000 (UTC) Received: from mail.landless-city.net (mail.landless-city.net [95.164.19.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C0312E08C0 for ; Fri, 25 Oct 2024 21:24:55 +0000 (UTC) Received: from mail.landless-city.net (unknown [37.99.36.156]) by mail.landless-city.net (Postfix) with ESMTPSA id C86437E883; Sat, 26 Oct 2024 02:24:52 +0500 (+05) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=landless-city.net; s=2024031301_rsa; t=1729891492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9aedZA94a7UG6r2nIURffbKPAcOH8R8grzxeLmqXpZE=; b=Q848xPtZyvIvn03c94dsCl0Q+rlN9MFMDXs+xSTtM6vovZITc5MLu5jcKZ2dHCxi/nJjtP lmi1VbkuPGdyP2k9PrKW0gy2UYWvh6lss6lZvZiBm83sW3hJdBR1blmpaHND1AjstXFYvJ BZBJOJySMK/6bxaiN0LpVqDy9uEQ8klNBDw+v0scqXabC2PZ0upYuRqwWBbuR3N8fvAvCC LkaXpLPkxm4rbqxN2943k9f/Ccpxis/XvojSkIsNR3+go0CycPs25RBIwCLql4on+nebdG zOHQhDSLWw6CEPxCo6304jlEBXAZn+R40a/xpduxQi9xbs2RmS9H+ikrF66DPw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=landless-city.net; s=2024031301_ed25519; t=1729891492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9aedZA94a7UG6r2nIURffbKPAcOH8R8grzxeLmqXpZE=; b=nIpTO7176F/NHkgyHqzxEYh8E9bgXasi4Dx9yci5EP/IMghe07Fh203iFTvg0F+EwSkr/2 3WEeswV/Qn+d4nAg== From: Eric Joldasov To: gentoo-dev@lists.gentoo.org Cc: Eric Joldasov Subject: [gentoo-dev] [PATCH 3/5] dev-lang/zig: add 0.13.0-r1 Date: Sat, 26 Oct 2024 02:20:13 +0500 Message-ID: <20241025212431.3460-4-bratishkaerik@landless-city.net> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241025212431.3460-1-bratishkaerik@landless-city.net> References: <20241024014626.31175-1-bratishkaerik@landless-city.net> <20241025212431.3460-1-bratishkaerik@landless-city.net> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 06e98430-cd49-4ae5-b3fb-9221ed520268 X-Archives-Hash: a5149b927ae5b24d883c8a731afb4ede From: Eric Joldasov * Update to use llvm-r1 eclass instead of llvm, zig-build and zig-toolchain functions instead of local get_zig_mcpu etc. functions. * Port "llvm USE-flag" and "removing memory limit flags" from 9999 ebuild. * Stage3 compilation is unified by combining build.zig options, now both cmake (+llvm) and bootstrap.c (-llvm) build up to "zig2" target, after that we use zig-build.eclass with common options. * Before migrating to the zig-build.eclass, test steps in src_test have been ran sequentially in for-loop, which allowed logic inside each step to ran parallelly but not several steps at a time. Now we use upstream "test" step instead of separately calling all dependant steps, so that build system can now ran all of them paralelly. This means time spent in src_test is now significantly shorter. * "zig2" in both scenarios now has explicit target which is set by using zig-toolchain functions on a CBUILD/CHOST. This allows us to skip convertion logic in CMake and bootstrap.c, so that instead of patching them we can just update converter in zig-toolchain.eclass and unify target behaviour. * Disable autodocs generation for "std" module, since it can now be generated on-fly with "zig std" command. Signed-off-by: Eric Joldasov --- .../zig-0.13.0-skip-test-stack_iterator.patch | 32 +++ dev-lang/zig/zig-0.13.0-r1.ebuild | 245 ++++++++++++++++++ 2 files changed, 277 insertions(+) create mode 100644 dev-lang/zig/files/zig-0.13.0-skip-test-stack_iterator.patch create mode 100644 dev-lang/zig/zig-0.13.0-r1.ebuild diff --git a/dev-lang/zig/files/zig-0.13.0-skip-test-stack_iterator.patch b/dev-lang/zig/files/zig-0.13.0-skip-test-stack_iterator.patch new file mode 100644 index 000000000000..e088af2102ed --- /dev/null +++ b/dev-lang/zig/files/zig-0.13.0-skip-test-stack_iterator.patch @@ -0,0 +1,32 @@ +From: Eric Joldasov + +Skip standalone test "stack_iterator" that fail on Gentoo Linux x86_64. +Fails in ReleaseSafe, ReleaseFast and ReleaseSmall, but not in Debug. +Reported to upstream here https://github.com/ziglang/zig/issues/19944 . + +Signed-off-by: Eric Joldasov + +diff --git a/test/standalone/stack_iterator/shared_lib_unwind.zig b/test/standalone/stack_iterator/shared_lib_unwind.zig +index 57513a49c6..75fddb04c9 100644 +--- a/test/standalone/stack_iterator/shared_lib_unwind.zig ++++ b/test/standalone/stack_iterator/shared_lib_unwind.zig +@@ -35,6 +35,7 @@ extern fn frame0( + ) void; + + pub fn main() !void { ++ if (true) return; + // Disabled until the DWARF unwinder bugs on .aarch64 are solved + if (builtin.omit_frame_pointer and comptime builtin.target.isDarwin() and builtin.cpu.arch == .aarch64) return; + +diff --git a/test/standalone/stack_iterator/unwind.zig b/test/standalone/stack_iterator/unwind.zig +index 69c463a0c1..40963af63d 100644 +--- a/test/standalone/stack_iterator/unwind.zig ++++ b/test/standalone/stack_iterator/unwind.zig +@@ -87,6 +87,7 @@ noinline fn frame0(expected: *[4]usize, unwound: *[4]usize) void { + } + + pub fn main() !void { ++ if (true) return; + // Disabled until the DWARF unwinder bugs on .aarch64 are solved + if (builtin.omit_frame_pointer and comptime builtin.target.isDarwin() and builtin.cpu.arch == .aarch64) return; + diff --git a/dev-lang/zig/zig-0.13.0-r1.ebuild b/dev-lang/zig/zig-0.13.0-r1.ebuild new file mode 100644 index 000000000000..5cca5e3efad6 --- /dev/null +++ b/dev-lang/zig/zig-0.13.0-r1.ebuild @@ -0,0 +1,245 @@ +# Copyright 2019-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LLVM_COMPAT=( 18 ) +LLVM_OPTIONAL=1 + +ZIG_SLOT="$(ver_cut 1-2)" +ZIG_OPTIONAL=1 + +inherit check-reqs cmake flag-o-matic edo llvm-r1 toolchain-funcs zig-build + +DESCRIPTION="A robust, optimal, and maintainable programming language" +HOMEPAGE="https://ziglang.org/ https://github.com/ziglang/zig/" +if [[ ${PV} == 9999 ]]; then + EGIT_REPO_URI="https://github.com/ziglang/zig.git" + inherit git-r3 +else + VERIFY_SIG_METHOD=minisig + VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/minisig-keys/zig-software-foundation.pub + inherit verify-sig + + SRC_URI=" + https://ziglang.org/download/${PV}/${P}.tar.xz + verify-sig? ( https://ziglang.org/download/${PV}/${P}.tar.xz.minisig ) + " + KEYWORDS="~amd64 ~arm ~arm64" + + BDEPEND="verify-sig? ( sec-keys/minisig-keys-zig-software-foundation )" +fi + +# project itself: MIT +# There are bunch of projects under "lib/" folder that are needed for cross-compilation. +# Files that are unnecessary for cross-compilation are removed by upstream +# and therefore their licenses (if any special) are not included. +# lib/libunwind: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT ) +# lib/libcxxabi: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT ) +# lib/libcxx: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT ) +# lib/libc/wasi: || ( Apache-2.0-with-LLVM-exceptions Apache-2.0 MIT BSD-2 ) public-domain +# lib/libc/musl: MIT BSD-2 +# lib/libc/mingw: ZPL public-domain BSD-2 ISC HPND +# lib/libc/glibc: BSD HPND ISC inner-net LGPL-2.1+ +LICENSE="MIT Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT ) || ( Apache-2.0-with-LLVM-exceptions Apache-2.0 MIT BSD-2 ) public-domain BSD-2 ZPL ISC HPND BSD inner-net LGPL-2.1+" +SLOT="${ZIG_SLOT}" +IUSE="doc +llvm test" +RESTRICT="!test? ( test )" +REQUIRED_USE=" + !llvm? ( !doc ) + llvm? ( ${LLVM_REQUIRED_USE} ) +" + +# Used by both cmake and zig-build eclass. +BUILD_DIR="${WORKDIR}/${P}_build" + +# Zig requires zstd and zlib compression support in LLVM, if using LLVM backend. +# (non-LLVM backends don't require these) +# They are not required "on their own", so please don't add them here. +# You can check https://github.com/ziglang/zig-bootstrap in future, to see +# options that are passed to LLVM CMake building (excluding "static" ofc). +DEPEND=" + llvm? ( + $(llvm_gen_dep ' + sys-devel/clang:${LLVM_SLOT} + sys-devel/lld:${LLVM_SLOT} + sys-devel/llvm:${LLVM_SLOT}[zstd] + ') + ) +" +BDEPEND+=" + test? ( !!