freenet / freenet-core

Declare your digital independence
https://freenet.org/
Apache License 2.0
2.28k stars 81 forks source link

MacOS brew install rust incompatibility with fdev #885

Open kernelkind opened 1 year ago

kernelkind commented 1 year ago

It should be noted that developers using brew install rust will run into issues when using fdev.

Here's how to replicate the problem:

  1. $ brew install rust
  2. $ curl https://sh.rustup.rs -sSf | sh
  3. $ cargo install freenet fdev
  4. $ rustup target add wasm32-unknown-unknown
  5. $ cd <absolute path to identity-managent in freenet-core>
  6. $ gmake build

The following is output from gmake build: brew_build_output.txt

This problem can be avoided by not using the homebrew version of rust. Here's how to get fdev working again:

  1. $ brew remove rust
  2. $ gmake build

Here's the new (correct) output from gmake build:

cd /Users/redacted/Documents/GitRemotes/freenet-core/modules/identity-management
fdev build --package-type delegate --features contract
Compiling delegate with rust
   Compiling identity-management v0.0.1 (/Users/redacted/Documents/GitRemotes/freenet-core/modules/identity-management)
    Finished release [optimized] target(s) in 1.84s
cd /Users/redacted/Documents/GitRemotes/freenet-core/modules/identity-management
hash=$(bash -c "fdev inspect build/freenet/identity_management delegate | grep 'code hash:' | cut -d' ' -f3")
mkdir -p /Users/redacted/Documents/GitRemotes/freenet-core/modules/identity-management/build
echo -n $hash > /Users/redacted/Documents/GitRemotes/freenet-core/modules/identity-management/build/identity_management_code_hash
cd /Users/redacted/Documents/GitRemotes/freenet-core/modules/identity-management
cargo run -- --path /Users/redacted/Documents/GitRemotes/freenet-core/modules/identity-management/build
    Finished dev [unoptimized + debuginfo] target(s) in 0.10s
     Running `/Users/redacted/Documents/GitRemotes/freenet-core/target/debug/tool --path /Users/redacted/Documents/GitRemotes/freenet-core/modules/identity-management/build`
storing private key file: `identity-manager-key.private.pem`
storing private key file: `identity-manager-key.public.pem`
storing parameters file: `identity-manager-params`
github-actions[bot] commented 1 year ago

Pivotal Tracker story: https://www.pivotaltracker.com/story/show/186434974