Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-13441] build-script fails if xcode-select points to a path that includes spaces #55883

Open
swift-ci opened this issue Aug 24, 2020 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-13441
Radar rdar://67659538
Original Reporter davidungar (JIRA User)
Type Bug
Environment

master branch, SHA: e2a1862

Xcode beta 5

Big Sur

Additional Detail from JIRA
Votes 1
Component/s
Labels Bug
Assignee None
Priority Medium

md5: d06e51cef719192e8e29a2da093833bf

duplicates:

  • SR-13634 build-script fails using ninja when the build directory is in a path that contain spaces.

relates to:

  • SR-13634 build-script fails using ninja when the build directory is in a path that contain spaces.

Issue Description:

We use build-script to build the Swift compiler, and the README file also points external users to it. In order for it to work, `xcode-select` must point to an appropriate Xcode, which currently is a beta. When downloading a newer beta and unpacking the xip❓ file, it is easy to get a name with a space in it, e.g. "Xcode-beta 1". However, if you point xcode-select to an Xcode app with a space in the name, build-script fails:

CMake Error at /usr/local/Cellar/cmake/3.18.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Python3 (missing: Interpreter)

Reason given by package:
Interpreter: Cannot run the interpreter ...

@swift-ci
Copy link
Contributor Author

Comment by Ken Harris (JIRA)

Looks like SR-6287? According to that, it worked 3 months ago.

@tonyarnold
Copy link
Contributor

I'm seeing the same using a checkout of `master` from today.

I renamed my Xcode to /Applications/Xcode 12 beta 5.app to trigger this, and then executed ./swift/utils/build-toolchain.

Here is the relevant part of the build log - I'm happy to provide more info, just let me know!

+ env 'CFLAGS=-isysroot /Applications/Xcode 12 beta 5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -mmacosx-version-min=10.9' 'CXX=/Applications/Xcode 12 beta 5.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++' 'LDFLAGS=-isysroot /Applications/Xcode 12 beta 5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -mmacosx-version-min=10.9' /Users/tonyarnold/.asdf/installs/python/3.8.3/bin/python configure.py --bootstrap
bootstrapping ninja...
/bin/sh: /Applications/Xcode: No such file or directory
when running:  /Applications/Xcode 12 beta 5.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -MMD -MT build/browse.o -MF build/browse.o.d -g -Wall -Wextra -Wno-deprecated -Wno-missing-field-initializers -Wno-unused-parameter -fno-rtti -fno-exceptions -fvisibility=hidden -pipe '-DNINJA_PYTHON="python"' -O2 -DNDEBUG -fdiagnostics-color -DNINJA_HAVE_BROWSE -I. -isysroot /Applications/Xcode 12 beta 5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -mmacosx-version-min=10.9 -c ./src/browse.cc -o build/browse.o
Traceback (most recent call last):
  File "configure.py", line 470, in <module>
    objs += cxx('browse', order_only=built('browse_py.h'))
  File "configure.py", line 287, in cxx
    return n.build(built(name + objext), 'cxx', src(name + '.cc'), **kwargs)
  File "configure.py", line 169, in build
    self._run_command(self._expand(cmd, local_vars))
  File "configure.py", line 194, in _run_command
    subprocess.check_call(cmdline, shell=True)
  File "/Users/tonyarnold/.asdf/installs/python/3.8.3/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '/Applications/Xcode 12 beta 5.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -MMD -MT build/browse.o -MF build/browse.o.d -g -Wall -Wextra -Wno-deprecated -Wno-missing-field-initializers -Wno-unused-parameter -fno-rtti -fno-exceptions -fvisibility=hidden -pipe '-DNINJA_PYTHON="python"' -O2 -DNDEBUG -fdiagnostics-color -DNINJA_HAVE_BROWSE -I. -isysroot /Applications/Xcode 12 beta 5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -mmacosx-version-min=10.9 -c ./src/browse.cc -o build/browse.o' returned non-zero exit status 127.
ERROR: command terminated with a non-zero exit status 1, aborting

@swift-ci
Copy link
Contributor Author

Comment by David Ungar (JIRA)

Many thanks, @tonyarnold !

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

2 participants