uutils / platform-info

A cross-platform way to get information about your machine
MIT License
85 stars 25 forks source link

Fails to build on Freebsd #39

Closed sylvestre closed 1 year ago

sylvestre commented 1 year ago

When trying to update the rust coreutils, it fails with:


      Checking fundu v0.5.1
  error[E0609]: no field `domainname` on type `libc::utsname`
     --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/platform-info-2.0.0/src/platform/unix.rs:121:84
      |
  121 |             debug_struct = debug_struct.field("domainname", &oss_from_cstr(&self.0.domainname));
      |                                                                                    ^^^^^^^^^^ unknown field
      |
      = note: available fields are: `sysname`, `nodename`, `release`, `version`, `machine`

  error[E0609]: no field `domainname` on type `libc::utsname`
     --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/platform-info-2.0.0/src/platform/unix.rs:146:38
      |
  146 |             equal = equal && (self.0.domainname == other.0.domainname)
      |                                      ^^^^^^^^^^ unknown field
      |
      = note: available fields are: `sysname`, `nodename`, `release`, `version`, `machine`

  error[E0609]: no field `domainname` on type `libc::utsname`
     --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/platform-info-2.0.0/src/platform/unix.rs:146:60
      |
  146 |             equal = equal && (self.0.domainname == other.0.domainname)
      |                                                            ^^^^^^^^^^ unknown field
      |

https://github.com/uutils/coreutils/actions/runs/5073973837/jobs/9113647713?pr=4897

cc @rivy

rivy commented 1 year ago

Yep, it looks like all BSD-like platforms are missing the domainname entry in libc::utsname. The only BSD-like OS that we're testing is MacOS, so I missed the broader picture. I'll update the cfg exclusion statements and push a fix tomorrow.