Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

./build_and_run fails with xcode 11.0 #102

Closed
emileswain opened this issue Oct 2, 2019 · 5 comments
Closed

./build_and_run fails with xcode 11.0 #102

emileswain opened this issue Oct 2, 2019 · 5 comments

Comments

@emileswain
Copy link

emileswain commented Oct 2, 2019

xcode: Version 11.0 (11A420a)
Mojave: 10.14.6
Bazel: bazel 0.29.1

From going through tutorials with Mediapipe i ran

git clone https://github.com/bazelbuild/tulsi.git
cd tulsi
git fetch origin pull/99/head:xcodefix
git checkout xcodefix
sh build_and_run.sh

I get the following error for which i'm at a complete loss as to how to fix.
I found this google/mediapipe#24 which suggested some soft links

I guess you're using xcode 11 beta 4 or higher.
Apple moved swift libraries into "swift-5.0" directory, hence tulsi fails to build.
A workaround would be soft-linking the libraries from "swift-5.0" to the "swift" directory and then re-run the build process.

But that didn't work. I'm also at a loss as to how one would specify the LD_VERIFY_BITCODE build option in bazel.

./build_and_run.sh 
DEBUG: Rule 'build_bazel_rules_apple' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "ff6a37b24fcbbd525a5bf61692a12c810d0ee3c1", shallow_since = "1559833568 -0700" and dropping ["tag"]
DEBUG: Call stack for the definition of repository 'build_bazel_rules_apple' which is a git_repository (rule definition at /private/var/tmp/_bazel_emile.swain/429bf1ee4c68fd78be81496c2d71f800/external/bazel_tools/tools/build_defs/repo/git.bzl:195:18):
 - /Users/emile.swain/Workspace/workspace_crd/tulsi/WORKSPACE:3:1
INFO: Analyzed target //:tulsi (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /Users/emile.swain/Workspace/workspace_crd/tulsi/BUILD:62:1: Linking of rule '//:tulsi.__internal__.apple_binary' failed (Exit 1) wrapped_clang failed: error executing command external/local_config_cc/wrapped_clang -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -ObjC -arch x86_64 -filelist ... (remaining 26 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
ld: warning: Could not find or use auto-linked library 'swiftFoundation'
ld: warning: Could not find or use auto-linked library 'swiftDarwin'
ld: warning: Could not find or use auto-linked library 'swiftCoreFoundation'
ld: warning: Could not find or use auto-linked library 'swiftIOKit'
ld: warning: Could not find or use auto-linked library 'swiftQuartzCore'
ld: warning: Could not find or use auto-linked library 'swiftCore'
ld: warning: Could not find or use auto-linked library 'swiftCoreGraphics'
ld: warning: Could not find or use auto-linked library 'swiftObjectiveC'
ld: warning: Could not find or use auto-linked library 'swiftDispatch'
ld: warning: Could not find or use auto-linked library 'swiftSwiftOnoneSupport'
ld: warning: Could not find or use auto-linked library 'swiftXPC'
ld: warning: Could not find or use auto-linked library 'swiftCoreData'
ld: warning: Could not find or use auto-linked library 'swiftCoreImage'
ld: warning: Could not find or use auto-linked library 'swiftAppKit'
ld: warning: Could not find or use auto-linked library 'swiftMetal'
Undefined symbols for architecture x86_64:
  "static Foundation.CharacterSet.whitespaces.getter : Foundation.CharacterSet", referenced from:
      closure #2 (Swift.String) -> Swift.String in TulsiGenerator.PBXTargetGenerator.(addConfigsForIndexingTarget in _9BC2D135E4F1D200D8B700936548BDC4)(_: TulsiGenerator.PBXTarget, data: TulsiGenerator.PBXTargetGenerator.(IndexerData in _9BC2D135E4F1D200D8B700936548BDC4)) -> () in libtulsi_generator_lib.a(PBXTargetGenerator.swift.o)
      (extension in TulsiGenerator):Swift.String.escapingForShell.getter : Swift.String in libtulsi_generator_lib.a(StringExtensions.swift.o)
      closure #1 (TulsiGenerator.ProcessRunner.CompletionInfo) -> () in TulsiGenerator.XcodeProjectGenerator.(executePythonProcess in _3D27909A8CA7F8C4C4BE25046CB74F8B)(_: Swift.String, onError: (Swift.Int32, Swift.String) -> ()) -> () in libtulsi_generator_lib.a(XcodeProjectGenerator.swift.o)
  "Foundation.CharacterSet.init(charactersIn: __shared Swift.String) -> Foundation.CharacterSet", referenced from:
      Tulsi.ConfigEditorSourceFilterViewController.(populateOutlineView in _D662C3E634D8A7BBE011ADD96F19B9E0)([Tulsi.UISourcePath]) -> () in libtulsi_lib.a(ConfigEditorSourceFilterViewController.swift.o)
..........
...
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Target //:tulsi failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.273s, Critical Path: 1.13s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
@DavidGoldman
Copy link
Contributor

Which Bazel version are you using?

@emileswain
Copy link
Author

bazel 0.29.1

@DavidGoldman
Copy link
Contributor

It seems likely that the current version of rules_apple (0.18.0) that you're using does not fully support Xcode 11. I would try modifying this file to remove the tag and instead specify a commit which is more recent: e.g. HEAD as of right now.

@emileswain
Copy link
Author

Cool, i'll try that. Thanks

@emileswain
Copy link
Author

So, editing that file and changing tag to tag = "0.18.0", worked.
Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants