Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 951202 - dev-lang/swift: does not respect "-j" flags
Summary: dev-lang/swift: does not respect "-j" flags
Status: UNCONFIRMED
Alias: None
Product: GURU
Classification: Unclassified
Component: Package issues (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Itai Ferber
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-12 15:38 UTC by benoit.dufour
Modified: 2025-03-13 08:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (swift-6.0.3_build_GigaByte_GA_MA770_UD3.log.xz,134.62 KB, application/x-xz)
2025-03-12 15:38 UTC, benoit.dufour
Details
emerge --info (emerge_info_gigabyte_ga_ma770_ud3.txt,8.95 KB, text/plain)
2025-03-12 15:41 UTC, benoit.dufour
Details

Note You need to log in before you can comment on or make changes to this bug.
Description benoit.dufour 2025-03-12 15:38:44 UTC
Created attachment 920618 [details]
build.log

None of the current dev-lang/swift packages (5.10.1-r# and 6.0.3) currently respect the "-j" flags, and maybe other flags too.
Those flags are set in COMMON_FLAGS in /etc/portage/make.conf.
On one one my computer, -j flag is set to -j4 instead of -j6, but -j6 is used and on another one, -j flag is set to -j8 instead of -j16, but -j16 is used.

See this for e.g.:
+ env /usr/bin/cmake --build /var/tmp/portage/dev-lang/swift-6.0.3/work/build/buildbot_linux/cmark-linux-x86_64 --config Release -- -j6 all
+ env DISTCC_HOSTS=localhost,lzo,cpp env /usr/bin/cmake -G Ninja -DCMAKE_C_COMPILER:PATH=/usr/lib64/swift-5.10.1/usr/bin/clang -DCMAKE_CXX_COMPILER:PATH=/usr/lib64/swift-5.10.1/usr/bin/clang++ -DCMAKE_Swift_COMPILER:PATH=/usr/lib64/swift-5.10.1/usr/bin/swiftc -DCMAKE_LIBTOOL:PATH=/usr/bin/libtool -DCMAKE_AR:PATH=/usr/bin/ar -DCMAKE_RANLIB:PATH=/usr/bin/ranlib -DLLVM_VERSION_MAJOR:STRING=17 -DLLVM_VERSION_MINOR:STRING=0 -DLLVM_VERSION_PATCH:STRING=0 -DCLANG_VERSION_MAJOR:STRING=17 -DCLANG_VERSION_MINOR:STRING=0 -DCLANG_VERSION_PATCH:STRING=0 -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja -DLLVM_ENABLE_ASSERTIONS:BOOL=FALSE -DLLVM_TARGETS_TO_BUILD=host -DLLVM_TOOL_COMPILER_RT_BUILD:BOOL=TRUE -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=TRUE '-DLLVM_LIT_ARGS=-v --time-tests --param color_output -j 6' -DCOVERAGE_DB= '-DCROSS_TOOLCHAIN_FLAGS_LLVM_NATIVE=-DCMAKE_C_COMPILER=clang;-DCMAKE_CXX_COMPILER=clang++;-DCLANG_DEFAULT_LINKER=gold' -DCLANG_DEFAULT_LINKER=gold -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINTERNAL_INSTALL_PREFIX=local -DCMAKE_TOOLCHAIN_FILE:PATH=/var/tmp/portage/dev-lang/swift-6.0.3/work/build/buildbot_linux/llvm-linux-x86_64/BuildScriptToolchain.cmake '-DCMAKE_C_FLAGS=-Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector' '-DCMAKE_CXX_FLAGS=-Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector' '-DCMAKE_C_FLAGS_RELWITHDEBINFO=-O2 -DNDEBUG' '-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-O2 -DNDEBUG' -DCMAKE_BUILD_TYPE:STRING=Release -DLLVM_TOOL_SWIFT_BUILD:BOOL=FALSE -DLLVM_TOOL_LLD_BUILD:BOOL=TRUE -DLLVM_INCLUDE_DOCS:BOOL=TRUE -DLLVM_ENABLE_LTO:STRING= -DCOMPILER_RT_INTERCEPT_LIBDISPATCH=ON '-DLLVM_ENABLE_PROJECTS=clang;compiler-rt;clang-tools-extra;lld' -ULLVM_ENABLE_RUNTIMES -DLLVM_USE_LINKER:STRING=lld -DBUILD_TESTING:BOOL=NO -DSWIFT_INCLUDE_TESTS:BOOL=NO -DSWIFT_INCLUDE_TEST_BINARIES:BOOL=NO -DCOMPILER_RT_BUILD_ORC:BOOL=NO -DPython3_FIND_UNVERSIONED_NAMES:STRING=FIRST -USWIFT_DARWIN_SUPPORTED_ARCHS -DSWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE:PATH=/var/tmp/portage/dev-lang/swift-6.0.3/work/swift-syntax -DSWIFT_BUILD_SWIFT_SYNTAX:BOOL=TRUE /var/tmp/portage/dev-lang/swift-6.0.3/work/llvm-project/llvm

I also attached the full build logs.
Comment 1 benoit.dufour 2025-03-12 15:41:11 UTC
Created attachment 920619 [details]
emerge --info

emerge --info of this bug report.

p.s.: In that case, the build is failing, see this bug report:
https://bugs.gentoo.org/show_bug.cgi?id=951183
Comment 2 Itai Ferber 2025-03-12 15:52:09 UTC
Yeah, Swift's build system overwrites all flags — I happen to have a fix in flight, just need to confirm things build on the LLVM profile.
Comment 3 benoit.dufour 2025-03-12 16:04:30 UTC
> Yeah, Swift's build system overwrites all flags

If it also overwrites -march, -mcpu and -mtune that might cause runtime issues on certain computers (for e.g. usage of unsupported CPU instruction sets).