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

Trouble with platforming Bevy on mac #2432

Closed
JanCVanB opened this issue Jan 31, 2022 · 5 comments
Closed

Trouble with platforming Bevy on mac #2432

JanCVanB opened this issue Jan 31, 2022 · 5 comments
Labels
macos macOS-specific issues

Comments

@JanCVanB
Copy link
Sponsor Collaborator

JanCVanB commented Jan 31, 2022

I'm trying to get a simple Bevy-based game platform working, but I'm stuck on the "hello world" step. See d58b818 on ignore_noncontribution_bevy_debugging.

This seems like the crux of the issue (and it seems related to rust-lang/rust#91372) :

[nix-shell:~/code/clones/roc]$ cargo run examples/hello-rust/Hello.roc
   Compiling libc v0.2.106
   ...
   Compiling roc_cli v0.1.0 (/Users/jan/code/clones/roc/cli)
    Finished dev [unoptimized + debuginfo] target(s) in 3m 19s
     Running `target/debug/roc examples/hello-rust/Hello.roc`
🔨 Rebuilding host... Done!
Undefined symbols for architecture x86_64:
  "_AudioComponentFindNext", referenced from:
      __ZN9coreaudio10audio_unit9AudioUnit14new_with_flags17heb6ec65f112e010bE in host.o
  ...
  "_AudioUnitUninitialize", referenced from:
      __ZN9coreaudio10audio_unit9AudioUnit12uninitialize17h3386111a26093dcbE in host.o
      __ZN74_$LT$coreaudio..audio_unit..AudioUnit$u20$as$u20$core..ops..drop..Drop$GT$4drop17h75c103dc6ced4686E in host.o
ld: symbol(s) not found for architecture x86_64
@rtfeldman
Copy link
Sponsor Contributor

So now that #2430 is merged, you should be able to add -framework CoreAudio (following the same pattern of the -framework flags added in that PR) to the macOS linking, and see if that helps.

I'm on clang version 11.1.0; I'd try updating to that if possible too!

@ayazhafiz
Copy link
Sponsor Member

I rebased ignore_noncontribution_bevy_debugging on trunk and added 41d36bf. Linking with AudioUnit and CoreAudio seems to be enough:

    Finished dev [unoptimized + debuginfo] target(s) in 24.17s
     Running `target/debug/roc examples/hello-rust/Hello.roc`
🔨 Rebuilding host... Done!
hello world
Hello, World!

@JanCVanB
Copy link
Sponsor Collaborator Author

Today, on my 2015 macbook:

  • Hmm, how do I update clang?
  • Hmm, how do I update Xcode?
  • Hmm, why does the Xcode installer say there's not enough disk space?
  • Hmm, why can't I clear 200GB of system data?
  • Hmm, why did deleting Xcode manually break the updater?
  • Hmm, why didn't anything tell me there was OS update?
  • Hmm, why is the OS download stalled?

My prediction for tomorrow:

  • Hmm, how do I remap the apple key in Manjaro?

@JanCVanB
Copy link
Sponsor Collaborator Author

If 41d36bf does indeed get it working, should I PR that change into trunk?

@JanCVanB
Copy link
Sponsor Collaborator Author

JanCVanB commented Jan 31, 2022

  • Updated to macOS 12.2
  • Updated to XCode 13.2.1
  • Uninstalled & reinstalled Nix
  • Successfully ran cargo run examples/hello-rust/Hello.roc on the first try
  • Modified the example to use the commented-out sections with the breakout game
  • Failed to run cargo run examples/hello-rust/Hello.roc due to errors about _IOHIDDeviceCopyMatchingElement, _IOHIDElementGetChildren, _IOHIDManagerClose, etc.
  • Learned about the /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ directory
  • Added IOKit to compiler/build/src/link.rs
  • Successfully ran the breakout game on the first try!!!

Screen Shot 2022-01-31 at 11 07 34 AM

Thank you both so much! 😄 I'll PR the linkages now.

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

No branches or pull requests

3 participants