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

Don't set CMAKE_SYSTEM_NAME=Linux #139

Merged
merged 1 commit into from
Jan 6, 2022

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Jan 5, 2022

Previously, this would set SYSTEM_NAME unconditionally whenever targeting Linux.
Unfortunately, Cmake unsets some other variables when SYSTEM_NAME is set;
in particular CMAKE_SYSTEM_VERSION and CMAKE_SYSTEM_PROCESSOR.

To avoid regressing other builds, this reverts the change; builds which
want to cross-compile to linux can set SYSTEM_NAME themselves.

Fixes #138 (I confirmed locally that this fixes the build for boring-sys).

Copy link
Contributor

@messense messense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverting is also fine if it‘s breaking builds.

@alexcrichton
Copy link
Member

Is there any confidence that this is the right fix? I don't know why cross-compiling would somehow be different than not. If there's not confidence that this is the right fix then I'd prefer that this would be reverted for now.

Previously, this would set SYSTEM_NAME unconditionally whenever targeting Linux.
Unfortunately, Cmake unsets some other variables when SYSTEM_NAME is set;
in particular `CMAKE_SYSTEM_VERSION` and `CMAKE_SYSTEM_PROCESSOR`.

To avoid regressing other builds, this reverts the change; builds which
want to cross-compile to linux can set `SYSTEM_NAME` themselves.
@jyn514 jyn514 force-pushed the cmake-system-name branch from 8a87b7a to f625e2c Compare January 6, 2022 15:42
@jyn514
Copy link
Member Author

jyn514 commented Jan 6, 2022

No, I'm fine with reverting, I was just trying to keep the churn low. I changed this PR to be a straight revert instead.

@jyn514 jyn514 changed the title Only set CMAKE_SYSTEM_NAME=Linux when cross-compiling to Linux Don't set CMAKE_SYSTEM_NAME=Linux Jan 6, 2022
@alexcrichton alexcrichton merged commit 5f9218b into rust-lang:master Jan 6, 2022
@jyn514 jyn514 deleted the cmake-system-name branch January 6, 2022 16:27
@jyn514
Copy link
Member Author

jyn514 commented Jan 6, 2022

Thanks for the quick review!

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

Successfully merging this pull request may close these issues.

Build failure when using 0.1.47
4 participants