[swift-lldb-dev] Building and running swift-lldb from Xcode not working :(

Todd Fiala tfiala at apple.com
Wed Oct 5 18:09:53 CDT 2016


> On Oct 5, 2016, at 3:20 PM, Rex Fenley via swift-lldb-dev <swift-lldb-dev at swift.org> wrote:
> 
> I'm using the most recent cmake. I also blew away the lldb directory and tried to rebuild but still ended up with "error: unknown setting: cmark-cmake-options" when building desktop :(
> 

Okay.  I think you want to take that up with the swift-dev group.

Swift-dev folks - any of you know anything about the build-script error that Rex has reported?  He’s getting this on a clean build tree: "error: unknown setting: cmark-cmake-options”.

Rex, can you file a radar on bugs.swift.org <http://bugs.swift.org/>?

Thanks!

-Todd

> On Wed, Oct 5, 2016 at 2:48 PM, Todd Fiala <tfiala at apple.com <mailto:tfiala at apple.com>> wrote:
> 
>> On Oct 5, 2016, at 2:36 PM, Rex Fenley <rex at remind101.com <mailto:rex at remind101.com>> wrote:
>> 
>> Hey Todd, thanks for the info!
>> 
>> I was attempting to build from the LLDM scheme. The only errors were the two I provided, I'll post more information at the bottom. When trying the "desktop" scheme I get the following:
> 
> Okay - switch to the desktop scheme; otherwise, you’ll be missing some components.  (That is not particularly well documented - the LLDB scheme is literally for the LLDB.framework, but not everything).
>> "debugserver" isn't code signed but requires entitlements. It is not possible to add entitlements to a binary without signing it.
>> 
>> 
> 
> You have a couple options there.
> 
> 1. If you follow the docs in lldb/docs/code-signing.txt, your debugserver will be usable regardless of that message.
> 
> 2. [Preferred] Alternatively, you can set the Xcode build variable DEBUGSERVER_USE_FROM_SYSTEM=1, either via an xcodebuild command line, or by setting it directly in your Xcode settings.  It’s not enough for it to be an environment variable set.  If you go with this, the debugserver will be copied from your Xcode into the built LLDB, which will then be an official Apple-signed debugserver.  Unless you are changing debugserver, that is generally the way to go.  A fair amount of the Swift CI runs in this configuration.  (Although not everything, as we really do change debugserver and want to test those changes.)
> 
> The xcodebuild line with that set would be:
> $ cd your/lldb/source/root
> $ xcodebuild -scheme desktop DEBUGSERVER_USE_FROM_SYSTEM=1
> 
> Let me know if that gets you further.
> 
>> 
>> I don't know if syncing is the issue, I simply git cloned swift-lldb from github and went to the tag "swift-3.0-RELEASE" and built.
>> 
>> more info from LLDB scheme errors:
>> bootstrapping ninja...
>> 
>> warning: A compatible version of re2c (>= 0.11.3) was not found; changes to src/*.in.cc <http://in.cc/> will not affect your build.
>> 
>> wrote build.ninja.
>> 
>> bootstrap complete.  rebuilding...
>> 
>> + popd
>> 
>> + env HOST_VARIABLE_macosx_x86_64__SWIFT_BENCHMARK_TARGETS=swift-benchmark-macosx-x86_64 HOST_VARIABLE_macosx_x86_64__SWIFT_RUN_BENCHMARK_TARGETS=check-swift-benchmark-macosx-x86_64 'HOST_VARIABLE_macosx_x86_64__SWIFT_SDKS=IOS IOS_SIMULATOR OSX TVOS TVOS_SIMULATOR WATCHOS WATCHOS_SIMULATOR' HOST_VARIABLE_macosx_x86_64__SWIFT_STDLIB_TARGETS=swift-test-stdlib-macosx-x86_64 HOST_VARIABLE_macosx_x86_64__SWIFT_TEST_TARGETS= caffeinate /Users/Rex/Documents/projects/swift-lldb/swift/utils/build-script-impl --workspace /Users/Rex/Documents/projects/swift-lldb --build-dir /Users/Rex/Documents/projects/swift-lldb/llvm-build/Ninja-RelWithDebInfoAssert --install-prefix /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr --host-target macosx-x86_64 --stdlib-deployment-targets 'macosx-x86_64 iphonesimulator-i386 iphonesimulator-x86_64 appletvsimulator-x86_64 watchsimulator-i386 iphoneos-armv7 iphoneos-armv7s iphoneos-arm64 appletvos-arm64 watchos-armv7k' --host-cc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang --host-cxx /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ --darwin-xcrun-toolchain default --darwin-deployment-version-osx=10.9 --darwin-deployment-version-ios=7.0 --darwin-deployment-version-tvos=9.0 --darwin-deployment-version-watchos=2.0 --cmake /usr/local/bin/cmake --cmark-build-type RelWithDebInfo --llvm-build-type RelWithDebInfo --swift-build-type RelWithDebInfo --swift-stdlib-build-type RelWithDebInfo --lldb-build-type RelWithDebInfo --foundation-build-type RelWithDebInfo --libdispatch-build-type RelWithDebInfo --xctest-build-type RelWithDebInfo --swift-enable-assertions true --swift-stdlib-enable-assertions true --swift-analyze-code-coverage false --cmake-generator Ninja --build-jobs 8 '--common-cmake-options=-G Ninja -DCMAKE_C_COMPILER:PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -DCMAKE_CXX_COMPILER:PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DCMAKE_MAKE_PROGRAM=/Users/Rex/Documents/projects/swift-lldb/llvm-build/Ninja-RelWithDebInfoAssert/ninja-build/ninja' --build-args=-j8 --cmark-cmake-options= '--llvm-cmake-options=-DLLVM_ENABLE_ASSERTIONS=TRUE -DLLVM_TARGETS_TO_BUILD=X86;ARM;AArch64;PowerPC;SystemZ' --swift-cmake-options= --build-stdlib-deployment-targets all --ninja-bin=/Users/Rex/Documents/projects/swift-lldb/llvm-build/Ninja-RelWithDebInfoAssert/ninja-build/ninja --skip-build-benchmarks --skip-build-foundation --skip-build-xctest --skip-build-lldb --skip-build-llbuild --skip-build-libdispatch --skip-build-swiftpm --skip-build-playgroundlogger --skip-build-playgroundsupport --build-swift-dynamic-stdlib --build-swift-dynamic-sdk-overlay --skip-build-ios-device --skip-build-ios-simulator --skip-build-tvos-device --skip-build-tvos-simulator --skip-build-watchos-device --skip-build-watchos-simulator --skip-build-android --skip-test-swift --skip-test-cmark --skip-test-lldb --skip-test-llbuild --skip-test-swiftpm --skip-test-xctest --skip-test-foundation --skip-test-libdispatch --skip-test-playgroundlogger --skip-test-playgroundsupport --skip-test-linux --skip-test-freebsd --skip-test-cygwin --skip-test-osx --skip-test-ios-host --skip-test-ios-simulator --skip-test-tvos-host --skip-test-tvos-simulator --skip-test-watchos-host --skip-test-watchos-simulator --skip-test-android-host --skip-test-benchmarks --skip-test-optimized --android-deploy-device-path /data/local/tmp --toolchain-prefix /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain --install-destdir=/Users/Rex/Documents/projects/swift-lldb/llvm-build/ReleaseAssert/swift-macosx-x86_64 --llvm-lit-args=-sv
>> 
>> error: unknown setting: cmark-cmake-options
>> 
>> 
> 
> Two more things to check.
> 
> 1. Are you using a very recent version of cmake?  I’d suggest going with the latest one available (should be at least 3.6.x).
> 
> 2. Blow away your lldb/llvm-build directory.  You may have a stale cmake setup.  We’ve had a few usage issues with cmake where our build isn’t properly handling modifications to the cmake files in a stable way.  The net result is you can get cmake ninja setups that get confused.
> 
> Otherwise, you may need to ping the swift-dev list, since this is a failure in the LLVM/clang/Swift build step as built with build-script from Swift.
> 
> All the same, let me know if you get further with any of these.
> 
> -Todd
> 
>> 
>> On Wed, Oct 5, 2016 at 1:58 PM, Todd Fiala <tfiala at apple.com <mailto:tfiala at apple.com>> wrote:
>> 
>>> On Oct 5, 2016, at 1:50 PM, Todd Fiala <tfiala at apple.com <mailto:tfiala at apple.com>> wrote:
>>> 
>>> 
>>>> On Oct 5, 2016, at 1:41 PM, Rex Fenley via swift-lldb-dev <swift-lldb-dev at swift.org <mailto:swift-lldb-dev at swift.org>> wrote:
>>>> 
>>>> Hey swift lldb team!
>>>> 
>>>> I tried building the LLDB target from within Xcode. However, I get the following error during compilation:
>>>> subprocess.CalledProcessError: Command '['python', '/Users/Rex/Documents/projects/swift-lldb/llvm/tools/swift/utils/build-script', '--preset=LLDB_Swift_ReleaseAssert', 'swift_install_destdir=/Users/Rex/Documents/projects/swift-lldb/llvm-build/ReleaseAssert/swift-macosx-x86_64']' returned non-zero exit status 1
>>>> 
>>> 
>>> That message indicates that the LLVM/clang/Swift build portion of the Xcode-driven build failed.  There should be actual failure content from build-script somewhere above the ‘exit status 1’ portion.  You might need to go to your build log (the Report Navigator, right-most speech-bubble-like icon from the left pane of Xcode).  There should be a build log that details everything the Xcode build did, of which running the build-script is one stage.
>>> 
>>> Just to verify, what Xcode scheme and/or configuration are you building?  It should be the ‘desktop’ scheme, which will default to the DebugClang (or maybe Debug) configuration.
>> 
>> The other thing that might be the issue may be the state of the llvm, clang, swift and cmark repositories.  If your original check-out was via lldb, then it will automatically do a git clone of the relevant dependent projects for you.  However, it will not update them.  So, if you allowed the lldb build to sync those, then did a refresh of lldb much later, and didn’t manually update the llvm, clang, swift or cmark directory, you will have an out-of-sync composite source tree.
>> 
>> For the Xcode-driven build, the source layout looks like:
>> lldb/
>> lldb/llvm
>> lldb/llvm/tools/clang
>> lldb/llvm/tools/cmark
>> lldb/llvm/tools/swift
>> 
>> There will be symlinks in the lldb/ directory to the clang and swift directories.
>> 
>> You’ll want to make sure you update all of those at roughly the same time.  That might be a good place to start if this sounds like it might be your scenario.
>>>> And much further up I see
>>>> 
>>>> warning: A compatible version of re2c (>= 0.11.3) was not found; changes to src/*.in.cc <http://in.cc/> will not affect your build.
>>>> 
>>>> 
>>>> and
>>>> 
>>>> error: unknown setting: cmark-cmake-options
>>>> 
>>>> How may I fix this/these issues to build and run lldb from Xcode?
>>>> 
>>>> Thanks :)
>>>> 
>>>> 
>>>> -- 
>>>> Rex Fenley  |  IOS DEVELOPER
>>>> 
>>>> 
>>>> Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>  |  FOLLOW US <https://twitter.com/remindhq>  |  LIKE US <https://www.facebook.com/remindhq>_______________________________________________
>>>> swift-lldb-dev mailing list
>>>> swift-lldb-dev at swift.org <mailto:swift-lldb-dev at swift.org>
>>>> https://lists.swift.org/mailman/listinfo/swift-lldb-dev <https://lists.swift.org/mailman/listinfo/swift-lldb-dev>
>>> 
>> 
>> 
>> 
>> 
>> -- 
>> Rex Fenley  |  IOS DEVELOPER
>> 
>> 
>> Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>  |  FOLLOW US <https://twitter.com/remindhq>  |  LIKE US <https://www.facebook.com/remindhq>
> 
> 
> 
> -- 
> Rex Fenley  |  IOS DEVELOPER
> 
> 
> Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>  |  FOLLOW US <https://twitter.com/remindhq>  |  LIKE US <https://www.facebook.com/remindhq>_______________________________________________
> swift-lldb-dev mailing list
> swift-lldb-dev at swift.org <mailto:swift-lldb-dev at swift.org>
> https://lists.swift.org/mailman/listinfo/swift-lldb-dev <https://lists.swift.org/mailman/listinfo/swift-lldb-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-lldb-dev/attachments/20161005/cbc475af/attachment.html>


More information about the swift-lldb-dev mailing list