Skip to content

Build for Windows Has Errors #157

Open
@chrisherczeg

Description

@chrisherczeg

Looking at the Github Actions pipeline, it appears that build validation and testing is only done for Linux. Is the official platform only supported for Linux or is this a current gap in build validation?

After getting past openssl compiling issues for windows inside the cargo xtask precheckin by compiling openssl myself and setting the required environment variables, I am now facing

 Compiling caliptra-builder v0.1.0 (https://github.com/chipsalliance/caliptra-sw?rev=d12dbf5291e61a8ea81e969fa26b709480a8e5ea#d12dbf52)
error[E0432]: unresolved import `std::os::fd`
   --> C:\Users\chrisherczeg\.cargo\git\checkouts\caliptra-sw-5540699bb2674008\d12dbf5\builder\src\lib.rs:10:14
    |
10  | use std::os::fd::AsRawFd;
    |              ^^ could not find `fd` in `os`
    |
note: found an item that was configured out
   --> C:\Users\chrisherczeg\.rustup\toolchains\nightly-2024-10-01-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\std\src\os\mod.rs:164:9
    |
164 | pub mod fd;
    |         ^^
note: the item is gated here
   --> C:\Users\chrisherczeg\.rustup\toolchains\nightly-2024-10-01-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\std\src\os\mod.rs:163:1
    |
163 | #[cfg(any(unix, target_os = "hermit", target_os = "wasi", doc))]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0432]: unresolved import `nix::fcntl`
  --> C:\Users\chrisherczeg\.cargo\git\checkouts\caliptra-sw-5540699bb2674008\d12dbf5\builder\src\lib.rs:25:10
   |
25 | use nix::fcntl::FlockArg;
   |          ^^^^^ could not find `fcntl` in `nix`

error[E0433]: failed to resolve: could not find `fcntl` in `nix`
   --> C:\Users\chrisherczeg\.cargo\git\checkouts\caliptra-sw-5540699bb2674008\d12dbf5\builder\src\lib.rs:180:14
    |
180 |         nix::fcntl::flock(lock.as_raw_fd(), FlockArg::LockExclusive)?;
    |              ^^^^^ could not find `fcntl` in `nix`

error[E0599]: no method named `as_raw_fd` found for struct `File` in the current scope
   --> C:\Users\chrisherczeg\.cargo\git\checkouts\caliptra-sw-5540699bb2674008\d12dbf5\builder\src\lib.rs:180:32
    |
180 |         nix::fcntl::flock(lock.as_raw_fd(), FlockArg::LockExclusive)?;
    |                                ^^^^^^^^^
    |
help: there is a method `as_raw_handle` with a similar name
    |
180 |         nix::fcntl::flock(lock.as_raw_handle(), FlockArg::LockExclusive)?;

Which appears to be a UNIX only rust concept. Is there any way to resolve this? Is a Windows pipeline in the works / planned to prevent build breaks on Windows?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions