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

build test - ignore #3354

Closed
wants to merge 28 commits into from
Closed

build test - ignore #3354

wants to merge 28 commits into from

Conversation

kennykerr
Copy link
Collaborator

This is a smoke test of the next major version of the windows-bindgen crate - this PR is just for validation and will be closed - look for a subsequent PR with a complete description of new features and changes.

@kennykerr
Copy link
Collaborator Author

Hey @ChrisDenton I added some panic tests to the latest version of windows-bindgen and I'm noticing that std::fs::create_dir_all and std::fs::write sometimes fail silently. Might I be missing something?

https://github.com/microsoft/windows-rs/actions/runs/12060811636/job/33631839763?pr=3354

Both tests that fail to fail.. are not failing inside write_to_file here:

https://github.com/microsoft/windows-rs/blob/vnext/crates/libs/bindgen/src/io.rs

@ChrisDenton
Copy link
Collaborator

ChrisDenton commented Nov 28, 2024

Hm, I've not looked at it closely yet but could that function actually be properly succeeding in CI? Because it's running with admin permissions it could succeed writing in windir.

@kennykerr
Copy link
Collaborator Author

Is it? I also noticed it silently failing locally with the i686 toolchain although sporadically.

@kennykerr
Copy link
Collaborator Author

I'll confirm one way or the other.

@ChrisDenton
Copy link
Collaborator

Quick thought: i686 might be affected by wow64 path redirection.

@ChrisDenton
Copy link
Collaborator

Quick test

pub fn write_to_file<C: AsRef<[u8]>>(path: &str, contents: C) {
    if let Some(parent) = std::path::Path::new(path).parent() {
        std::fs::create_dir_all(parent)
            .unwrap_or_else(|_| panic!("failed to create directory `{path}`"));
    }
    std::fs::write(path, contents).unwrap_or_else(|_| panic!("failed to write file `{path}`"));

    // print the canonical path
    let p = std::fs::canonicalize(path).unwrap();
    println!("{}", p.display());
}

For i686 it outputs: \\?\C:\Users\Chris\AppData\Local\VirtualStore\Windows\output.log

@kennykerr
Copy link
Collaborator Author

OK I'll find a more reliable failure path. 🫠

@kennykerr
Copy link
Collaborator Author

ok everything is green except for the lib tests 👍

@kennykerr kennykerr closed this Nov 29, 2024
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.

2 participants