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

dyld error on M1 #12

Open
alanf opened this issue Nov 16, 2022 · 10 comments
Open

dyld error on M1 #12

alanf opened this issue Nov 16, 2022 · 10 comments

Comments

@alanf
Copy link

alanf commented Nov 16, 2022

➜  swift-diffusion git:(main) ✗ bazel run examples:txt2img --compilation_mode=opt -- /Users/alan/Documents  "a photograph of an astronaut riding a horse"
INFO: Build option --compilation_mode has changed, discarding analysis cache.
INFO: Analyzed target //examples:txt2img (2 packages loaded, 1289 targets configured).
INFO: Found 1 target...
Target //examples:txt2img up-to-date:
  bazel-bin/examples/txt2img
INFO: Elapsed time: 0.459s, Critical Path: 0.03s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/examples/txt2img /Users/alan/Documents 'a photograph of an astronaut riding a
INFO: Build completed successfully, 1 total action
dyld[34469]: Symbol not found: (_$s10Foundation11JSONDecoderC6decode_4fromxxm_AA4DataVtKSeRzlFTj)
  Referenced from: '/private/var/tmp/_bazel_alan/3731b9e12e12cbc0629cde4e0e832bb3/execroot/__main__/bazel-out/darwin_arm64-opt/bin/examples/txt2img'
  Expected in: '/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation'

Any suggestions for what to try to get around this error? Thank you!

@liuliu
Copy link
Owner

liuliu commented Nov 16, 2022

Which OS version you are on? And which Xcode? Seems like a mismatch of compiler / macOS.

@alanf
Copy link
Author

alanf commented Nov 16, 2022

OS: Monterey 12.6.1 (21G217)
Xcode: 14.1 but I also have 13.3.1 installed

@liuliu
Copy link
Owner

liuliu commented Nov 16, 2022

And xcode-select -p is showing the Xcode 14.1 path?

@alanf
Copy link
Author

alanf commented Nov 16, 2022

It is:
/Applications/Xcode.app/Contents/Developer
(the other Xcode is named Xcode-13.3.1)

@liuliu
Copy link
Owner

liuliu commented Nov 17, 2022

Thanks. This error feels like the one I encountered sometime ago for another project, when there is a mismatch in declared macOS compatibility with the available SDK. Need to dig into it to find what's the fix last time. Won't have time until Friday.

@alanf
Copy link
Author

alanf commented Nov 17, 2022

Thanks for looking!

@jiangdi0924
Copy link

jiangdi0924 commented Nov 19, 2022

Same Error +1

  • MacBook Pro (13-inch, M1, 2020)
  • OS: 12.5.1 (21G83)
  • Xcode14.1.app

swift-diffusion git:(main) ✗ bazel run examples:txt2img --compilation_mode=opt -- /Users/Norton/MyTestProject/swift-diffusion "a photograph of an astronaut riding a horse" INFO: Invocation ID: e58c9a68-8dee-4af6-9143-be0dc7f79a06 INFO: Analyzed target //examples:txt2img (0 packages loaded, 0 targets configured). INFO: Found 1 target... Target //examples:txt2img up-to-date: bazel-bin/examples/txt2img INFO: Elapsed time: 0.100s, Critical Path: 0.00s INFO: 1 process: 1 internal. INFO: Build completed successfully, 1 total action INFO: Build completed successfully, 1 total action dyld[50764]: Symbol not found: (_$s10Foundation11JSONDecoderC6decode_4fromxxm_AA4DataVtKSeRzlFTj) Referenced from: '/private/var/tmp/_bazel_jiangdi/084e5c28a69a5fa4549390fedc56f690/execroot/__main__/bazel-out/darwin_arm64-opt/bin/examples/txt2img' Expected in: '/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation'

@liuliu
Copy link
Owner

liuliu commented Nov 22, 2022

Thanks. I now think this is related to Xcode 14.1, and basically the binaries built with Bazel rules_swift needs to specify its minimal supported macOS version otherwise Xcode 14.1 is going to build with macOS 13's toolchain. Easy solution is to upgrade to macOS 13.0.

@jiangdi0924
Copy link

@liuliu after upgrade macOS version it worked well, Much appreciated !!!
Now I have another question,I have no experience with bazel, how should I use the packages generated by bazel integration my macOS or iOS project?
😊Many thanks~~~

@liuliu
Copy link
Owner

liuliu commented Nov 25, 2022

Thanks! Yeah, Bazel is not the easiest to use, to integrate with Xcode project, I recommend to try https://github.com/buildbuddy-io/rules_xcodeproj

I do plan to package this for SPM, but won't get much time until December (need to add new samplers, CLI etc to this repo from draw-things repo). Constantly get distracted because newer models etc etc.

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

No branches or pull requests

3 participants