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

Rebase repo to CW-main and bump Rust version #129

Closed
wants to merge 10 commits into from

Conversation

CyberHoward
Copy link
Contributor

No description provided.

@CyberHoward
Copy link
Contributor Author

CyberHoward commented Aug 29, 2023

@adairrr Could you have a look at the feature compilation?

Run

  • make build
  • cd tests/simple-contract
docker run --rm -v "$(pwd)":/code \
  --mount type=volume,source="$(basename "$(pwd)")_cache",target=/target \
  --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
abstractmoney/rust-optimizer-arm64:0.14.0

PS: The target directory was changed to /target from ./target in the upstream repo.

Error i'm getting:

error: unexpected argument '--features hello' found

  tip: a similar argument exists: '--features'

Which is some Bash shenanigans I (and chat-gpt) can't seem to figure out...

@CyberHoward
Copy link
Contributor Author

Wrong repo, sorry!


The output file name for the optimized wasm will be the same as the default wasm, suffixed with `-<feature_name>`. For example, if the default wasm is `contract.wasm`, the optimized wasm for the feature `juno` will be `contract-juno.wasm`.

To use feature-based optimization, run the Docker image as usual. The script will automatically detect the [features] section in your Cargo.toml and optimize for each feature.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pretty neat way to create feature-enabled builds without adding extra complexity for the reproducer.

Let me know if it works well for you. Feels like a great candidate for upstreaming.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've been using it for a while so we know it works. Will see if we can clean it up a bit.

cc #80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants