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
- utmpx.rs: use correct constant names for musl libc Unfortunately, the name of those constants are not standardized: glibc uses __UT_HOSTSIZE, __UT_LINESIZE, __UT_NAMESIZE musl uses UT_HOSTSIZE, UT_LI... — committed to Ecordonnier/coreutils by Ecordonnier 2 years ago
- utmpx.rs: use correct constant names for musl libc Unfortunately, the name of those constants are not standardized: glibc uses __UT_HOSTSIZE, __UT_LINESIZE, __UT_NAMESIZE musl uses UT_HOSTSIZE, UT_LI... — committed to Ecordonnier/coreutils by Ecordonnier 2 years ago
- utmpx.rs: use correct constant names for musl libc Unfortunately, the name of those constants are not standardized: glibc uses __UT_HOSTSIZE, __UT_LINESIZE, __UT_NAMESIZE musl uses UT_HOSTSIZE, UT_LI... — committed to sylvestre/coreutils by Ecordonnier 2 years ago
- enable utmpx feature for musl musl provides stubs of those functions, so let's enable the feature so that it can compile with musl. Note that those stubs always return a success exit value, and comma... — committed to Ecordonnier/coreutils by Ecordonnier 2 years ago
- enable utmpx feature for musl musl provides stubs of those functions, and those stubs are available in the libc crate version 0.2.172. Thus let's enable the feature so that it can compile with musl. ... — committed to Ecordonnier/coreutils by Ecordonnier 2 years ago
- enable utmpx feature for musl musl provides stubs of those functions, and those stubs are available in the libc crate version 0.2.172. Thus let's enable the feature so that it can compile with musl. ... — committed to Ecordonnier/coreutils by Ecordonnier 2 years ago
- enable utmpx feature for musl musl provides stubs of those functions, and those stubs are available in the libc crate version 0.2.172. Thus let's enable the feature so that it can compile with musl. ... — committed to Ecordonnier/coreutils by Ecordonnier 2 years ago
- enable utmpx feature for musl bump libc to 0.2.172 musl provides stubs of utmpx functions, and those stubs are available in the libc crate version 0.2.172. Thus let's enable the feature so that it c... — committed to Ecordonnier/coreutils by Ecordonnier 2 years ago
- enable utmpx feature for musl bump libc to 0.2.172 musl provides stubs of utmpx functions, and those stubs are available in the libc crate version 0.2.172. Thus let's enable the feature so that it c... — committed to Ecordonnier/coreutils by Ecordonnier 2 years ago
- enable utmpx feature for musl bump libc to 0.2.172 musl provides stubs of utmpx functions, and those stubs are available in the libc crate version 0.2.172. Thus let's enable the feature so that it c... — committed to Ecordonnier/coreutils by Ecordonnier 2 years ago
- utmpx: silence musl warnings Fixes https://github.com/uutils/coreutils/issues/7865 We are intentionally calling the stub utmpx functions of musl, in order to achieve behavior parity with GNU coreuti... — committed to Ecordonnier/coreutils by Ecordonnier a year ago
- utmpx: silence musl warnings Fixes https://github.com/uutils/coreutils/issues/7865 We are intentionally calling the stub utmpx functions of musl, in order to achieve behavior parity with GNU coreuti... — committed to Ecordonnier/coreutils by Ecordonnier a year ago
- utmpx: silence musl warnings Fixes https://github.com/uutils/coreutils/issues/7865 We are intentionally calling the stub utmpx functions of musl, in order to achieve behavior parity with GNU coreuti... — committed to sylvestre/coreutils by Ecordonnier a year ago
- enable utmpx feature for musl bump libc to 0.2.172 musl provides stubs of utmpx functions, and those stubs are available in the libc crate version 0.2.172. Thus let's enable the feature so that it c... — committed to nickorlow/coreutils by Ecordonnier 2 years ago
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.