-
Notifications
You must be signed in to change notification settings - Fork 80
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
Allow overriding system root via environment #82
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Including Path
will fix the compiler error.
I tested that and rebasing master with a macOS machine and things look great!:
[nix-shell:~/development/rust/pkg-config-rs]$ cargo test --quiet
running 1 test
.
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
running 25 tests
.........................
test result: ok. 25 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
running 3 tests
test src/lib.rs - (line 46) ... ok
test src/lib.rs - (line 56) ... ok
test src/lib.rs - (line 35) ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
I pushed my changes for reference: https://github.com/danielverkamp/pkg-config-rs/compare/master...efx:sysroot-rebase?expand=1 |
Your changes look good to me - thanks! What's the next step for getting this merged? Should I update this PR with your changes or can you apply it directly somehow? |
sure thing @danielverkamp ! |
No that sounds correct. This is only blocked by me (or someone else) finding time to actually review this and consider all the effects this actually has. |
Looks good to me apart from that. Needs to be fixed and then rebased on master so it can be merged :) |
Use the PKG_CONFIG_SYSROOT_DIR (preferred) or SYSROOT (fallback) environment variables to override the default path used to determine whether a library is a system library or not (/usr). This enables cross-compilation scenarios where the system root is not a subdirectory of /usr. Specifically, when building Rust packages in the Chomium OS SDK, each board's sysroot is located in /build/$BOARD rather than a subdirectory of /usr. Additionally, cros_sdk only specifies SYSROOT (PKG_CONFIG_SYSROOT_DIR is set by the pkg-config-$BOARD cross compilation helpers, but that isn't available in pkg-config-rs). This has only been tested on Linux, as I don't have a macOS machine handy, but I believe the macOS path should work as before (it does not consider the new sysroot variables). Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Use the PKG_CONFIG_SYSROOT_DIR (preferred) or SYSROOT (fallback)
environment variables to override the default path used to determine
whether a library is a system library or not (/usr).
This enables cross-compilation scenarios where the system root is not a
subdirectory of /usr. Specifically, when building Rust packages in the
Chomium OS SDK, each board's sysroot is located in /build/$BOARD rather
than a subdirectory of /usr. Additionally, cros_sdk only specifies
SYSROOT (PKG_CONFIG_SYSROOT_DIR is set by the pkg-config-$BOARD cross
compilation helpers, but that isn't available in pkg-config-rs).
This has only been tested on Linux, as I don't have a macOS machine
handy, but I believe the macOS path should work as before (it does not
consider the new sysroot variables).
Signed-off-by: Daniel Verkamp dverkamp@chromium.org