coreutils: problem building some programs on musl

cabulertion. i had problem while building uutils on musl namely i am getting errors :

error[E0432]: unresolved import `libc::utmpx`
  --> src/uucore/utmpx.rs:44:5
   |
44 | use libc::utmpx;
   |     ^^^^^^^^^^^ no `utmpx` in the root

error[E0432]: unresolved import `libc::getutxent`
  --> src/uucore/utmpx.rs:48:9
   |
48 | pub use libc::getutxent;
   |         ^^^^^^---------
   |         |     |
   |         |     help: a similar name exists in the module: `getgrent`
   |         no `getutxent` in the root

error[E0432]: unresolved import `libc::setutxent`
  --> src/uucore/utmpx.rs:49:9
   |
49 | pub use libc::setutxent;
   |         ^^^^^^---------
   |         |     |
   |         |     help: a similar name exists in the module: `setgrent`
   |         no `setutxent` in the root

error[E0432]: unresolved import `libc::endutxent`
  --> src/uucore/utmpx.rs:50:9
   |
50 | pub use libc::endutxent;
   |         ^^^^^^---------
   |         |     |
   |         |     help: a similar name exists in the module: `endmntent`
   |         no `endutxent` in the root

error[E0432]: unresolved import `libc::utmpxname`
  --> src/uucore/utmpx.rs:52:9
   |
52 | pub use libc::utmpxname;
   |         ^^^^^^---------
   |         |     |
   |         |     help: a similar name exists in the module: `tmpnam`
   |         no `utmpxname` in the root

error[E0432]: unresolved import `libc::__UT_LINESIZE`
  --> src/uucore/utmpx.rs:69:13
   |
69 |     pub use libc::__UT_LINESIZE as UT_LINESIZE;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `__UT_LINESIZE` in the root

error[E0432]: unresolved import `libc::__UT_NAMESIZE`

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 15 (14 by maintainers)

Commits related to this issue

Most upvoted comments

The required functions were added to libc ( https://github.com/rust-lang/libc/commit/e3caaf6b0ea08ae294e25a861022c256a7535ec4 ), however those changes will be available via cargo only once libc 0.3 is released ( https://github.com/rust-lang/libc/issues/3248 ). The main branch of libc is now used for the development of 0.3, and the version 0.2 is developed on the branch libc-0.2 (and hence the libc release 0.2.152 does NOT contain e3caaf6b0ea08a ). The release of libc 0.3 is tracked at https://github.com/rust-lang/libc/issues/3248 (it will probably take a while).

Edit May 2024: The status is still the same. libc version 1.0 will be needed in order to fix this, and this will probably take at least several months: https://github.com/rust-lang/libc/issues/3248

As far as I understand, the issue is almost the same. This ticket was worked-around with this commit , so now instead of uucore failing and producing the logs in this ticket, the utilities which depend on uucore’s utmpx functionality are failing when building for musl. The proper long-term fix is to implement the functionality on libc’s side, which I’ll try to work on.