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

FreeBSD compilation error #268

Closed
hwchen opened this issue Feb 14, 2016 · 6 comments
Closed

FreeBSD compilation error #268

hwchen opened this issue Feb 14, 2016 · 6 comments

Comments

@hwchen
Copy link

hwchen commented Feb 14, 2016

Trying to compile basic-http-server on a Digital Ocean Droplet, FreeBSD 10.2.

   Compiling libc v0.2.4

...

   Compiling libc v0.1.12

...

   Compiling nix v0.4.2
/home/freebsd/.cargo/registry/src/github.com-88ac128001ac3a9a/nix-0.4.2/src/lib.rs:46:20: 46:28 error: unresolved import `libc::PATH_MAX`. There is no `PATH_MAX` in `libc` [E0432]
/home/freebsd/.cargo/registry/src/github.com-88ac128001ac3a9a/nix-0.4.2/src/lib.rs:46 use libc::{c_char, PATH_MAX};
                                                                                                         ^~~~~~~~
/home/freebsd/.cargo/registry/src/github.com-88ac128001ac3a9a/nix-0.4.2/src/lib.rs:46:20: 46:28 help: run `rustc --explain E0432` to see a detailed explanation
error: aborting due to previous error
Could not compile `nix`.
cargo 0.7.0 (built 2016-02-11)
rustc 1.5.0
@kamalmarhubi
Copy link
Member

Thanks for the report! I think if we make a release this will get fixed, as we've bumped the libc requirement to 0.2 in the meantime, which should have libc::PATH_MAX: https://github.com/rust-lang/libc/blob/a64ee24718c0289b82a77d692cf56f8a1226de51/src/unix/bsd/mod.rs#L113

Filed #269 re making a release.

@hwchen
Copy link
Author

hwchen commented Feb 15, 2016

Ah, that makes sense. Thanks!

On Sun, Feb 14, 2016 at 10:45 PM, Kamal Marhubi notifications@github.com
wrote:

Thanks for the report! I think if we make a release this will get
fixed, as we've bumped the libc requirement to 0.2 in the meantime, which
should have libc::PATH_MAX:
https://github.com/rust-lang/libc/blob/a64ee24718c0289b82a77d692cf56f8a1226de51/src/unix/bsd/mod.rs#L113

Filed #269 #269 re making a
release.


Reply to this email directly or view it on GitHub
#268 (comment).

@fourbytes
Copy link

Attempting to compile this on FreeBSD 10.3, I'm getting

root@fbytes-bsd-vm:~/nix # cargo build
    Updating registry `https://github.com/rust-lang/crates.io-index`
    Updating git repository `https://github.com/rust-lang/libc`
   Compiling cfg-if v0.1.0
   Compiling libc v0.2.15 (https://github.com/rust-lang/libc#20222659)
   Compiling void v1.0.2
   Compiling semver v0.1.20
   Compiling bitflags v0.4.0
   Compiling rustc_version v0.1.7
   Compiling nix v0.6.1-pre (file:///root/nix)
src/unistd.rs:188:47: 188:50 error: mismatched types:
 expected `i32`,
    found `usize` [E0308]
src/unistd.rs:188     let res = unsafe { libc::sethostname(ptr, len) };
                                                                ^~~
src/unistd.rs:188:47: 188:50 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to previous error
error: Could not compile `nix`.

To learn more, run the command again with --verbose.

Not sure if this belongs in another issue or not so posting here for now.

root@fbytes-bsd-vm:~/nix # rustc --version
rustc 1.9.0-nightly
root@fbytes-bsd-vm:~/nix # cargo --version
cargo 0.11.0-nightly (259324c 2016-05-20)
root@fbytes-bsd-vm:~/nix # uname -a
FreeBSD fbytes-bsd-vm 10.3-RELEASE FreeBSD 10.3-RELEASE #0 r297264: Fri Mar 25 02:10:02 UTC 2016     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

@fourbytes
Copy link

Looks like it's being sorted in #396

@beatgammit
Copy link

beatgammit commented Sep 6, 2016

This now works for me. I've built and run my code on FreeBSD 10.3-RELEASE that uses mio and the latest master works for me. Another has commented in the mio repository that it also works on 11-CURRENT, so I think FreeBSD compat is covered for now.

How do I request a release? Should I open a separate issue for making a release a la #269? I'm willing to test on OpenBSD if that's a blocker.

@Susurrus
Copy link
Contributor

Susurrus commented Jun 4, 2017

I believe this has been resolved as of release 0.8.1.

@Susurrus Susurrus closed this as completed Jun 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants