Closed CyberHoward closed 4 months ago
Looks like this is because osmosisd only supports x86.
I got this just now on our CI: https://github.com/mars-protocol/red-bank/actions/runs/5621988241/job/15233817436?pr=267
Not sure why it happened. I managed to solve it by running the job on macos-latest
instead of ubuntu-latest
.
@CyberHoward Are you running linux? Perhaps its a linux issue.
No, running the latest Mac OS.
Also seeing this. looks like test-tube/packages/osmosis-test-tube/libosmosistesttube is build for x86 and when running on mac os M1/2 linking for arm architecture fails
cc @iboss-ptk
Also having this issue. Makes it more annoying to write tests with this library... and it's so nice I want to use it.
I also have the same issue running on Apple M1 Max
A temporary fix I've found is to run the test in a x86 docker container. dockerfile.
But it's a lot slower.
@CyberHoward @njerschow @j0nl1 @JakeHartnell
I was really wondering about this issue since I'm on m1 max as well and there is no issue.
But one possibility might be because of rust toolchain .
run rustup show
and check if active toolchain some variant of *-aarch64-apple-darwin
you might be on x86_64-apple-darwin
and other things might work for some reason I'm unsure of but this might cause linker to confuse.
stable-aarch64-apple-darwin (default)
rustc 1.72.0 (5680fa18f 2023-08-23)
Running the aarch toolchain.
Then how about
export GOOS="darwin"
export GOARCH="arm64"
(try cargo clean
first just to be sure it rebuilds libosmosistesttube
)
Did that, now the osmosis-test-tube
build fails:
error: failed to run custom build command for `osmosis-test-tube v19.0.0`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_TEST_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.
Caused by:
process didn't exit successfully: `abstract/modules/target/debug/build/osmosis-test-tube-066cc009cbc73844/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-changed=./libosmosistesttube
--- stderr
go: no Go source files
thread 'main' panicked at 'failed to build go code', /Users/robin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/osmosis-test-tube-19.0.0/build.rs:114:9
stack backtrace:
0: rust_begin_unwind
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:593:5
1: core::panicking::panic_fmt
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/panicking.rs:67:14
2: build_script_build::build_libosmosistesttube
3: build_script_build::main
4: core::ops::function::FnOnce::call_once
Which is:
let exit_status = Command::new("go")
.current_dir(manifest_dir.join("libosmosistesttube"))
.arg("build")
.arg("-buildmode=c-shared")
.arg("-o")
.arg(out)
.arg("main.go")
.spawn()
.unwrap()
.wait()
.unwrap();
if !exit_status.success() {
panic!("failed to build go code"); // <--- This line
}
Thanks for the help btw, happy to try some more suggestions.
Edit: will try cloning and building this repo locally
Edit 2: The output of the shell command that fails is:
Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "go: no Go source files\n"
Edit 3: A quick google search pointed out setting CGO_ENABLED=1
. This allowed me to build the repo.
In summary doing the following fixed the issue for me:
cargo clean
export GOOS="darwin"
export GOARCH="arm64"
export CGO_ENABLED=1
@JakeHartnell @njerschow @j0nl1 Mind trying it out and letting us know if it worked?
@CyberHoward Nice!
Out of curiosity, what's the output of your go version
?
@CyberHoward Nice!
Out of curiosity, what's the output of your
go version
?
go version go1.19.4 darwin/amd64
Oh, that's probably why. Mine is go1.20.4 darwin/arm64
.
darwin/amd64
is for x86-64
arch
Same here with an M2 mac, im running go version go1.21.3 darwin/arm64
. Haven't been able to resolve it even with @CyberHoward's fix above
Update, works for me with latest versions. Also running it in DAO DAO CI: https://github.com/DA0-DA0/dao-contracts/blob/95e4f73a170705deeb3689341c51f3a3b126e3e9/.github/workflows/test_tube.yml
OP issue is resolved, please open new issue if there is any similar one.
When using test-tube as an execution environment I run into the following error:
Are there any pre-requisites that I might not have installed? I didn't see any in the readme. Running on an M1 max.