Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to build 0.21.1 on NetBSD #625

Closed
0323pin opened this issue Dec 8, 2021 · 15 comments
Closed

Fail to build 0.21.1 on NetBSD #625

0323pin opened this issue Dec 8, 2021 · 15 comments

Comments

@0323pin
Copy link

0323pin commented Dec 8, 2021

Hi,

I've been maintaning nushell for NetBSD and using it myself from 0.34.0 through to 0.40.0 but, now I can not build 0.41.0 since, sysinfo fails to build which is rather unfortunate.

Here's the error, as reported on nushell, nushell/nushell#4191

error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
  --> /usr/pkgsrc/wip/nushell/work/vendor/sysinfo-0.21.1/src/unknown/process.rs:11:6
   |
11 | impl fmt::Display for ProcessStatus {
   |      ^^^ use of undeclared crate or module `fmt`

error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
  --> /usr/pkgsrc/wip/nushell/work/vendor/sysinfo-0.21.1/src/unknown/process.rs:12:27
   |
12 |     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
   |                           ^^^ use of undeclared crate or module `fmt`

error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
  --> /usr/pkgsrc/wip/nushell/work/vendor/sysinfo-0.21.1/src/unknown/process.rs:12:46
   |
12 |     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
   |                                              ^^^ use of undeclared crate or module `fmt`

error[E0412]: cannot find type `ProcessStatus` in this scope
  --> /usr/pkgsrc/wip/nushell/work/vendor/sysinfo-0.21.1/src/unknown/process.rs:11:23
   |
11 | impl fmt::Display for ProcessStatus {
   |                       ^^^^^^^^^^^^^ not found in this scope
   |
help: consider importing this enum
   |
7  | use crate::ProcessStatus;
   |

error[E0412]: cannot find type `ProcessStatus` in this scope
  --> /usr/pkgsrc/wip/nushell/work/vendor/sysinfo-0.21.1/src/unknown/process.rs:73:25
   |
73 |     fn status(&self) -> ProcessStatus {
   |                         ^^^^^^^^^^^^^ not found in this scope
   |
help: consider importing this enum
   |
7  | use crate::ProcessStatus;
   |

error[E0433]: failed to resolve: use of undeclared type `ProcessStatus`
  --> /usr/pkgsrc/wip/nushell/work/vendor/sysinfo-0.21.1/src/unknown/process.rs:74:9
   |
74 |         ProcessStatus::Unknown(0)
   |         ^^^^^^^^^^^^^ not found in this scope
   |
help: consider importing this enum
   |
7  | use crate::ProcessStatus;
   |

Some errors have detailed explanations: E0412, E0433.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `sysinfo` due to 6 previous errors

Anything which can be done about it?
I would really like to have sysinfo support improved for NetBSD and it's something I've been wondering how to help. Unfortunately, it feels over my skills to do something like this but, if you have some guidance to provide, I'd be happy to help.

@GuillaumeGomez
Copy link
Owner

The support for freebsd is done. I'm waiting for a libc's new release. You can see the PR here.

As for NetBSD, even if not supported, it should compile, so I'm a bit surprised. I can make a fix release if you want?

@0323pin
Copy link
Author

0323pin commented Dec 8, 2021

The support for freebsd is done...
As for NetBSD, even if not supported, it should compile, so I'm a bit surprised. I can make a fix release if you want?

That would be awesome but, I'd need to patch nushell to use this new release. As I wrote on the issue on nushell, I could also patch it to use sysinfo-0.20.4, which I know it builds.

What I would like to have is sysinfo support on pair with FreeBSD and Linux but, I'm unsure to what is needed to achieve this. Is this something that is doable if we work together?

@GuillaumeGomez
Copy link
Owner

GuillaumeGomez commented Dec 8, 2021

I think the implementation would be very close to what I did for freebsd. The biggest issue being that you need to add all FFI items into libc because I don't want to support them internally. Another big problem (and I think the biggest one) would be to find a CI which supports NetBSD.

@0323pin
Copy link
Author

0323pin commented Dec 8, 2021

@GuillaumeGomez I've been working closely with macchina dev in order to have full NetBSD support. They have NetBSD builds running and provide pre-compiled binaries, https://github.com/Macchina-CLI/macchina

Please let me know if I can somehow help with this.

@0323pin
Copy link
Author

0323pin commented Dec 8, 2021

@GuillaumeGomez In the meantime, if you can please provide a fix to the error on the coming releases of sysinfo.
I've just kicked started a build of nushell with a patch for this particular release.

Thanks!
Still, if I can help somehow let me know.

@GuillaumeGomez
Copy link
Owner

macchina only seem to cross-compile from what I can see in the CI. I need to run tests as well, not just build.

@0323pin
Copy link
Author

0323pin commented Dec 8, 2021

How often would you need to run tests? For every commit, once a week?

@GuillaumeGomez
Copy link
Owner

For every PR, so not very often. But still needs it to be fully automatic and reliable.

As for the 0.21 fix, it's in progress: #627 (need to cherry-pick things).

@0323pin
Copy link
Author

0323pin commented Dec 8, 2021

As for the 0.21 fix, it's in progress: #627 (need to cherry-pick things).

Awesome, thanks!

For every PR, so not very often. But still needs it to be fully automatic and reliable.

I could offer to build on my machine and report back, although it will only cover x86_64

@0323pin
Copy link
Author

0323pin commented Dec 8, 2021

Would this do it?
https://github.com/madworx/docker-netbsd

@GuillaumeGomez
Copy link
Owner

Would this do it? https://github.com/madworx/docker-netbsd

I guess it would. If you can set it up in github actions, then I can add it and work on supporting netbsd next (but it'll very likely take minimum weeks if not months because updates in libc can take some time).

@0323pin
Copy link
Author

0323pin commented Dec 8, 2021

If you can set it up in github actions,

I have no clue on how to do this, unfortunately.

@GuillaumeGomez
Copy link
Owner

GuillaumeGomez commented Dec 8, 2021

I'll try to take a look later on. In the meantime, can you open an issue specifically for NetBSD support please? We're a bit out of context topic here. ;)

@GuillaumeGomez
Copy link
Owner

Fixed by #627.

I published the 0.21.2 version as well.

@0323pin
Copy link
Author

0323pin commented Dec 8, 2021

I published the 0.21.2 version as well.

Thank you.

can you open an issue specifically for NetBSD support please?

Yes, I'll do it later today or early tomorrow. Going to kick a build of rust-1.57 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants