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

feat: Add features for dev and prod wasmer configurations #120

Merged
merged 7 commits into from
Oct 31, 2024

Conversation

ThetaSinner
Copy link
Member

No description provided.

@ThetaSinner ThetaSinner force-pushed the add-wasmer-prod-compiler branch 3 times, most recently from b0ba43a to 384c565 Compare October 22, 2024 12:17
wasmer = { version = "=4.3.6", optional = true, default-feature = false }
wasmer-middlewares = { version = "=4.3.6", optional = true, default-feature = false }
wasmer = { version = "=4.3.6", optional = true, default-features = false }
wasmer-middlewares = { version = "=4.3.6", optional = true, default-features = false }
Copy link
Member Author

Choose a reason for hiding this comment

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

This took me way too long to find. This is a horrible little mistake to catch!

Copy link
Contributor

Choose a reason for hiding this comment

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

Why does cargo check not catch that?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question! Just put this back and ran cargo check. Doesn't find it.

I guess Cargo is ignoring unknown fields? Which is something I hate with a passion. If people want custom properties, make them use x-property-name and reject all other inputs. We've known this is a good way to design software for 50 years because you can find it in specs from the 70s... /endrant :)

Copy link
Member

Choose a reason for hiding this comment

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

oof my bad! 😬

Copy link
Member Author

Choose a reason for hiding this comment

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

All good, I blame Cargo, not the typo :)

@ThetaSinner ThetaSinner requested a review from a team October 25, 2024 10:59
wasmer = { version = "=4.3.6", optional = true, default-feature = false }
wasmer-middlewares = { version = "=4.3.6", optional = true, default-feature = false }
wasmer = { version = "=4.3.6", optional = true, default-features = false }
wasmer-middlewares = { version = "=4.3.6", optional = true, default-features = false }
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does cargo check not catch that?

- name: test root
run: cargo test --release --no-default-features --features error_as_host,${{ matrix.wasmer-feature }} -- --nocapture
shell: pwsh
Copy link
Contributor

Choose a reason for hiding this comment

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

PowerShell? Why?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because this is running on Windows only and because its easier to work with than batch on Windows. With the distinction between traditional powershell and powershell core (pwsh), there is now a cross-platform and very capable scripting language option for Windows.

scripts/fuzz-wasmer_sys.sh Outdated Show resolved Hide resolved
@ThetaSinner ThetaSinner requested a review from a team October 25, 2024 15:32
@mattyg
Copy link
Member

mattyg commented Oct 25, 2024

Should we add a changelog note describing the different flags?

- name: Install LLVM
env:
LLVM_DIR: .llvm
shell: bash
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this also be powershell like the others?

Copy link
Member Author

Choose a reason for hiding this comment

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

That would involve me figuring out the black magic bash command that I copied from the wasmer project's CI :)

Given that we're pulling their prebuilt binary, I'd prefer to just use their command to unpack it too

https://github.com/wasmerio/wasmer/blob/main/.github/workflows/build.yml#L270

Comment on lines +3 to +5
./scripts/fuzz-wasmer_sys_prod.sh
./scripts/fuzz-wasmer_wamr.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the current working directory root when running this script or should these also be without the scripts/ in the path?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ideally the script would locate itself but if you run ./scripts/fuzz.sh then yes these need to be referenced relative to the CWD of the caller. Given that this isn't in working order anyway, I don't fancy digging deeper into fixing this. I opened an issue on the repo about fuzzing not working without extra tools. It was automated in CI at some point but that's not maintained either.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay. For calling scripts from scripts without depending on being called from a particular location it is possible to get the directory of the current file and run the scripts relative to that with

FILE_DIR=$(dirname "$(realpath "$0")")

"$FILE_DIR/some_other_script.sh"

export WASMER_BACKTRACE=1

# static tests
cargo fmt
Copy link
Contributor

Choose a reason for hiding this comment

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

does this not also need to be

Suggested change
cargo fmt
cargo fmt --check

Also, does doing it at the root level not do it for everything?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh yes it should be

and you'd think, but this project isn't one workspace. It's actually 2 workspaces and one standalone project. There's the root workspace that contains the host and common crates. Then the test workspace and a standalone guest crate. It drives me potty working on this repo because you can't easily verify changes. I don't think it was done for a reason except maybe to work around historical Cargo issues. I don't think there's an issue open for this, but I'll open one now

Copy link
Member Author

Choose a reason for hiding this comment

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

and not just this actually, we weren't denying warnings for Clippy... so we're just printing them in CI. That's helpful :D Sorted that out and fixed the lint issues that of course existed when we don't enforce them not going in

Copy link
Contributor

@cdunster cdunster left a comment

Choose a reason for hiding this comment

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

Small changelog suggestion.

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Callum Dunster <[email protected]>
@ThetaSinner ThetaSinner merged commit 52bf57d into develop Oct 31, 2024
13 checks passed
@ThetaSinner ThetaSinner deleted the add-wasmer-prod-compiler branch October 31, 2024 12:17
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.

4 participants