tpoechtrager / osxcross

Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)
GNU General Public License v2.0
2.87k stars 326 forks source link

gen_sdk_package error in xcode14 #383

Closed zhang-bin closed 1 year ago

zhang-bin commented 1 year ago

I have installed Xcode 14.3.1, when i run ./tools/gen_sdk_package.sh, it give me an error:

cp: cannot overwrite directory /tmp/yQ0WK0VZsYu/MacOSX13.3.sdk/usr/include/c++/v1/__string with non-directory Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__string

madmalik commented 1 year ago

I had the same error, and while searching for a solution I found this issue, so I'm just gonna write how I got it to work:

My "solution" was to replace line 185 - 189 in gen_sdk_package.sh with

  if [ -d $LIBCXXDIR1 ]; then
    rm -rf "$TMP/$SDK/usr/include/c++/v1/__string"
    cp -rf $LIBCXXDIR1 "$TMP/$SDK/usr/include/c++"
  elif [ -d $LIBCXXDIR2 ]; then
    rm -rf "$TMP/$SDK/usr/include/c++/v1/__string"
    cp -rf $LIBCXXDIR2 "$TMP/$SDK/usr/include/c++"
  fi

Super hacky workaround, but might carry you over until its fixed properly.

zhang-bin commented 1 year ago

Thanks madmalik.

tpoechtrager commented 1 year ago

Fixed.

joseluisq commented 1 year ago

Using 3279f86 but the problem still persists.

$ git show --pretty=format:"%h" --no-patch
3279f86
$ sw_vers -productVersion
13.4.1
$ ./tools/gen_sdk_package_tools.sh
found Xcode Command Line Tools: /Library/Developer/CommandLineTools
packaging MacOSX12.3 SDK (this may take several minutes) ...
packaging MacOSX12 SDK (this may take several minutes) ...
packaging MacOSX13.3 SDK (this may take several minutes) ...
cp: cannot overwrite directory /tmp/RUvjJ1gGeA7/MacOSX13.3.sdk/usr/include/c++/v1/__string with non-directory usr/include/c++/v1/__string
tpoechtrager commented 1 year ago

@joseluisq Should be fixed.

joseluisq commented 1 year ago

@tpoechtrager Yes, It works now. I just tested HEAD and MacOSX13.x gets packaged correctly again.