[GH-ISSUE #573] cargo install error on Alpine -- nix related? #183

Closed
opened 2026-05-22 21:51:37 +01:00 by JakeStanger · 5 comments
Owner

Originally created by @moranbw on GitHub (May 6, 2024).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/573

When running cargo install ironbar on my machine, I got this error:

   Compiling ironbar v0.15.1
error[E0432]: unresolved import `nix::fcntl::OFlag`
 --> /home/brian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ironbar-0.15.1/src/clients/wayland/wlr_data_control/offer.rs:3:5
  |
3 | use nix::fcntl::OFlag;
  |     ^^^^^^^^^^^^^^^^^ no `OFlag` in `fcntl`

error[E0432]: unresolved import `nix::unistd::pipe2`
    --> /home/brian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ironbar-0.15.1/src/clients/wayland/wlr_data_control/offer.rs:4:26
     |
4    | use nix::unistd::{close, pipe2};
     |                          ^^^^^
     |                          |
     |                          no `pipe2` in `unistd`
     |                          help: a similar name exists in the module: `pipe`
     |
note: found an item that was configured out
    --> /home/brian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nix-0.27.1/src/unistd.rs:1233:8
     |
1233 | pub fn pipe2(flags: OFlag) -> Result<(RawFd, RawFd)> {
     |        ^^^^^
     = note: the item is gated behind the `fs` feature

error[E0432]: unresolved imports `nix::fcntl::fcntl`, `nix::fcntl::F_GETPIPE_SZ`, `nix::fcntl::F_SETPIPE_SZ`
   --> /home/brian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ironbar-0.15.1/src/clients/wayland/wlr_data_control/mod.rs:13:18
    |
13  | use nix::fcntl::{fcntl, F_GETPIPE_SZ, F_SETPIPE_SZ};
    |                  ^^^^^  ^^^^^^^^^^^^  ^^^^^^^^^^^^ no `F_SETPIPE_SZ` in `fcntl`
    |                  |      |
    |                  |      no `F_GETPIPE_SZ` in `fcntl`
    |                  no `fcntl` in `fcntl`
    |
    = help: consider importing this module instead:
            nix::fcntl
note: found an item that was configured out
   --> /home/brian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nix-0.27.1/src/fcntl.rs:509:8
    |
509 | pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result<c_int> {
    |        ^^^^^
    = note: the item is gated behind the `fs` feature

For more information about this error, try `rustc --explain E0432`.
error: could not compile `ironbar` (bin "ironbar") due to 3 previous errors
error: failed to compile `ironbar v0.15.1`, intermediate artifacts can be found at `/tmp/cargo-installgmhXjZ`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

I then proceeded to clone the repo and build directly (cargo build --release), and it worked! I am using Alpine Linux, so not sure if there is some weirdness going on there. But just wanted to bring it to your attention. Looking forward to playing with the bar.

System information:

  • Distro: Alpine Linux Edge
  • Compositor: labwc
  • Ironbar version: 0.15.1
Originally created by @moranbw on GitHub (May 6, 2024). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/573 When running `cargo install ironbar` on my machine, I got this error: ``` Compiling ironbar v0.15.1 error[E0432]: unresolved import `nix::fcntl::OFlag` --> /home/brian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ironbar-0.15.1/src/clients/wayland/wlr_data_control/offer.rs:3:5 | 3 | use nix::fcntl::OFlag; | ^^^^^^^^^^^^^^^^^ no `OFlag` in `fcntl` error[E0432]: unresolved import `nix::unistd::pipe2` --> /home/brian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ironbar-0.15.1/src/clients/wayland/wlr_data_control/offer.rs:4:26 | 4 | use nix::unistd::{close, pipe2}; | ^^^^^ | | | no `pipe2` in `unistd` | help: a similar name exists in the module: `pipe` | note: found an item that was configured out --> /home/brian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nix-0.27.1/src/unistd.rs:1233:8 | 1233 | pub fn pipe2(flags: OFlag) -> Result<(RawFd, RawFd)> { | ^^^^^ = note: the item is gated behind the `fs` feature error[E0432]: unresolved imports `nix::fcntl::fcntl`, `nix::fcntl::F_GETPIPE_SZ`, `nix::fcntl::F_SETPIPE_SZ` --> /home/brian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ironbar-0.15.1/src/clients/wayland/wlr_data_control/mod.rs:13:18 | 13 | use nix::fcntl::{fcntl, F_GETPIPE_SZ, F_SETPIPE_SZ}; | ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ no `F_SETPIPE_SZ` in `fcntl` | | | | | no `F_GETPIPE_SZ` in `fcntl` | no `fcntl` in `fcntl` | = help: consider importing this module instead: nix::fcntl note: found an item that was configured out --> /home/brian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nix-0.27.1/src/fcntl.rs:509:8 | 509 | pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result<c_int> { | ^^^^^ = note: the item is gated behind the `fs` feature For more information about this error, try `rustc --explain E0432`. error: could not compile `ironbar` (bin "ironbar") due to 3 previous errors error: failed to compile `ironbar v0.15.1`, intermediate artifacts can be found at `/tmp/cargo-installgmhXjZ`. To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path. ``` I then proceeded to clone the repo and build directly (`cargo build --release`), and it worked! I am using Alpine Linux, so not sure if there is some weirdness going on there. But just wanted to bring it to your attention. Looking forward to playing with the bar. **System information:** - Distro: Alpine Linux Edge - Compositor: labwc - Ironbar version: 0.15.1
JakeStanger 2026-05-22 21:51:37 +01:00
  • closed this issue
  • added the
    T:Bug
    label
Author
Owner

@JakeStanger commented on GitHub (May 7, 2024):

Hey, the nix crate refers to *nix rather than Nix(OS). Under the hood it binds to the platform's libc library.

Am I right in thinking alpine uses musl rather than glibc? That might be the cause here, although I've no idea why it'd work installing it one way and not the other when it's compiling on your system either way.

<!-- gh-comment-id:2097753068 --> @JakeStanger commented on GitHub (May 7, 2024): Hey, the `nix` crate refers to *nix rather than Nix(OS). Under the hood it binds to the platform's libc library. Am I right in thinking alpine uses musl rather than glibc? That might be the cause here, although I've no idea why it'd work installing it one way and not the other when it's compiling on your system either way.
Author
Owner

@rgilton commented on GitHub (May 18, 2024):

I see the same errors when trying to build on Fedora 40. Building with rust 1.78.0.

<!-- gh-comment-id:2118995002 --> @rgilton commented on GitHub (May 18, 2024): I see the same errors when trying to build on Fedora 40. Building with rust 1.78.0.
Author
Owner

@JakeStanger commented on GitHub (May 18, 2024):

Well I guess that rules out musl then. I've just tried in a Fedora docker container from blank and it built fine, so not sure what's going on there.

I'll have a poke around in the nix crate and see if I can see any reason that fs feature flag would get turned off.

<!-- gh-comment-id:2118996543 --> @JakeStanger commented on GitHub (May 18, 2024): Well I guess that rules out musl then. I've just tried in a Fedora docker container from blank and it built fine, so not sure what's going on there. I'll have a poke around in the nix crate and see if I can see any reason that `fs` feature flag would get turned off.
Author
Owner

@JakeStanger commented on GitHub (May 18, 2024):

For some reason Rust is resolving a newer version of the nix crate than what was in the lockfile for you guys, which had breaking changes. I've updated to the latest version in the above PR which also fixes the breaking changes, so this should be resolved once that's merged.

<!-- gh-comment-id:2119001571 --> @JakeStanger commented on GitHub (May 18, 2024): For some reason Rust is resolving a newer version of the `nix` crate than what was in the lockfile for you guys, which had breaking changes. I've updated to the latest version in the above PR which also fixes the breaking changes, so this should be resolved once that's merged.
Author
Owner

@JimitSoni18 commented on GitHub (Jun 9, 2024):

still facing the issue when installing using cargo:
cargo install ironbar
error[E0432]: unresolved import nix::fcntl::OFlag
--> /home/jimit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ironbar-0.15.1/src/clients/wayland/wlr_data_control/offer.rs:3:5
|
3 | use nix::fcntl::OFlag;
| ^^^^^^^^^^^^^^^^^ no OFlag in fcntl

error[E0432]: unresolved import nix::unistd::pipe2
--> /home/jimit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ironbar-0.15.1/src/clients/wayland/wlr_data_control/offer.rs:4:26
|
4 | use nix::unistd::{close, pipe2};
| ^^^^^
| |
| no pipe2 in unistd
| help: a similar name exists in the module: pipe
|
note: found an item that was configured out
--> /home/jimit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nix-0.27.1/src/unistd.rs:1233:8
|
1233 | pub fn pipe2(flags: OFlag) -> Result<(RawFd, RawFd)> {
| ^^^^^
= note: the item is gated behind the fs feature

error[E0432]: unresolved imports nix::fcntl::fcntl, nix::fcntl::F_GETPIPE_SZ, nix::fcntl::F_SETPIPE_SZ
--> /home/jimit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ironbar-0.15.1/src/clients/wayland/wlr_data_control/mod.rs:13:18
|
13 | use nix::fcntl::{fcntl, F_GETPIPE_SZ, F_SETPIPE_SZ};
| ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ no F_SETPIPE_SZ in fcntl
| | |
| | no F_GETPIPE_SZ in fcntl
| no fcntl in fcntl
|
= help: consider importing this module instead:
nix::fcntl
note: found an item that was configured out
--> /home/jimit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nix-0.27.1/src/fcntl.rs:509:8
|
509 | pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result<c_int> {
| ^^^^^
= note: the item is gated behind the fs feature

error[E0308]: mismatched types
--> /home/jimit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ironbar-0.15.1/src/clients/compositor/hyprland.rs:156:51
|
156 | let name = get_workspace_name(workspace_type);
| ------------------ ^^^^^^^^^^^^^^ expected WorkspaceType, found WorkspaceDestroyedEventData
| |
| arguments to this function are incorrect
|
note: function defined here
--> /home/jimit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ironbar-0.15.1/src/clients/compositor/hyprland.rs:247:4
|
247 | fn get_workspace_name(name: WorkspaceType) -> String {
| ^^^^^^^^^^^^^^^^^^ -------------------

Some errors have detailed explanations: E0308, E0432.
For more information about an error, try rustc --explain E0308.
error: could not compile ironbar (bin "ironbar") due to 4 previous errors
error: failed to compile ironbar v0.15.1, intermediate artifacts can be found at /tmp/cargo-installpCyxrB.
To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR to that path.

<!-- gh-comment-id:2156387537 --> @JimitSoni18 commented on GitHub (Jun 9, 2024): still facing the issue when installing using cargo: cargo install ironbar error[E0432]: unresolved import `nix::fcntl::OFlag` --> /home/jimit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ironbar-0.15.1/src/clients/wayland/wlr_data_control/offer.rs:3:5 | 3 | use nix::fcntl::OFlag; | ^^^^^^^^^^^^^^^^^ no `OFlag` in `fcntl` error[E0432]: unresolved import `nix::unistd::pipe2` --> /home/jimit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ironbar-0.15.1/src/clients/wayland/wlr_data_control/offer.rs:4:26 | 4 | use nix::unistd::{close, pipe2}; | ^^^^^ | | | no `pipe2` in `unistd` | help: a similar name exists in the module: `pipe` | note: found an item that was configured out --> /home/jimit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nix-0.27.1/src/unistd.rs:1233:8 | 1233 | pub fn pipe2(flags: OFlag) -> Result<(RawFd, RawFd)> { | ^^^^^ = note: the item is gated behind the `fs` feature error[E0432]: unresolved imports `nix::fcntl::fcntl`, `nix::fcntl::F_GETPIPE_SZ`, `nix::fcntl::F_SETPIPE_SZ` --> /home/jimit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ironbar-0.15.1/src/clients/wayland/wlr_data_control/mod.rs:13:18 | 13 | use nix::fcntl::{fcntl, F_GETPIPE_SZ, F_SETPIPE_SZ}; | ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ no `F_SETPIPE_SZ` in `fcntl` | | | | | no `F_GETPIPE_SZ` in `fcntl` | no `fcntl` in `fcntl` | = help: consider importing this module instead: nix::fcntl note: found an item that was configured out --> /home/jimit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nix-0.27.1/src/fcntl.rs:509:8 | 509 | pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result<c_int> { | ^^^^^ = note: the item is gated behind the `fs` feature error[E0308]: mismatched types --> /home/jimit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ironbar-0.15.1/src/clients/compositor/hyprland.rs:156:51 | 156 | let name = get_workspace_name(workspace_type); | ------------------ ^^^^^^^^^^^^^^ expected `WorkspaceType`, found `WorkspaceDestroyedEventData` | | | arguments to this function are incorrect | note: function defined here --> /home/jimit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ironbar-0.15.1/src/clients/compositor/hyprland.rs:247:4 | 247 | fn get_workspace_name(name: WorkspaceType) -> String { | ^^^^^^^^^^^^^^^^^^ ------------------- Some errors have detailed explanations: E0308, E0432. For more information about an error, try `rustc --explain E0308`. error: could not compile `ironbar` (bin "ironbar") due to 4 previous errors error: failed to compile `ironbar v0.15.1`, intermediate artifacts can be found at `/tmp/cargo-installpCyxrB`. To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#183
No description provided.