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

breaking(language.rust): Switch Rust builds to wasm32-wasip1 instead of wasm32-wasi #1382

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anthony-gomez-fastly
Copy link
Contributor

@anthony-gomez-fastly anthony-gomez-fastly commented Jan 28, 2025

Breaking change to support Rust 1.84 and newer

BREAKING CHANGE:
Only the wasm32-wasip1 build target is accepted if a non default config is provided

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  • Does your submission pass tests?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

Are there any considerations that need to be addressed for release?

this is a breaking change and will require a major version bump to prevent breakages

@anthony-gomez-fastly anthony-gomez-fastly force-pushed the CDTOOL-1004-support-rust-1.84 branch 6 times, most recently from 5283bcd to 97ea81b Compare January 29, 2025 20:45
@anthony-gomez-fastly anthony-gomez-fastly marked this pull request as ready for review January 29, 2025 20:45
Integralist
Integralist previously approved these changes Jan 30, 2025
@Integralist
Copy link
Collaborator

LGTM, and I've approved the PR but we'll need either @kpfleming or @philippschulte to handle merging this PR and the subsequent new major release.

philippschulte
philippschulte previously approved these changes Jan 30, 2025
Copy link
Member

@philippschulte philippschulte left a comment

Choose a reason for hiding this comment

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

This looks great! I compared your changes to what Kevin recommended in the ticket. We're not cutting a new release before this has been tested and approved by Kevin. I would recommend to build binaries and share it internally for testing.

pkg/commands/compute/language_rust.go Outdated Show resolved Hide resolved
.github/workflows/pr_test.yml Outdated Show resolved Hide resolved
Dockerfile-rust Outdated Show resolved Hide resolved
Dockerfile-rust Outdated Show resolved Hide resolved
pkg/commands/compute/language_rust.go Outdated Show resolved Hide resolved
pkg/commands/compute/language_rust.go Outdated Show resolved Hide resolved
@anthony-gomez-fastly anthony-gomez-fastly force-pushed the CDTOOL-1004-support-rust-1.84 branch 2 times, most recently from 3514cb3 to cca0fc1 Compare February 6, 2025 23:19
@kpfleming kpfleming changed the title refactor(language.rust): check wasmwasi target and return error if mismatched breaking(language.rust): Switch Rust builds to wasm32-wasip1 instead of wasm32-wasi Feb 7, 2025
@kpfleming
Copy link
Contributor

I updated the PR title to reflect the purpose of the change, since it will end up in the changelog.

pkg/commands/compute/language_rust.go Outdated Show resolved Hide resolved
pkg/commands/compute/language_rust.go Outdated Show resolved Hide resolved
@@ -144,12 +147,17 @@ func (r *Rust) Dependencies() map[string]string {

// Build compiles the user's source code into a Wasm binary.
func (r *Rust) Build() error {
var wasmWasiTarget = r.config.WasmWasiTarget
if wasmWasiTarget != RustWasmWasiTarget {
return fmt.Errorf("your .cargo/config.toml file is configured to produce a %s binary, but that is not supported. It must be configured to produce a %s binary", wasmWasiTarget, RustWasmWasiTarget)
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like I was mistaken here; the value r.config.WasmWasiTarget didn't come from .cargo/config.toml, but from ~/.config/fastly/config.toml (or the equivalent path on non-Linux systems). Please verify the behavior here, this error should be emitted when that file has the wrong value, not when .cargo/config.toml has the wrong value.

If this is true, we're going to need to add new checks to validate the content of .cargo/config.toml and rust-toolchain.toml as well.

@anthony-gomez-fastly anthony-gomez-fastly force-pushed the CDTOOL-1004-support-rust-1.84 branch 4 times, most recently from 78969e3 to 98b8839 Compare February 10, 2025 15:18
…m32-wasi

Breaking change to support Rust 1.84 and newer

BREAKING CHANGE:
Only the wasm32-waip1 build target is accepted if a non default config is provided
@anthony-gomez-fastly anthony-gomez-fastly force-pushed the CDTOOL-1004-support-rust-1.84 branch from 98b8839 to bf30e4d Compare February 10, 2025 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants