Skip to content

Conversation

@Stebalien
Copy link
Owner

No description provided.

@Stebalien Stebalien force-pushed the steb/test-wasi-stable branch 5 times, most recently from 1ecbcab to ea28c4c Compare September 23, 2025 05:55
@Stebalien
Copy link
Owner Author

It appears that we still need the wasip2 feature for:

https://github.com/bytecodealliance/rustix/blob/5245b8160d53a04c37164779cfb11d35e18f55b3/src/path/arg.rs#L350-L388

Otherwise, we can't use rustix's rename with a Path.

@Stebalien
Copy link
Owner Author

I think we can just use https://doc.rust-lang.org/std/ffi/struct.OsStr.html#method.as_encoded_bytes on wasip2, but I'm going to see if I can get upstream rustix to do it.

@xangelix
Copy link

xangelix commented Dec 5, 2025

I realize Path -> str -> Path is not exactly safe but a temporary workaround for wasip2 could be just:

    let old_path_str = old_path.to_str().ok_or(io::Error::new(
        io::ErrorKind::InvalidInput,
        "path not utf-8",
    ))?;
    let new_path_str = new_path.to_str().ok_or(io::Error::new(
        io::ErrorKind::InvalidInput,
        "path not utf-8",
    ))?;

then just pass the Strings instead:

        rename(old_path_str, new_path_str)?;
        let _ = unlink(old_path_str);

@Stebalien
Copy link
Owner Author

Yep! But the fix has already been merged upstream so I'd rather wait for a release. I'll open an issue there.

@Stebalien Stebalien force-pushed the steb/test-wasi-stable branch from ea28c4c to ec2c8cf Compare December 23, 2025 22:12
@Stebalien Stebalien changed the title ci: test wasi on rust stable Support WASIp2 on stable rust Dec 23, 2025
@Stebalien Stebalien force-pushed the steb/test-wasi-stable branch from ec2c8cf to cbd38f0 Compare December 23, 2025 22:29
@Stebalien Stebalien force-pushed the steb/test-wasi-stable branch from cbd38f0 to 0564dd1 Compare December 23, 2025 22:31
@Stebalien Stebalien merged commit a8dc864 into master Dec 23, 2025
18 checks passed
@Stebalien Stebalien deleted the steb/test-wasi-stable branch December 23, 2025 22:39
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.

3 participants