holochain / tx5

Holochain WebRTC P2P Communication Ecosystem
Apache License 2.0
67 stars 6 forks source link

holochain instantly crashes after starting two instances on the same device, due to tx5 #38

Closed Connoropolous closed 1 year ago

Connoropolous commented 1 year ago

steps to reproduce: run holochain 0.2.1-beta-dev.0 in two separate instances on one computer simultaneously. This is common for local development and gossip testing scenarios. This is particularly on an M1 mac.

    message: Some(
        failed to load shared: DlOpen { desc: "dlopen(/Users/connor/Library/Application Support/go-pion-webrtc-GbZUcbjoGlwVe0Rmsm0HoGhFxXtXEdysniB3mAglXAA.dylib, 0x0005): tried: \'/Users/connor/Library/Application Support/go-pion-webrtc-GbZUcbjoGlwVe0Rmsm0HoGhFxXtXEdysniB3mAglXAA.dylib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64\')), \'/System/Volumes/Preboot/Cryptexes/OS/Users/connor/Library/Application Support/go-pion-webrtc-GbZUcbjoGlwVe0Rmsm0HoGhFxXtXEdysniB3mAglXAA.dylib\' (no such file), \'/Users/connor/Library/Application Support/go-pion-webrtc-GbZUcbjoGlwVe0Rmsm0HoGhFxXtXEdysniB3mAglXAA.dylib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64\'))" },
    ),
    location: Location {
        file: "/Users/karl/.cargo/registry/src/github.com-1ecc6299db9ec823/tx5-go-pion-sys-0.0.1-alpha.10/src/lib.rs",
        line: 188,
        col: 22,
    },
    can_unwind: true,
}
Connoropolous commented 1 year ago

p.s. the reason it mentions two different /Users/x paths is because we are using a pre-built binary and the one is the trace of the system that built it, and the other is the system that's running it. However, the same issue occurs on the same system that built it, so it is not the source of the issue https://github.com/lightningrodlabs/holochain-runner/releases/tag/v0.7.2

neonphog commented 1 year ago

@Connoropolous - are you doing any cross-compiling?

mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64\')

It looks like the go-build command may need to be updated in the sys build.rs somehow to generate the lib for the proper architecture.

neonphog commented 1 year ago

e.g. some kind of block like:

#[cfg(target_arch = "aarch64")]
cmd.env("GOARCH", "arm64");
Connoropolous commented 1 year ago

thanks. we've overcome this for now, still not sure what the source cause was. If we see again your tips might be handy though.

neonphog commented 1 year ago

e.g. some kind of block like:

#[cfg(target_arch = "aarch64")]
cmd.env("GOARCH", "arm64");

@Connoropolous implemented: https://github.com/holochain/tx5/pull/43/files#diff-ca5cab78b3bfe48cf34e2549c4dab0af2e1c5441796232ada8bb4d5efd94f0e7R103-R112