{"action":"created","issue":{"url":"https://api.github.com/repos/nix-rust/nix/issues/607","repository_url":"https://api.github.com/repos/nix-rust/nix","labels_url":"https://api.github.com/repos/nix-rust/nix/issues/607/labels{/name}","comments_url":"https://api.github.com/repos/nix-rust/nix/issues/607/comments","events_url":"https://api.github.com/repos/nix-rust/nix/issues/607/events","html_url":"https://github.com/nix-rust/nix/issues/607","id":231374590,"number":607,"title":"Enable utsname on MacOS","user":{"login":"zsck","id":682761,"avatar_url":"https://avatars1.githubusercontent.com/u/682761?v=3","gravatar_id":"","url":"https://api.github.com/users/zsck","html_url":"https://github.com/zsck","followers_url":"https://api.github.com/users/zsck/followers","following_url":"https://api.github.com/users/zsck/following{/other_user}","gists_url":"https://api.github.com/users/zsck/gists{/gist_id}","starred_url":"https://api.github.com/users/zsck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsck/subscriptions","organizations_url":"https://api.github.com/users/zsck/orgs","repos_url":"https://api.github.com/users/zsck/repos","events_url":"https://api.github.com/users/zsck/events{/privacy}","received_events_url":"https://api.github.com/users/zsck/received_events","type":"User","site_admin":false},"labels":[{"id":345584182,"url":"https://api.github.com/repos/nix-rust/nix/labels/A-features","name":"A-features","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-05-25T15:33:40Z","updated_at":"2017-05-25T16:37:32Z","closed_at":null,"body":"I'm doing a really quick experiment to try to invoke the `uname` function on macOS. Following [the documentation](https://docs.rs/nix/0.8.1/nix/sys/utsname/fn.uname.html), I wrote the code below.\r\n\r\n```rust\r\nextern crate nix;\r\n\r\nfn main() {\r\n    println!(\"Hello, world!\");\r\n    let name = nix::sys::utsname::uname();\r\n    println!(\"\r\n      sysname = {}\r\n      nodename = {}\r\n      release = {}\r\n      version = {}\r\n      machine = {}\r\n    \", name.sysname(), name.nodename(), name.release(), name.version(), name.machine());\r\n}\r\n```\r\n\r\nMy `Cargo.toml` file points to version 0.8.1 of `nix` as a dependency.  When I try to compile this program with `cargo build` I get the following error:\r\n\r\n```\r\nerror[E0433]: failed to resolve. Could not find `utsname` in `sys`\r\n --> src/main.rs:5:16\r\n  |\r\n5 |     let name = nix::sys::utsname::uname();\r\n  |                ^^^^^^^^^^^^^^^^^^^^^^^^ Could not find `utsname` in `sys`\r\n```\r\n\r\nI'm running this on macOS 10.12.4 with rustc 1.17.0."},"comment":{"url":"https://api.github.com/repos/nix-rust/nix/issues/comments/304057725","html_url":"https://github.com/nix-rust/nix/issues/607#issuecomment-304057725","issue_url":"https://api.github.com/repos/nix-rust/nix/issues/607","id":304057725,"user":{"login":"zsck","id":682761,"avatar_url":"https://avatars1.githubusercontent.com/u/682761?v=3","gravatar_id":"","url":"https://api.github.com/users/zsck","html_url":"https://github.com/zsck","followers_url":"https://api.github.com/users/zsck/followers","following_url":"https://api.github.com/users/zsck/following{/other_user}","gists_url":"https://api.github.com/users/zsck/gists{/gist_id}","starred_url":"https://api.github.com/users/zsck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsck/subscriptions","organizations_url":"https://api.github.com/users/zsck/orgs","repos_url":"https://api.github.com/users/zsck/repos","events_url":"https://api.github.com/users/zsck/events{/privacy}","received_events_url":"https://api.github.com/users/zsck/received_events","type":"User","site_admin":false},"created_at":"2017-05-25T16:37:32Z","updated_at":"2017-05-25T16:37:32Z","body":"I modified `src/sys/mod.rs` to export `utsname` on macOS like so:\r\n\r\n```rust\r\n#[cfg(any(target_os = \"linux\", target_os = \"android\", target_os = \"macos\"))]\r\npub mod utsname;\r\n```\r\n\r\nNow my program compiles and runs, however it terminates silently as soon as `uname` is called. The following `println!` isn't executed.\r\n\r\nUnfortunately I am not equipped to figure out how to resolve this issue."}}
{"actor":{"display_login":"zsck"}}