From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 8D9711581EE for ; Thu, 27 Mar 2025 11:09:40 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (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) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 76B2A343268 for ; Thu, 27 Mar 2025 11:09:40 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id D083E1104B8; Thu, 27 Mar 2025 11:09:19 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 bobolink.gentoo.org (Postfix) with ESMTPS id CB7A21104B8 for ; Thu, 27 Mar 2025 11:09:19 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 smtp.gentoo.org (Postfix) with ESMTPS id 8175234321B for ; Thu, 27 Mar 2025 11:09:19 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D89AB28AA for ; Thu, 27 Mar 2025 11:09:16 +0000 (UTC) From: "David Roman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "David Roman" Message-ID: <1743018362.0cf9b38183d6704a78598d06b3eb6ffac99539bb.davidroman@gentoo> Subject: [gentoo-commits] repo/proj/guru:master commit in: dev-lang/swift/ X-VCS-Repository: repo/proj/guru X-VCS-Files: dev-lang/swift/swift-5.10.1-r4.ebuild dev-lang/swift/swift-6.0.3-r1.ebuild X-VCS-Directories: dev-lang/swift/ X-VCS-Committer: davidroman X-VCS-Committer-Name: David Roman X-VCS-Revision: 0cf9b38183d6704a78598d06b3eb6ffac99539bb X-VCS-Branch: master Date: Thu, 27 Mar 2025 11:09:16 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 70510099-d64a-4114-8e50-affcb04a098d X-Archives-Hash: 8390c97ac5e84364a6c95728864c15aa commit: 0cf9b38183d6704a78598d06b3eb6ffac99539bb Author: Itai Ferber itaiferber net> AuthorDate: Wed Mar 26 17:10:40 2025 +0000 Commit: David Roman gmail com> CommitDate: Wed Mar 26 19:46:02 2025 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=0cf9b381 dev-lang/swift: respect MAKEOPTS -j The Swift build system takes a '-j'/'--jobs' flag, but the value from MAKEOPTS needs to be manually exposed to it for it to be respected. Closes: https://bugs.gentoo.org/951202 Signed-off-by: Itai Ferber itaiferber.net> dev-lang/swift/swift-5.10.1-r4.ebuild | 23 +++++++++++++++++++++++ dev-lang/swift/swift-6.0.3-r1.ebuild | 19 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/dev-lang/swift/swift-5.10.1-r4.ebuild b/dev-lang/swift/swift-5.10.1-r4.ebuild index 560efa3cf..9884caaf1 100644 --- a/dev-lang/swift/swift-5.10.1-r4.ebuild +++ b/dev-lang/swift/swift-5.10.1-r4.ebuild @@ -202,6 +202,26 @@ src_compile() { # contents are irrelevant. addpredict /var/lib/portage/home/.swiftpm + # Setting `-j`/`--jobs=` in MAKEOPTS needs to be manually exposed to + # the Swift build system. + local jobs_flag + if [[ -n "${MAKEOPTS}" ]]; then + local num_jobs make_opts=( $(getopt -qu -o 'j:' -l 'jobs:' -- ${MAKEOPTS}) ) + while [[ "${#make_opts[@]}" -gt 1 ]]; do + case "${make_opts[0]}" in + -j | --jobs ) + num_jobs="${make_opts[1]}" + make_opts=("${make_opts[@]:2}") ;; + -- ) break ;; + * ) make_opts=("${make_opts[@]:1}") ;; + esac + done + + if [[ -n "${num_jobs}" ]]; then + jobs_flag="--jobs=${num_jobs}" + fi + fi + local _extra_cmake_options=( # BFD doesn't link Swift symbols properly, so we have to ensure Swift is # built with LLD. @@ -243,6 +263,7 @@ src_compile() { --no-assertions \ --build-subdir="Ninja-Release" \ --install-destdir="${S}/stage0" \ + "${jobs_flag}" \ --extra-cmake-options="${extra_cmake_options}" \ --bootstrapping=off \ --llvm-install-components='llvm-ar;llvm-cov;llvm-profdata;IndexStore;clang;clang-resource-headers;compiler-rt;clangd;lld;LTO;clang-features-file' \ @@ -267,6 +288,7 @@ src_compile() { --no-assertions \ --build-subdir="Ninja-Release" \ --install-destdir="${S}/stage1" \ + "${jobs_flag}" \ --extra-cmake-options="${extra_cmake_options}" \ --cmark --skip-test-cmark \ --foundation --skip-test-foundation \ @@ -290,6 +312,7 @@ src_compile() { --no-assertions \ --build-subdir="Ninja-Release" \ --install-destdir="${S}/stage2" \ + "${jobs_flag}" \ --extra-cmake-options="${extra_cmake_options}" \ --foundation --skip-test-foundation \ --indexstore-db --skip-test-indexstore-db \ diff --git a/dev-lang/swift/swift-6.0.3-r1.ebuild b/dev-lang/swift/swift-6.0.3-r1.ebuild index 09b9b0d65..bfbea3442 100644 --- a/dev-lang/swift/swift-6.0.3-r1.ebuild +++ b/dev-lang/swift/swift-6.0.3-r1.ebuild @@ -182,6 +182,25 @@ src_configure() { cp "${FILESDIR}/${PF}/gentoo.ini" "${SWIFT_BUILD_PRESETS_INI_PATH}" local extra_build_flags=() + # Setting `-j`/`--jobs=` in MAKEOPTS needs to be manually exposed to + # the Swift build system. + if [[ -n "${MAKEOPTS}" ]]; then + local num_jobs make_opts=( $(getopt -qu -o 'j:' -l 'jobs:' -- ${MAKEOPTS}) ) + while [[ "${#make_opts[@]}" -gt 1 ]]; do + case "${make_opts[0]}" in + -j | --jobs ) + num_jobs="${make_opts[1]}" + make_opts=("${make_opts[@]:2}") ;; + -- ) break ;; + * ) make_opts=("${make_opts[@]:1}") ;; + esac + done + + if [[ -n "${num_jobs}" ]]; then + extra_build_flags+=(--jobs="${num_jobs}") + fi + fi + if [[ "$(tc-get-cxx-stdlib)" = 'libc++' ]]; then # On systems which use libc++ as their default C++ stdlib (e.g. systems # with the LLVM profile), we want to build the internal libc++ and