-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix ioctl constants for musl target envs. #289
Conversation
According to musl's source, the `ioctl` [function signature][musl-ioctl-h] takes an `int` as the request argument (i.e. an `i32`) which is reflected in this crate's [ioctl binding][musl-ioctl-rs]. It looks like when the ioctl constants were added that [glibc's default][glibc-ioctl-h] of a `c_ulong` type was used for the musl values as well, rather than a `c_int` type. This change updates these constants to a `c_int` so that they match the expected function call type. Here is a minimal reproduction of the issue. Given this Rust program: ```rust extern crate libc; use libc::{ioctl, winsize, STDOUT_FILENO, TIOCGWINSZ}; fn main() { let mut wsize = winsize { ws_row: 0, ws_col: 0, ws_xpixel: 0, ws_ypixel: 0, }; unsafe { ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut wsize); } println!("Sizes: {{ rows: {}, cols: {}, xpixel: {}, ypixel: {} }}", wsize.ws_row, wsize.ws_col, wsize.ws_xpixel, wsize.ws_ypixel); } ``` When run against the `x86_64-unknwon-linux-gnu` and `x86_64-unknown-linux-musl` targets, we see the difference in behavior: ``` > cargo clean > cargo run --target=x86_64-unknown-linux-gnu Compiling libc v0.2.11 Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-gnu/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } > cargo clean > cargo run --target=x86_64-unknown-linux-musl Compiling libc v0.2.11 Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) src/main.rs:13:30: 13:40 error: mismatched types: expected `i32`, found `u64` [E0308] src/main.rs:13 ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut wsize); ^~~~~~~~~~ src/main.rs:13:30: 13:40 help: run `rustc --explain E0308` to see a detailed explanation error: aborting due to previous error Could not compile `libc-musl-ioctl`. To learn more, run the command again with --verbose. ``` Working against this fix: ``` > cargo clean > cargo run --target=x86_64-unknown-linux-gnu Updating git repository `https://github.com/fnichol/rust-lang-libc.git` Compiling libc v0.2.11 (https://github.com/fnichol/rust-lang-libc.git?branch=fix-musl-ioctl-constants#3285f387) Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-gnu/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } > cargo clean > cargo run --target=x86_64-unknown-linux-musl Compiling libc v0.2.11 (https://github.com/fnichol/rust-lang-libc.git?branch=fix-musl-ioctl-constants#3285f387) Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-musl/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } ``` [musl-ioctl-rs]: https://doc.rust-lang.org/libc/x86_64-unknown-linux-musl/libc/fn.ioctl.html [musl-ioctl-h]: https://git.musl-libc.org/cgit/musl/tree/include/sys/ioctl.h [glibc-ioctl-h]: http://bazaar.launchpad.net/~vcs-imports/glibc/master/view/head:/include/sys/ioctl.h
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
hab CLI ------- This change is part spike and experiment and part functional. It is a first attempt at unifying the `hab` CLI output and formatting to be more consisten and easier to scan as a newcomer (in the short term) and experienced user (in the long term). Most of the commands have the following narrative, much like an essay: * An intro/goal/summary of the objective * A middle with the concrete steps to achieve the objective * A final summary/conclusion to confirm success Here is an example of a package install invocation: ``` > hab install core/redis » Installing core/redis ↓ Downloading core/glibc/2.22/20160427193532 16.21 MB / 16.21 MB \ [========================================] 100.00 % 2.98 MB/s ✓ Installed core/glibc/2.22/20160427193532 ↓ Downloading core/linux-headers/4.3/20160427193435 798.63 KB / 798.63 KB | [======================================] 100.00 % 1.56 MB/s ✓ Installed core/linux-headers/4.3/20160427193435 ↓ Downloading core/redis/3.0.7/20160427222845 1.46 MB / 1.46 MB | [==========================================] 100.00 % 3.28 MB/s ✓ Installed core/redis/3.0.7/20160427222845 ★ Install of core/redis complete with 3 packages installed. ``` musl/libc/ioctl --------------- In the course of building in a progress bar, an issue was found with in the `libc` crate relating to the types of ioctl contants when used by musl (more detail in: rust-lang/libc#289). Unfortunately, this meant vendoring libc so that it would be used as a transitive dependency in the crates that generated the errors (currently this is the `pbr` crate, which is completely correct in tits implementation). Without this temporary measure, the `hab` CLI won't build as-is with the musl target. The other option is to feature-disable the progress bar until the upstream is resolved, but it really hampers the far superior user experience that a progress bar like this provides. Signed-off-by: Fletcher Nichol <fnichol@nichol.ca>
hab CLI ------- This change is part spike and experiment and part functional. It is a first attempt at unifying the `hab` CLI output and formatting to be more consisten and easier to scan as a newcomer (in the short term) and experienced user (in the long term). Most of the commands have the following narrative, much like an essay: * An intro/goal/summary of the objective * A middle with the concrete steps to achieve the objective * A final summary/conclusion to confirm success Here is an example of a package install invocation: ``` > hab install core/redis » Installing core/redis ↓ Downloading core/glibc/2.22/20160427193532 16.21 MB / 16.21 MB \ [========================================] 100.00 % 2.98 MB/s ✓ Installed core/glibc/2.22/20160427193532 ↓ Downloading core/linux-headers/4.3/20160427193435 798.63 KB / 798.63 KB | [======================================] 100.00 % 1.56 MB/s ✓ Installed core/linux-headers/4.3/20160427193435 ↓ Downloading core/redis/3.0.7/20160427222845 1.46 MB / 1.46 MB | [==========================================] 100.00 % 3.28 MB/s ✓ Installed core/redis/3.0.7/20160427222845 ★ Install of core/redis complete with 3 packages installed. ``` musl/libc/ioctl --------------- In the course of building in a progress bar, an issue was found with in the `libc` crate relating to the types of ioctl contants when used by musl (more detail in: rust-lang/libc#289). Unfortunately, this meant vendoring libc so that it would be used as a transitive dependency in the crates that generated the errors (currently this is the `pbr` crate, which is completely correct in tits implementation). Without this temporary measure, the `hab` CLI won't build as-is with the musl target. The other option is to feature-disable the progress bar until the upstream is resolved, but it really hampers the far superior user experience that a progress bar like this provides. Signed-off-by: Fletcher Nichol <fnichol@nichol.ca>
hab CLI ------- This change is part spike and experiment and part functional. It is a first attempt at unifying the `hab` CLI output and formatting to be more consisten and easier to scan as a newcomer (in the short term) and experienced user (in the long term). Most of the commands have the following narrative, much like an essay: * An intro/goal/summary of the objective * A middle with the concrete steps to achieve the objective * A final summary/conclusion to confirm success Here is an example of a package install invocation: ``` > hab install core/redis » Installing core/redis ↓ Downloading core/glibc/2.22/20160427193532 16.21 MB / 16.21 MB \ [========================================] 100.00 % 2.98 MB/s ✓ Installed core/glibc/2.22/20160427193532 ↓ Downloading core/linux-headers/4.3/20160427193435 798.63 KB / 798.63 KB | [======================================] 100.00 % 1.56 MB/s ✓ Installed core/linux-headers/4.3/20160427193435 ↓ Downloading core/redis/3.0.7/20160427222845 1.46 MB / 1.46 MB | [==========================================] 100.00 % 3.28 MB/s ✓ Installed core/redis/3.0.7/20160427222845 ★ Install of core/redis complete with 3 packages installed. ``` musl/libc/ioctl --------------- In the course of building in a progress bar, an issue was found with in the `libc` crate relating to the types of ioctl contants when used by musl (more detail in: rust-lang/libc#289). Unfortunately, this meant vendoring libc so that it would be used as a transitive dependency in the crates that generated the errors (currently this is the `pbr` crate, which is completely correct in tits implementation). Without this temporary measure, the `hab` CLI won't build as-is with the musl target. The other option is to feature-disable the progress bar until the upstream is resolved, but it really hampers the far superior user experience that a progress bar like this provides. Signed-off-by: Fletcher Nichol <fnichol@nichol.ca>
⌛ Testing commit 78d9be2 with merge a252236... |
Fix ioctl constants for musl target envs. Heya! I ran across this issue today while trying to build a portable static binary using the `x86_64-unknown-linux-musl` target. Took a bit of digging to make sure I understood what was going on, and while I may still be off the mark, I believe this is a fix to my issue. Thanks!! ---- According to musl's source, the `ioctl` [function signature][musl-ioctl-h] takes an `int` as the request argument (i.e. an `i32`) which is reflected in this crate's [ioctl binding][musl-ioctl-rs]. It looks like when the ioctl constants were added that [glibc's default][glibc-ioctl-h] of a `c_ulong` type was used for the musl values as well, rather than a `c_int` type. This change updates these constants to a `c_int` so that they match the expected function call type. Here is a minimal reproduction of the issue. Given this Rust program: ```rust extern crate libc; use libc::{ioctl, winsize, STDOUT_FILENO, TIOCGWINSZ}; fn main() { let mut wsize = winsize { ws_row: 0, ws_col: 0, ws_xpixel: 0, ws_ypixel: 0, }; unsafe { ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut wsize); } println!("Sizes: {{ rows: {}, cols: {}, xpixel: {}, ypixel: {} }}", wsize.ws_row, wsize.ws_col, wsize.ws_xpixel, wsize.ws_ypixel); } ``` When run against the `x86_64-unknwon-linux-gnu` and `x86_64-unknown-linux-musl` targets, we see the difference in behavior: ``` > cargo clean > cargo run --target=x86_64-unknown-linux-gnu Compiling libc v0.2.11 Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-gnu/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } > cargo clean > cargo run --target=x86_64-unknown-linux-musl Compiling libc v0.2.11 Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) src/main.rs:13:30: 13:40 error: mismatched types: expected `i32`, found `u64` [E0308] src/main.rs:13 ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut wsize); ^~~~~~~~~~ src/main.rs:13:30: 13:40 help: run `rustc --explain E0308` to see a detailed explanation error: aborting due to previous error Could not compile `libc-musl-ioctl`. To learn more, run the command again with --verbose. ``` Working against this fix: ``` > cargo clean > cargo run --target=x86_64-unknown-linux-gnu Updating git repository `https://github.com/fnichol/rust-lang-libc.git` Compiling libc v0.2.11 (https://github.com/fnichol/rust-lang-libc.git?branch=fix-musl-ioctl-constants#3285f387) Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-gnu/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } > cargo clean > cargo run --target=x86_64-unknown-linux-musl Compiling libc v0.2.11 (https://github.com/fnichol/rust-lang-libc.git?branch=fix-musl-ioctl-constants#3285f387) Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-musl/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } ``` [musl-ioctl-rs]: https://doc.rust-lang.org/libc/x86_64-unknown-linux-musl/libc/fn.ioctl.html [musl-ioctl-h]: https://git.musl-libc.org/cgit/musl/tree/include/sys/ioctl.h [glibc-ioctl-h]: http://bazaar.launchpad.net/~vcs-imports/glibc/master/view/head:/include/sys/ioctl.h
hab CLI ------- This change is part spike and experiment and part functional. It is a first attempt at unifying the `hab` CLI output and formatting to be more consisten and easier to scan as a newcomer (in the short term) and experienced user (in the long term). Most of the commands have the following narrative, much like an essay: * An intro/goal/summary of the objective * A middle with the concrete steps to achieve the objective * A final summary/conclusion to confirm success Here is an example of a package install invocation: ``` > hab install core/redis » Installing core/redis ↓ Downloading core/glibc/2.22/20160427193532 16.21 MB / 16.21 MB \ [========================================] 100.00 % 2.98 MB/s ✓ Installed core/glibc/2.22/20160427193532 ↓ Downloading core/linux-headers/4.3/20160427193435 798.63 KB / 798.63 KB | [======================================] 100.00 % 1.56 MB/s ✓ Installed core/linux-headers/4.3/20160427193435 ↓ Downloading core/redis/3.0.7/20160427222845 1.46 MB / 1.46 MB | [==========================================] 100.00 % 3.28 MB/s ✓ Installed core/redis/3.0.7/20160427222845 ★ Install of core/redis complete with 3 packages installed. ``` musl/libc/ioctl --------------- In the course of building in a progress bar, an issue was found with in the `libc` crate relating to the types of ioctl contants when used by musl (more detail in: rust-lang/libc#289). Unfortunately, this meant vendoring libc so that it would be used as a transitive dependency in the crates that generated the errors (currently this is the `pbr` crate, which is completely correct in tits implementation). Without this temporary measure, the `hab` CLI won't build as-is with the musl target. The other option is to feature-disable the progress bar until the upstream is resolved, but it really hampers the far superior user experience that a progress bar like this provides. Signed-off-by: Fletcher Nichol <fnichol@nichol.ca> Pull request: #522 Approved by: fnichol
💥 Test timed out |
@bors: retry |
Fix ioctl constants for musl target envs. Heya! I ran across this issue today while trying to build a portable static binary using the `x86_64-unknown-linux-musl` target. Took a bit of digging to make sure I understood what was going on, and while I may still be off the mark, I believe this is a fix to my issue. Thanks!! ---- According to musl's source, the `ioctl` [function signature][musl-ioctl-h] takes an `int` as the request argument (i.e. an `i32`) which is reflected in this crate's [ioctl binding][musl-ioctl-rs]. It looks like when the ioctl constants were added that [glibc's default][glibc-ioctl-h] of a `c_ulong` type was used for the musl values as well, rather than a `c_int` type. This change updates these constants to a `c_int` so that they match the expected function call type. Here is a minimal reproduction of the issue. Given this Rust program: ```rust extern crate libc; use libc::{ioctl, winsize, STDOUT_FILENO, TIOCGWINSZ}; fn main() { let mut wsize = winsize { ws_row: 0, ws_col: 0, ws_xpixel: 0, ws_ypixel: 0, }; unsafe { ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut wsize); } println!("Sizes: {{ rows: {}, cols: {}, xpixel: {}, ypixel: {} }}", wsize.ws_row, wsize.ws_col, wsize.ws_xpixel, wsize.ws_ypixel); } ``` When run against the `x86_64-unknwon-linux-gnu` and `x86_64-unknown-linux-musl` targets, we see the difference in behavior: ``` > cargo clean > cargo run --target=x86_64-unknown-linux-gnu Compiling libc v0.2.11 Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-gnu/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } > cargo clean > cargo run --target=x86_64-unknown-linux-musl Compiling libc v0.2.11 Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) src/main.rs:13:30: 13:40 error: mismatched types: expected `i32`, found `u64` [E0308] src/main.rs:13 ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut wsize); ^~~~~~~~~~ src/main.rs:13:30: 13:40 help: run `rustc --explain E0308` to see a detailed explanation error: aborting due to previous error Could not compile `libc-musl-ioctl`. To learn more, run the command again with --verbose. ``` Working against this fix: ``` > cargo clean > cargo run --target=x86_64-unknown-linux-gnu Updating git repository `https://github.com/fnichol/rust-lang-libc.git` Compiling libc v0.2.11 (https://github.com/fnichol/rust-lang-libc.git?branch=fix-musl-ioctl-constants#3285f387) Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-gnu/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } > cargo clean > cargo run --target=x86_64-unknown-linux-musl Compiling libc v0.2.11 (https://github.com/fnichol/rust-lang-libc.git?branch=fix-musl-ioctl-constants#3285f387) Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-musl/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } ``` [musl-ioctl-rs]: https://doc.rust-lang.org/libc/x86_64-unknown-linux-musl/libc/fn.ioctl.html [musl-ioctl-h]: https://git.musl-libc.org/cgit/musl/tree/include/sys/ioctl.h [glibc-ioctl-h]: http://bazaar.launchpad.net/~vcs-imports/glibc/master/view/head:/include/sys/ioctl.h
💥 Test timed out |
@alexcrichton Thanks for the quick turnaround! Is there anything I can do to help the bot, or is it just caught in timeout loop? |
@bors: retry Nah unfortunately the appveyor build is sometimes really slow ... |
Fix ioctl constants for musl target envs. Heya! I ran across this issue today while trying to build a portable static binary using the `x86_64-unknown-linux-musl` target. Took a bit of digging to make sure I understood what was going on, and while I may still be off the mark, I believe this is a fix to my issue. Thanks!! ---- According to musl's source, the `ioctl` [function signature][musl-ioctl-h] takes an `int` as the request argument (i.e. an `i32`) which is reflected in this crate's [ioctl binding][musl-ioctl-rs]. It looks like when the ioctl constants were added that [glibc's default][glibc-ioctl-h] of a `c_ulong` type was used for the musl values as well, rather than a `c_int` type. This change updates these constants to a `c_int` so that they match the expected function call type. Here is a minimal reproduction of the issue. Given this Rust program: ```rust extern crate libc; use libc::{ioctl, winsize, STDOUT_FILENO, TIOCGWINSZ}; fn main() { let mut wsize = winsize { ws_row: 0, ws_col: 0, ws_xpixel: 0, ws_ypixel: 0, }; unsafe { ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut wsize); } println!("Sizes: {{ rows: {}, cols: {}, xpixel: {}, ypixel: {} }}", wsize.ws_row, wsize.ws_col, wsize.ws_xpixel, wsize.ws_ypixel); } ``` When run against the `x86_64-unknwon-linux-gnu` and `x86_64-unknown-linux-musl` targets, we see the difference in behavior: ``` > cargo clean > cargo run --target=x86_64-unknown-linux-gnu Compiling libc v0.2.11 Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-gnu/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } > cargo clean > cargo run --target=x86_64-unknown-linux-musl Compiling libc v0.2.11 Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) src/main.rs:13:30: 13:40 error: mismatched types: expected `i32`, found `u64` [E0308] src/main.rs:13 ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut wsize); ^~~~~~~~~~ src/main.rs:13:30: 13:40 help: run `rustc --explain E0308` to see a detailed explanation error: aborting due to previous error Could not compile `libc-musl-ioctl`. To learn more, run the command again with --verbose. ``` Working against this fix: ``` > cargo clean > cargo run --target=x86_64-unknown-linux-gnu Updating git repository `https://github.com/fnichol/rust-lang-libc.git` Compiling libc v0.2.11 (https://github.com/fnichol/rust-lang-libc.git?branch=fix-musl-ioctl-constants#3285f387) Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-gnu/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } > cargo clean > cargo run --target=x86_64-unknown-linux-musl Compiling libc v0.2.11 (https://github.com/fnichol/rust-lang-libc.git?branch=fix-musl-ioctl-constants#3285f387) Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-musl/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } ``` [musl-ioctl-rs]: https://doc.rust-lang.org/libc/x86_64-unknown-linux-musl/libc/fn.ioctl.html [musl-ioctl-h]: https://git.musl-libc.org/cgit/musl/tree/include/sys/ioctl.h [glibc-ioctl-h]: http://bazaar.launchpad.net/~vcs-imports/glibc/master/view/head:/include/sys/ioctl.h
☀️ Test successful - status-appveyor, travis |
Fix ioctl types for non-x86 musl This fixes up #289 by changing the type for other platforms as well.
hab CLI ------- This change is part spike and experiment and part functional. It is a first attempt at unifying the `hab` CLI output and formatting to be more consisten and easier to scan as a newcomer (in the short term) and experienced user (in the long term). Most of the commands have the following narrative, much like an essay: * An intro/goal/summary of the objective * A middle with the concrete steps to achieve the objective * A final summary/conclusion to confirm success Here is an example of a package install invocation: ``` > hab install core/redis » Installing core/redis ↓ Downloading core/glibc/2.22/20160427193532 16.21 MB / 16.21 MB \ [========================================] 100.00 % 2.98 MB/s ✓ Installed core/glibc/2.22/20160427193532 ↓ Downloading core/linux-headers/4.3/20160427193435 798.63 KB / 798.63 KB | [======================================] 100.00 % 1.56 MB/s ✓ Installed core/linux-headers/4.3/20160427193435 ↓ Downloading core/redis/3.0.7/20160427222845 1.46 MB / 1.46 MB | [==========================================] 100.00 % 3.28 MB/s ✓ Installed core/redis/3.0.7/20160427222845 ★ Install of core/redis complete with 3 packages installed. ``` musl/libc/ioctl --------------- In the course of building in a progress bar, an issue was found with in the `libc` crate relating to the types of ioctl contants when used by musl (more detail in: rust-lang/libc#289). Unfortunately, this meant vendoring libc so that it would be used as a transitive dependency in the crates that generated the errors (currently this is the `pbr` crate, which is completely correct in tits implementation). Without this temporary measure, the `hab` CLI won't build as-is with the musl target. The other option is to feature-disable the progress bar until the upstream is resolved, but it really hampers the far superior user experience that a progress bar like this provides. Signed-off-by: Fletcher Nichol <fnichol@nichol.ca> Pull request: #522 Approved by: fnichol
Fix Travis-CI links.
hab CLI ------- This change is part spike and experiment and part functional. It is a first attempt at unifying the `hab` CLI output and formatting to be more consisten and easier to scan as a newcomer (in the short term) and experienced user (in the long term). Most of the commands have the following narrative, much like an essay: * An intro/goal/summary of the objective * A middle with the concrete steps to achieve the objective * A final summary/conclusion to confirm success Here is an example of a package install invocation: ``` > hab install core/redis » Installing core/redis ↓ Downloading core/glibc/2.22/20160427193532 16.21 MB / 16.21 MB \ [========================================] 100.00 % 2.98 MB/s ✓ Installed core/glibc/2.22/20160427193532 ↓ Downloading core/linux-headers/4.3/20160427193435 798.63 KB / 798.63 KB | [======================================] 100.00 % 1.56 MB/s ✓ Installed core/linux-headers/4.3/20160427193435 ↓ Downloading core/redis/3.0.7/20160427222845 1.46 MB / 1.46 MB | [==========================================] 100.00 % 3.28 MB/s ✓ Installed core/redis/3.0.7/20160427222845 ★ Install of core/redis complete with 3 packages installed. ``` musl/libc/ioctl --------------- In the course of building in a progress bar, an issue was found with in the `libc` crate relating to the types of ioctl contants when used by musl (more detail in: rust-lang/libc#289). Unfortunately, this meant vendoring libc so that it would be used as a transitive dependency in the crates that generated the errors (currently this is the `pbr` crate, which is completely correct in tits implementation). Without this temporary measure, the `hab` CLI won't build as-is with the musl target. The other option is to feature-disable the progress bar until the upstream is resolved, but it really hampers the far superior user experience that a progress bar like this provides. Signed-off-by: Fletcher Nichol <fnichol@nichol.ca> Pull request: #522 Approved by: fnichol
hab CLI ------- This change is part spike and experiment and part functional. It is a first attempt at unifying the `hab` CLI output and formatting to be more consisten and easier to scan as a newcomer (in the short term) and experienced user (in the long term). Most of the commands have the following narrative, much like an essay: * An intro/goal/summary of the objective * A middle with the concrete steps to achieve the objective * A final summary/conclusion to confirm success Here is an example of a package install invocation: ``` > hab install core/redis » Installing core/redis ↓ Downloading core/glibc/2.22/20160427193532 16.21 MB / 16.21 MB \ [========================================] 100.00 % 2.98 MB/s ✓ Installed core/glibc/2.22/20160427193532 ↓ Downloading core/linux-headers/4.3/20160427193435 798.63 KB / 798.63 KB | [======================================] 100.00 % 1.56 MB/s ✓ Installed core/linux-headers/4.3/20160427193435 ↓ Downloading core/redis/3.0.7/20160427222845 1.46 MB / 1.46 MB | [==========================================] 100.00 % 3.28 MB/s ✓ Installed core/redis/3.0.7/20160427222845 ★ Install of core/redis complete with 3 packages installed. ``` musl/libc/ioctl --------------- In the course of building in a progress bar, an issue was found with in the `libc` crate relating to the types of ioctl contants when used by musl (more detail in: rust-lang/libc#289). Unfortunately, this meant vendoring libc so that it would be used as a transitive dependency in the crates that generated the errors (currently this is the `pbr` crate, which is completely correct in tits implementation). Without this temporary measure, the `hab` CLI won't build as-is with the musl target. The other option is to feature-disable the progress bar until the upstream is resolved, but it really hampers the far superior user experience that a progress bar like this provides. Signed-off-by: Fletcher Nichol <fnichol@nichol.ca> Pull request: #522 Approved by: fnichol
This commit provides insurance that intrinsics are only introduced with known canonical types (`__m128i` and such) instead of also allowing `u8x16` for example.
This arch was overlooked or unspecified in earlier PRs that fixed c_ulong to c_int for ioctl.h consts for musl, see PR rust-lang#289, PR rust-lang#301, or PR rust-lang#1097 for such prior art, however these are still args to fn ioctl on mips64-musl, which is expecting c_ints.
This arch was overlooked or unspecified in earlier PRs that fixed c_ulong to c_int for ioctl.h consts for musl, see PR rust-lang#289, PR rust-lang#301, or PR rust-lang#1097 for such prior art, however these are still args to fn ioctl on mips64-musl, which is expecting c_ints. Some numbers acquired casts to reflect the fact the data is being used and (so should be written as) an unsized bitfield, even if the value is greater than i32::MAX.
Fix mips64-musl ioctl consts to c_int This arch was overlooked or unspecified in earlier PRs that fixed c_ulong to c_int for ioctl.h consts for musl, see PR #289, PR #301, or PR #1097 for such prior art, however these are still args to fn ioctl on mips64-musl, which is expecting c_ints. Some numbers acquired casts to reflect the fact the data is being used and (so should be written as) an unsized bitfield, even if the value is greater than i32::MAX. Currently rustc is not building on mips64-linux-musl because of this error.
Fix mips64-musl ioctl consts to c_int This arch was overlooked or unspecified in earlier PRs that fixed c_ulong to c_int for ioctl.h consts for musl, see PR #289, PR #301, or PR #1097 for such prior art, however these are still args to fn ioctl on mips64-musl, which is expecting c_ints. Some numbers acquired casts to reflect the fact the data is being used and (so should be written as) an unsized bitfield, even if the value is greater than i32::MAX. Currently rustc is not building on mips64-linux-musl because of this error.
Fix mips64-musl ioctl consts to c_int This arch was overlooked or unspecified in earlier PRs that fixed c_ulong to c_int for ioctl.h consts for musl, see PR #289, PR #301, or PR #1097 for such prior art, however these are still args to fn ioctl on mips64-musl, which is expecting c_ints. Some numbers acquired casts to reflect the fact the data is being used and (so should be written as) an unsized bitfield, even if the value is greater than i32::MAX. Currently rustc is not building on mips64-linux-musl because of this error.
Fix mips64-musl ioctl consts to c_int This arch was overlooked or unspecified in earlier PRs that fixed c_ulong to c_int for ioctl.h consts for musl, see PR #289, PR #301, or PR #1097 for such prior art, however these are still args to fn ioctl on mips64-musl, which is expecting c_ints. Some numbers acquired casts to reflect the fact the data is being used and (so should be written as) an unsized bitfield, even if the value is greater than i32::MAX. Currently rustc is not building on mips64-linux-musl because of this error.
Fix mips64-musl ioctl consts to c_int This arch was overlooked or unspecified in earlier PRs that fixed c_ulong to c_int for ioctl.h consts for musl, see PR #289, PR #301, or PR #1097 for such prior art, however these are still args to fn ioctl on mips64-musl, which is expecting c_ints. Some numbers acquired casts to reflect the fact the data is being used and (so should be written as) an unsized bitfield, even if the value is greater than i32::MAX. Currently rustc is not building on mips64-linux-musl because of this error.
Fix mips64-musl ioctl consts to c_int This arch was overlooked or unspecified in earlier PRs that fixed c_ulong to c_int for ioctl.h consts for musl, see PR #289, PR #301, or PR #1097 for such prior art, however these are still args to fn ioctl on mips64-musl, which is expecting c_ints. Some numbers acquired casts to reflect the fact the data is being used and (so should be written as) an unsized bitfield, even if the value is greater than i32::MAX. Currently rustc is not building on mips64-linux-musl because of this error.
Fix mips64-musl ioctl consts to c_int This arch was overlooked or unspecified in earlier PRs that fixed c_ulong to c_int for ioctl.h consts for musl, see PR #289, PR #301, or PR #1097 for such prior art, however these are still args to fn ioctl on mips64-musl, which is expecting c_ints. Some numbers acquired casts to reflect the fact the data is being used and (so should be written as) an unsized bitfield, even if the value is greater than i32::MAX. Currently rustc is not building on mips64-linux-musl because of this error.
Fix mips64-musl ioctl consts to c_int This arch was overlooked or unspecified in earlier PRs that fixed c_ulong to c_int for ioctl.h consts for musl, see PR #289, PR #301, or PR #1097 for such prior art, however these are still args to fn ioctl on mips64-musl, which is expecting c_ints. Some numbers acquired casts to reflect the fact the data is being used and (so should be written as) an unsized bitfield, even if the value is greater than i32::MAX. Currently rustc is not building on mips64-linux-musl because of this error.
Fix mips64-musl ioctl consts to c_int This arch was overlooked or unspecified in earlier PRs that fixed c_ulong to c_int for ioctl.h consts for musl, see PR #289, PR #301, or PR #1097 for such prior art, however these are still args to fn ioctl on mips64-musl, which is expecting c_ints. Some numbers acquired casts to reflect the fact the data is being used and (so should be written as) an unsized bitfield, even if the value is greater than i32::MAX. Currently rustc is not building on mips64-linux-musl because of this error.
Fix mips64-musl ioctl consts to c_int This arch was overlooked or unspecified in earlier PRs that fixed c_ulong to c_int for ioctl.h consts for musl, see PR #289, PR #301, or PR #1097 for such prior art, however these are still args to fn ioctl on mips64-musl, which is expecting c_ints. Some numbers acquired casts to reflect the fact the data is being used and (so should be written as) an unsized bitfield, even if the value is greater than i32::MAX. Currently rustc is not building on mips64-linux-musl because of this error.
Fix mips64-musl ioctl consts to c_int This arch was overlooked or unspecified in earlier PRs that fixed c_ulong to c_int for ioctl.h consts for musl, see PR #289, PR #301, or PR #1097 for such prior art, however these are still args to fn ioctl on mips64-musl, which is expecting c_ints. Some numbers acquired casts to reflect the fact the data is being used and (so should be written as) an unsized bitfield, even if the value is greater than i32::MAX. Currently rustc is not building on mips64-linux-musl because of this error.
Fix mips64-musl ioctl consts to c_int This arch was overlooked or unspecified in earlier PRs that fixed c_ulong to c_int for ioctl.h consts for musl, see PR #289, PR #301, or PR #1097 for such prior art, however these are still args to fn ioctl on mips64-musl, which is expecting c_ints. Some numbers acquired casts to reflect the fact the data is being used and (so should be written as) an unsized bitfield, even if the value is greater than i32::MAX. Currently rustc is not building on mips64-linux-musl because of this error.
Heya!
I ran across this issue today while trying to build a portable static binary using the
x86_64-unknown-linux-musl
target. Took a bit of digging to make sure I understood what was going on, and while I may still be off the mark, I believe this is a fix to my issue.Thanks!!
According to musl's source, the
ioctl
function signature takes anint
as the request argument (i.e. ani32
) which is reflected in this crate's ioctl binding. It looks like when the ioctl constants were added that glibc's default of ac_ulong
type was used for the musl values as well, rather than ac_int
type. This change updates these constants to ac_int
so that they match the expected function call type.Here is a minimal reproduction of the issue. Given this Rust program:
When run against the
x86_64-unknwon-linux-gnu
andx86_64-unknown-linux-musl
targets, we see the difference in behavior:Working against this fix: