It solves: #18959
Initial discussion: #18743 (comment)
It solves: #18959
Initial discussion: #18743 (comment)
Warm welcome as a contributor @ivanacostarubio !
I have no experience in developing with Xcode, and all of the following ideas are just speculations based on Apple's docs.
If a developer's machine has already installed Xcode, it is not required to take a separate step to install command-line tools, right? Will this PR work correctly in such a case?
How does this PR change build system behavior in case of multiple versions of Xcode those are installed simultaneously?
Tested 3508ae2c0b393d863257ebc17a9ec588828d8506 on macOS Big Sur 11.2.1 (20D74):
% make -C depends print-darwin_CXX
darwin_CXX = /Library/Developer/CommandLineTools/usr/bin/clang++ -mmacosx-version-min=10.14 -stdlib=libc++ --sysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
% make -C depends print-build_darwin_CXX
build_darwin_CXX = /Library/Developer/CommandLineTools/usr/bin/clang++ --sysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
% make -C depends print-darwin_CXX
clang: error: no input files
clang: error: no input files
...
% make -C depends print-build_darwin_CXX
clang: error: no input files
clang: error: no input files
...
Hello @hebasto.
Thank you for the the review and the warm welcome. I made the necessary changes and updated the PR.
$ make -C depends print-darwin_CXX
darwin_CXX = /Library/Developer/CommandLineTools/usr/bin/clang++ -mmacosx-version-min=10.14 -stdlib=libc++ --sysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
$ make -C depends print-build_darwin_CXX
build_darwin_CXX = /Library/Developer/CommandLineTools/usr/bin/clang++ --sysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
5 | -build_darwin_STRIP:=$(shell strip) 6 | -build_darwin_OTOOL:=$(shell otool) 7 | -build_darwin_NM:=$(shell nm) 8 | -build_darwin_INSTALL_NAME_TOOL:=$(shell install_name_tool) 9 | +tools=/Library/Developer/CommandLineTools/usr/bin 10 | +sdk=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
Hardcoded paths make build scripts fragile.
Yes. I can see why this would make it fragile. This would make the build script fail when somebody install it on another path. I'll do something like:
tools=$(shell xcode-select --print-path)/usr/bin
Closing this in favor of https://github.com/bitcoin/bitcoin/pull/21341
In future, there is no need to open a new PR.
<!--9cd9c72976c961c55c7acef8f6ba82cd-->