Opened 4 years ago

Last modified 4 years ago

#61371 reopened defect

git @2.29.0 doesn't use configure.sdkroot when building

Reported by: mouse07410 (Mouse) Owned by: ci42
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: git

Description

MacOS 10.15.7, Xcode-12.1.

$ sudo port selfupdate
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.6.3 installed,
MacPorts base version 2.6.3 downloaded.
--->  Updating the ports tree
--->  MacPorts base is already the latest version

The ports tree has been updated. To upgrade your installed ports, you should run
  port upgrade outdated
$ sudo port upgrade outdated
--->  Computing dependencies for git
--->  Fetching archive for git
--->  Attempting to fetch git-2.29.0_0+credential_osxkeychain+diff_highlight+doc+pcre+perl5_26+svn.darwin_19.x86_64.tbz2 from https://packages.macports.org/git
--->  Attempting to fetch git-2.29.0_0+credential_osxkeychain+diff_highlight+doc+pcre+perl5_26+svn.darwin_19.x86_64.tbz2 from https://cph.dk.packages.macports.org/git
--->  Attempting to fetch git-2.29.0_0+credential_osxkeychain+diff_highlight+doc+pcre+perl5_26+svn.darwin_19.x86_64.tbz2 from http://fco.it.packages.macports.org/git
--->  Fetching distfiles for git
--->  Verifying checksums for git
--->  Extracting git
--->  Applying patches to git
--->  Configuring git
--->  Building git
Error: Failed to build git: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git/git/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
$ cat /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git/git/main.log
version:1
:debug:sysinfo macOS 10.15 (darwin/19.6.0) arch i386
:debug:sysinfo MacPorts 2.6.3
:debug:sysinfo Xcode 12.1
:debug:sysinfo SDK 10.15
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 10.15
.  .  .  .  .
:info:build /usr/bin/clang -o gpg-interface.o -c -MF ./.depend/gpg-interface.o.d -MQ gpg-interface.o -MMD -MP    -I. -Wall -O2 -I/opt/local/include -arch x86_64 -I. -DPRECOMPOSE_UNICODE -DPROTECT_HFS_DEFAULT=1 -DGIT_HOST_CPU="\"x86_64\"" -DUSE_LIBPCRE2 -I/opt/local/include -I/opt/local/include -DUSE_CURL_FOR_IMAP_SEND -DNO_OPENSSL -I/opt/local/include -DUSE_ST_TIMESPEC -DSHA1_APPLE -DSHA256_BLK -DSHA1_MAX_BLOCK_SIZE="1024L*1024L*1024L"  -DHAVE_DEV_TTY -DHAVE_BSD_SYSCTL -DHAVE_GETDELIM -DHAVE_NS_GET_EXECUTABLE_PATH  -DAPPLE_COMMON_CRYPTO -DFREAD_READS_DIRECTORIES -DCOMMON_DIGEST_FOR_OPENSSL -DNO_MEMMEM -Icompat/regex -DSHELL_PATH='"/bin/sh"' -DPAGER_ENV='"LESS=FRX LV=-c"'  gpg-interface.c
.  .  .  .  .
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git/git/work/git-2.29.0/templates'
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git/git/work/git-2.29.0'
:debug:build Executing proc-post-org.macports.build-build-0
:debug:build system -W /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git/git/work/git-2.29.0/contrib/credential/osxkeychain: make CFLAGS="-I. -Wall -O2 -I/opt/local/include -arch x86_64" LDFLAGS="-L/opt/local/lib -arch x86_64" CC=/usr/bin/clang prefix=/opt/local CURLDIR=/opt/local OPENSSLDIR=/opt/local ICONVDIR=/opt/local PERL_PATH="/opt/local/bin/perl5.26" PYTHON_PATH="/opt/local/bin/python3.8" NO_FINK=1 NO_DARWIN_PORTS=1 NO_R_TO_GCC_LINKER=1 NO_PERL_CPAN_FALLBACK=1 V=1 LIBPCREDIR=/opt/local USE_LIBPCRE2=1
:info:build /usr/bin/clang -c -I. -Wall -O2 -I/opt/local/include -arch x86_64 git-credential-osxkeychain.c
:info:build clang: error: unable to locate a suitable SDK for the system
:info:build clang: error: SDK "macosx" cannot be located
:info:build git-credential-osxkeychain.c:1:10: fatal error: 'stdio.h' file not found
:info:build #include <stdio.h>
:info:build          ^~~~~~~~~
:info:build 1 error generated.
:info:build make: *** [git-credential-osxkeychain.o] Error 1
:info:build Command failed: make CFLAGS="-I. -Wall -O2 -I/opt/local/include -arch x86_64" LDFLAGS="-L/opt/local/lib -arch x86_64" CC=/usr/bin/clang prefix=/opt/local CURLDIR=/opt/local OPENSSLDIR=/opt/local ICONVDIR=/opt/local PERL_PATH="/opt/local/bin/perl5.26" PYTHON_PATH="/opt/local/bin/python3.8" NO_FINK=1 NO_DARWIN_PORTS=1 NO_R_TO_GCC_LINKER=1 NO_PERL_CPAN_FALLBACK=1 V=1 LIBPCREDIR=/opt/local USE_LIBPCRE2=1
:info:build Exit code: 2
:error:build Failed to build git: command execution failed
:debug:build Error code: NONE

Change History (4)

comment:1 Changed 4 years ago by jmroot (Joshua Root)

Cc: ci42 removed
Owner: set to ci42
Status: newassigned

Worked for me:

% port -v installed git
The following ports are currently installed:
  git @2.29.0_0+credential_osxkeychain+diff_highlight+doc+pcre+perl5_26 (active) platform='darwin 19' archs='x86_64' date='2020-10-24T17:45:36+1100'

Without the full log, it's not clear whether an -isysroot flag is not being specified or if it's being specified and lost.

comment:2 Changed 4 years ago by mouse07410 (Mouse)

Worked for me...

I suspect that it failed in my case because Command Line Tools were not installed, only Xcode (which contains all the necessary tools and SDKs).

After I installed CLT, sudo port upgrade git succeeded.

IMHO, though, it is unfortunate that Macports seems to insist on presence of CLT when Xcode is installed.

Without the full log, it's not clear whether an -isysroot flag is not being specified or if it's being specified and lost.

My apologies. I did not see -isysroot anywhere in the log file, but of course it's possible that I missed it. Next time I'll include the full log.

comment:3 Changed 4 years ago by kencu (Ken)

Resolution: worksforme
Status: assignedclosed

comment:4 in reply to:  2 Changed 4 years ago by jmroot (Joshua Root)

Resolution: worksforme
Status: closedreopened
Summary: git +credential_osxkeychain fails to compilegit @2.29.0 doesn't use configure.sdkroot when building

Replying to mouse07410:

After I installed CLT, sudo port upgrade git succeeded.

IMHO, though, it is unfortunate that Macports seems to insist on presence of CLT when Xcode is installed.

It doesn't. It is a very good idea to have the CLTs installed though, mainly because newer Xcode versions only ship an SDK for the latest OS, not necessarily the version that you're running.

Whether the CLTs are installed or not, configure.sdkroot will be set to an appropriate value, which is normally added to all the *FLAGS environment variables. It appears that git is not using this setting, which is problematic for both this reason and others.

Note: See TracTickets for help on using tickets.