Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Issue Running Motsu #459

Closed
2 of 4 tasks
rauljordan opened this issue Dec 16, 2024 · 7 comments
Closed
2 of 4 tasks

[Bug]: Issue Running Motsu #459

rauljordan opened this issue Dec 16, 2024 · 7 comments
Assignees
Labels
needs triage Needs to be assigned the appropriate labels type: bug Something is not working as intended.

Comments

@rauljordan
Copy link

What happened?

When doing cargo test --lib in the stylus-hello-world repo with a simple motsu example

cargo test --lib
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.63s
     Running unittests src/lib.rs (target/debug/deps/stylus_hello_world-4e000e6348492506)
dyld[23977]: missing symbol called
error: test failed, to rerun pass `--lib`

Caused by:
  process didn't exit successfully: `/Users/me/Documents/code/rust/arbitrum/stylus-hello-world/target/debug/deps/stylus_hello_world-4e000e6348492506` (signal: 6, SIGABRT: process abort signal)

platform

  • linux
  • windows
  • macos

Expected behavior

Expected tests to run properly

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines
@rauljordan rauljordan added needs triage Needs to be assigned the appropriate labels type: bug Something is not working as intended. labels Dec 16, 2024
@0xNeshi
Copy link
Collaborator

0xNeshi commented Dec 16, 2024

Hi @rauljordan, and thanks for submitting a bug report!

Which version of motsu are you using?

Also could you provide the full repro steps, or an online example?

@rauljordan
Copy link
Author

hi @0xNeshi this happens in the current main branch of this repo

cd contracts && cargo test --lib finance
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.33s
     Running unittests src/lib.rs (/Users/me/Documents/code/rust/arbitrum/rust-contracts-stylus/target/debug/deps/openzeppelin_stylus-6547b1d800483b01)
dyld[34581]: missing symbol called
error: test failed, to rerun pass `--lib`

Caused by:
  process didn't exit successfully: `/Users/me/Documents/code/rust/arbitrum/rust-contracts-stylus/target/debug/deps/openzeppelin_stylus-6547b1d800483b01 finance` (signal: 6, SIGABRT: process abort signal)

On rustc 1.83.0-nightly (4ac7bcbaa 2024-09-04), which is defined in the rust-toolchain.toml

@0xNeshi
Copy link
Collaborator

0xNeshi commented Dec 16, 2024

@rauljordan go to the root of the project, and run:

cargo test --all-features finance

Let me know if this worked for you

@rauljordan
Copy link
Author

Thanks @0xNeshi this worked. Do you have some pointers on how I can get the same to run in the stylus-hello-world repo? What features need to be set in the Cargo.toml and command to use

[package]
name = "stylus-hello-world"
version = "0.1.9"
edition = "2021"
license = "MIT OR Apache-2.0"
homepage = "https://github.com/OffchainLabs/stylus-hello-world"
repository = "https://github.com/OffchainLabs/stylus-hello-world"
keywords = ["arbitrum", "ethereum", "stylus", "alloy"]
description = "Stylus hello world example"

[dependencies]
alloy-primitives = "=0.7.6"
alloy-sol-types = "=0.7.6"

mini-alloc = "0.4.2"
stylus-sdk = "0.6.0"
hex = "0.4.3"
dotenv = "0.15.0"

[dev-dependencies]
tokio = { version = "1.12.0", features = ["full"] }
ethers = "2.0"
eyre = "0.6.8"
openzeppelin-stylus = { path = "../rust-contracts-stylus/contracts", features = ["std"] }
motsu = { path = "../rust-contracts-stylus/lib/motsu" }
motsu-proc = { path = "../rust-contracts-stylus/lib/motsu-proc" }

[features]
export-abi = ["stylus-sdk/export-abi"]
debug = ["stylus-sdk/debug"]

[[bin]]
name = "stylus-hello-world"
path = "src/main.rs"

[lib]
crate-type = ["lib", "cdylib"]

[profile.release]
codegen-units = 1
strip = true
lto = true
panic = "abort"
opt-level = "s"

@0xNeshi
Copy link
Collaborator

0xNeshi commented Dec 18, 2024

@rauljordan sorry for the late reply.

You seem to have downloaded motsu and the contracts library locally and linked them manually.
You don't need to do that, to use them you only need to add:

[dependencies]
# ...
openzeppelin-stylus = "0.1.1" # we're releasing 0.2.0 soon!
# if you want the latest contracts, link it like:
# openzeppelin-stylus = { git = "https://github.com/OpenZeppelin/rust-contracts-stylus" }

[dev-dependencies]
# ...
motsu = "0.2.1"

You can now use motsu!


Unrelated to motsu, there seems to be a problem with stylus-hello-world, and by extension with projects generated by Stylus CLI (which clones stylus-hello-world when creating new projects), where they have issues building and running tests, see OffchainLabs/stylus-hello-world#43.
I created a PR to fix this (see OffchainLabs/stylus-hello-world#44), so once it's merged you'll be able to use motsu with no problems!

In the meantime, you can copy/paste the changes from the PR into your project and run motsu immediately.

Let me know if there's anything more I can do to help!

@0xNeshi 0xNeshi self-assigned this Dec 18, 2024
@0xNeshi
Copy link
Collaborator

0xNeshi commented Dec 26, 2024

@rauljordan just checking in, are you still having issues with motsu?

@0xNeshi
Copy link
Collaborator

0xNeshi commented Jan 8, 2025

Closing the issue as the fix has been merged, and the issue should no longer be appearing.

@0xNeshi 0xNeshi closed this as completed Jan 8, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Rust Contracts Stylus Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Needs to be assigned the appropriate labels type: bug Something is not working as intended.
Projects
Status: Done
Development

No branches or pull requests

2 participants