riscv-software-src / homebrew-riscv

homebrew (macOS) packages for RISC-V toolchain
https://riscv.org
310 stars 50 forks source link

Use big sur bottle for catalina #66

Closed bradjc closed 3 years ago

bradjc commented 3 years ago

I'm apparently not on the latest version of MacOS, and so when trying brew install riscv-gnu-toolchain it started building from source. I hacked the formula file a little and hosted the existing bottle locally with "catalina" in its name and managed to get brew to install it. It seems to work!

However, on the first compilation I got:

$ make RISCV=1
  CC        ../../libtock/crt0.c
dyld: Library not loaded: /usr/local/opt/zstd/lib/libzstd.1.dylib
  Referenced from: /usr/local/Cellar/riscv-gnu-toolchain/master/libexec/gcc/riscv64-unknown-elf/11.1.0/cc1
  Reason: image not found
riscv64-unknown-elf-gcc: internal compiler error: Abort trap: 6 signal terminated program cc1
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
make: *** [../../libtock/build/rv32i/crt0.o] Error 4

I solved that with:

$ brew install zstd

So, perhaps zstd is an expected dependency. I added it to the dependency list (but I'm not sure if there is some difference between catalina and big sur somehow).

The last part of this PR that I cannot do is the existing bottle would need to be copied on the server to the filename riscv-gnu-toolchain-master.catalina.bottle.6.tar.gz.

sbeamer commented 3 years ago

Good catch on ztsd!

That appears to be a recent dependence for gcc, and somehow brew is aware of that dependence despite it not being in the riscv-gnu-toolchain formulat

> brew remove zstd
Error: Refusing to uninstall /usr/local/Cellar/zstd/1.5.0
because it is required by gcc and riscv-gnu-toolchain, which are currently installed.

I'm not sure repurposing bottles across macOS versions is safe in the long-run, but I will approve it for this case.

As you can see above, the CI gave up because building multilib took too long.