tomm / fab-agon-emulator

Agon Light, Agon Light 2, Agon Console8 Emulator for Linux, Windows, any system with libSDL
GNU General Public License v3.0
82 stars 19 forks source link

macOS - Build Issue - Cargo errors #40

Closed snakebyte69 closed 7 months ago

snakebyte69 commented 8 months ago

Errors in the Cargo Build

Some errors have detailed explanations: E0405, E0412, E0425, E0433, E0463, E0531. error: could not compile bitflags (lib) due to 58 previous errors error: could not compile smallvec (lib) due to 146 previous errors Some errors have detailed explanations: E0405, E0432, E0463. error: could not compile ppv-lite86 (lib) due to 188 previous errors make: *** [cargo] Error 101

%

snakebyte69 commented 8 months ago

FORCE=1 cargo build -r --target=aarch64-apple-darwin Compiling libc v0.2.152 Compiling cfg-if v1.0.0 Compiling bitflags v2.4.1 Compiling rustix v0.38.30 Compiling ppv-lite86 v0.2.17 Compiling smallvec v1.12.0 Compiling bitflags v1.3.2 Compiling sdl2-sys v0.36.0 error[E0463]: can't find crate for core | = note: the aarch64-apple-darwin target may not be installed = help: consider downloading the target with rustup target add aarch64-apple-darwin

nizmow commented 8 months ago

The solution is actually in your error message, though I admit it's a little buried:

2 | use core::ops::{Add, AddAssign, BitAnd, BitOr, BitXor, BitXorAssign, Not};
| ^^^^ can't find crate
|
= note: the aarch64-apple-darwin target may not be installed
= help: consider downloading the target with rustup target add aarch64-apple-darwin

Try running rustup target add aarch64-apple-darwin, the project is configured to build universal binaries so you need toolchains for ARM and x86_64.

snakebyte69 commented 8 months ago

It built ok up until this version, so this is new. I will try this, thanks for the information. Something that will need to be added to the MacOS howto

snakebyte69 commented 8 months ago

% rustup target add aarch64-apple-darwin % rustup update % cargo update Did not fix this issue

rlucente-se-jboss commented 7 months ago

Similar issue on MacBook Air, Apple M2, MacOS Sonoma 14.2.1. Builds are now failing that used to work. First error is

error[E0463]: can't find crate for `core`
  |
  = note: the `x86_64-apple-darwin` target may not be installed
  = help: consider downloading the target with `rustup target add x86_64-apple-darwin`

but running similar rustup/cargo commands as previous comment (with x86_64 instead of aarch64) has the same outcome and builds fail.

snakebyte69 commented 7 months ago

The existing make files builds x86_64 and aarch64 (copies over the top of the binary) I have an updated Makefile here that selects the correct build and Displays the System Architecture and Compiler at the start. The is still and @rpath issue. I will close this issue and start a new one with new errors. https://github.com/snakebyte69/fab-agon-emulator