Opened 4 years ago

Closed 4 years ago

#54797 closed defect (fixed)

go-1.4: clang: error: no such file or directory

Reported by: conradwt (Conrad Taylor) Owned by: ci42
Priority: Normal Milestone:
Component: ports Version: 2.4.99
Keywords: highsierra Cc: mndavidoff (Monte Davidoff), skymoo (Adam Mercer), sbutler (Stephen J. Butler)
Port: go go-1.4

Description (last modified by mf2k (Frank Schima))

When I attempt to install the go port, the following dependency fails to build because it appears that macOS High Sierra has changed the location of the Clang runtime:

clang: error: no such file or directory: '/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin17.0.0/libclang_rt.builtins-x86_64.a'

Furthermore, I wasn't able to locate libclang_rt.builtins-x86_64.a within the following path for Xcode 9 Beta on macOS High Sierra:

/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin

Attachments (2)

main.log (22.7 KB) - added by conradwt (Conrad Taylor) 4 years ago.
main.log
main.log-sierra.gz (2.7 KB) - added by mndavidoff (Monte Davidoff) 4 years ago.

Download all attachments as: .zip

Change History (13)

Changed 4 years ago by conradwt (Conrad Taylor)

Attachment: main.log added

main.log

comment:1 Changed 4 years ago by mf2k (Frank Schima)

Cc: ci42 removed
Description: modified (diff)
Keywords: highsierra added; high sierra removed
Owner: set to ci42
Status: newassigned

comment:2 Changed 4 years ago by raimue (Rainer Müller)

Port: go-1.4 added
Summary: clang: error: no such file or directorygo-1.4: clang: error: no such file or directory

comment:3 Changed 4 years ago by mndavidoff (Monte Davidoff)

Also fails on macOS 10.12.6 with Xcode 9.0.

clang: error: no such file or directory: '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin16.7.0/libclang_rt.builtins-x86_64.a'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_go-1.4/go-1.4/work/go/src" && ./make.bash

Changed 4 years ago by mndavidoff (Monte Davidoff)

Attachment: main.log-sierra.gz added

comment:4 Changed 4 years ago by mndavidoff (Monte Davidoff)

Cc: mndavidoff added

comment:5 Changed 4 years ago by skymoo (Adam Mercer)

Cc: skymoo added

comment:6 Changed 4 years ago by sbutler (Stephen J. Butler)

Cc: sbutler added

comment:7 Changed 4 years ago by kimuraw (kimura wataru)

https://github.com/golang/go/issues/21908

this golang's issue says we need to disable cgo with environment CGO_ENABLED=0. I tried the following patch and succeeded to install port:go and port:go-1.4 on High Sierra 10.13.

diff --git a/lang/go-1.4/Portfile b/lang/go-1.4/Portfile
index a37873670..7106678e5 100644
--- a/lang/go-1.4/Portfile
+++ b/lang/go-1.4/Portfile
@@ -62,6 +62,11 @@ build.env           GOROOT=${GOROOT} \
                     GOROOT_FINAL=${GOROOT_FINAL} \
                     CC=${configure.cc} \
                     GCC=${configure.cc}
+# disable cgo
+# https://github.com/golang/go/issues/21908
+if {${os.major} >= 17} {
+    build.env-append CGO_ENABLED=0
+}
 
 use_parallel_build  no

comment:8 Changed 4 years ago by sbutler (Stephen J. Butler)

This also fixed my High Sierra issue, and allowed go 1.9.x to build.

comment:9 Changed 4 years ago by ci42

Resolution: fixed
Status: assignedclosed

In 34cba867f654563f7246eaf68860030dc5d2e3c8/macports-ports:

go-1.4: fix build on High Sierra

Closes: #54797

comment:10 Changed 4 years ago by mndavidoff (Monte Davidoff)

Resolution: fixed
Status: closedreopened

It looks like the build failure is still occurring on Sierra (macOS 10.12.6 with Xcode 9.0).

clang: error: no such file or directory: '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin16.7.0/libclang_rt.builtins-x86_64.a'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_go-1.4/go-1.4/work/go/src" && ./make.bash 

comment:11 Changed 4 years ago by ci42

Resolution: fixed
Status: reopenedclosed

In 8a3378c29e51f46900a21fd06bdfb0e6ba7d13ff/macports-ports:

go-1.4: always build without CGO

Closes: #54797

Note: See TracTickets for help on using tickets.