Skip to content
This repository was archived by the owner on Sep 19, 2026. It is now read-only.
This repository was archived by the owner on Sep 19, 2026. It is now read-only.

Need for use libc:: in master #420

Description

@finalyards

Bug description

Using esp-idf-sys via a GitHub link, to get 6.0.1 support, I noticed the following.

Build fails with a number of esp-idf-sys specific details (below).

I'll be making a PR for this - the fix is trivial - but wanted to ask first about your ideas/opinions.

To Reproduce

Unfortunately, no public repo (yet), no knowledge how to reproduce. But I'll attempt a fix in my fork and see it from there..

Expected behavior

I can use esp-idf-sys with both ESP-IDF 5.5.4 and 6.0.1.

Environment

Complex. :(

Attachment - build output

error[E0425]: cannot find value `MSG_DONTROUTE` in module `sys`
    --> /home/ubuntu/.cargo/git/checkouts/esp-idf-sys-1f365e3f54debd76/eaf69b2/src/checks/libc.rs:108:18
     |
  12 |                 sys::$ident as i64 == libc::$ident as i64,
     |                      ------ due to this macro variable
...
 108 | check_constants!(MSG_DONTROUTE);
     |                  ^^^^^^^^^^^^^
     |
    ::: /home/ubuntu/target/riscv32imac-esp-espidf/release/build/esp-idf-sys-4544fc084c88a572/out/bindings.rs:4719:1
     |
4719 | pub const SO_DONTROUTE: u32 = 16;
     | --------------------------------- similarly named constant `SO_DONTROUTE` defined here
     |
help: a constant with a similar name exists
     |
 108 - check_constants!(MSG_DONTROUTE);
 108 + check_constants!(SO_DONTROUTE);
     |
help: consider importing this constant
     |
   5 + use libc::MSG_DONTROUTE;
     |

error[E0425]: cannot find value `MSG_EOR` in module `sys`
    --> /home/ubuntu/.cargo/git/checkouts/esp-idf-sys-1f365e3f54debd76/eaf69b2/src/checks/libc.rs:114:18
     |
  12 |                 sys::$ident as i64 == libc::$ident as i64,
     |                      ------ due to this macro variable
...
 114 | check_constants!(MSG_EOR);
     |                  ^^^^^^^
     |
    ::: /home/ubuntu/target/riscv32imac-esp-espidf/release/build/esp-idf-sys-4544fc084c88a572/out/bindings.rs:4754:1
     |
4754 | pub const MSG_MORE: u32 = 16;
     | ----------------------------- similarly named constant `MSG_MORE` defined here
     |
help: a constant with a similar name exists
     |
 114 - check_constants!(MSG_EOR);
 114 + check_constants!(MSG_MORE);
     |
help: consider importing this constant
     |
   5 + use libc::MSG_EOR;
     |

error[E0425]: cannot find value `SOMAXCONN` in module `sys`
   --> /home/ubuntu/.cargo/git/checkouts/esp-idf-sys-1f365e3f54debd76/eaf69b2/src/checks/libc.rs:134:18
    |
 12 |                 sys::$ident as i64 == libc::$ident as i64,
    |                      ------ due to this macro variable
...
134 | check_constants!(SOMAXCONN);
    |                  ^^^^^^^^^ not found in `sys`
    |
help: consider importing this constant
    |
  5 + use libc::SOMAXCONN;
    |

error[E0425]: cannot find value `IPV6_UNICAST_HOPS` in module `sys`
    --> /home/ubuntu/.cargo/git/checkouts/esp-idf-sys-1f365e3f54debd76/eaf69b2/src/checks/libc.rs:432:18
     |
  12 |                 sys::$ident as i64 == libc::$ident as i64,
     |                      ------ due to this macro variable
...
 432 | check_constants!(IPV6_UNICAST_HOPS);
     |                  ^^^^^^^^^^^^^^^^^
     |
    ::: /home/ubuntu/target/riscv32imac-esp-espidf/release/build/esp-idf-sys-4544fc084c88a572/out/bindings.rs:3807:1
     |
3807 | pub const IPV6_MULTICAST_HOPS: u32 = 769;
     | ----------------------------------------- similarly named constant `IPV6_MULTICAST_HOPS` defined here
     |
help: a constant with a similar name exists
     |
 432 - check_constants!(IPV6_UNICAST_HOPS);
 432 + check_constants!(IPV6_MULTICAST_HOPS);
     |
help: consider importing this constant
     |
   5 + use libc::IPV6_UNICAST_HOPS;
     |

error[E0425]: cannot find value `NI_MAXHOST` in module `sys`
   --> /home/ubuntu/.cargo/git/checkouts/esp-idf-sys-1f365e3f54debd76/eaf69b2/src/checks/libc.rs:451:18
    |
 12 |                 sys::$ident as i64 == libc::$ident as i64,
    |                      ------ due to this macro variable
...
451 | check_constants!(NI_MAXHOST);
    |                  ^^^^^^^^^^ not found in `sys`
    |
help: consider importing this constant
    |
  5 + use libc::NI_MAXHOST;
    |

error[E0425]: cannot find value `NI_MAXSERV` in module `sys`
   --> /home/ubuntu/.cargo/git/checkouts/esp-idf-sys-1f365e3f54debd76/eaf69b2/src/checks/libc.rs:452:18
    |
 12 |                 sys::$ident as i64 == libc::$ident as i64,
    |                      ------ due to this macro variable
...
452 | check_constants!(NI_MAXSERV);
    |                  ^^^^^^^^^^ not found in `sys`
    |
help: consider importing this constant
    |
  5 + use libc::NI_MAXSERV;
    |

error[E0425]: cannot find value `NI_NUMERICSERV` in module `sys`
    --> /home/ubuntu/.cargo/git/checkouts/esp-idf-sys-1f365e3f54debd76/eaf69b2/src/checks/libc.rs:456:18
     |
  12 |                 sys::$ident as i64 == libc::$ident as i64,
     |                      ------ due to this macro variable
...
 456 | check_constants!(NI_NUMERICSERV);
     |                  ^^^^^^^^^^^^^^
     |
    ::: /home/ubuntu/target/riscv32imac-esp-espidf/release/build/esp-idf-sys-4544fc084c88a572/out/bindings.rs:4816:1
     |
4816 | pub const AI_NUMERICSERV: u32 = 8;
     | ---------------------------------- similarly named constant `AI_NUMERICSERV` defined here
     |
help: a constant with a similar name exists
     |
 456 - check_constants!(NI_NUMERICSERV);
 456 + check_constants!(AI_NUMERICSERV);
     |
help: consider importing this constant
     |
   5 + use libc::NI_NUMERICSERV;
     |

error[E0425]: cannot find value `NI_DGRAM` in module `sys`
   --> /home/ubuntu/.cargo/git/checkouts/esp-idf-sys-1f365e3f54debd76/eaf69b2/src/checks/libc.rs:457:18
    |
 12 |                 sys::$ident as i64 == libc::$ident as i64,
    |                      ------ due to this macro variable
...
457 | check_constants!(NI_DGRAM);
    |                  ^^^^^^^^ not found in `sys`
    |
help: consider importing this constant
    |
  5 + use libc::NI_DGRAM;
    |

For more information about this error, try `rustc --explain E0425`.
error: could not compile `esp-idf-sys` (lib) due to 8 previous errors

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions