Skip to content

Conversation

phil-opp
Copy link
Member

@phil-opp phil-opp commented Apr 1, 2020

Without the RUSTFLAGS environment variable set, cargo looks at .cargo/config files in all parent directories. Such a file can contain a build.rustflags key that would then be applied to the bootloader build too. Since some rustflags can break the build (e.g. -C target-cpu=native), we should prevent that.

Creating a cargo/.config file with an empty build.rustflags key in the bootloader repository does not suffice for fixing this because cargo unifies arrays with the values defined in parent directories. So the only way to ensure that no rustflags are passed is to set the RUSTFLAGS environment variable to the empty string, exploiting the fact that it takes precedence over any build.rustflags key.

Fixes phil-opp/blog_os#770

Without the `RUSTFLAGS` environment variable set, cargo looks at `.cargo/config` files in all parent directories. Such a file can contain a `build.rustflags` key that would then be applied to the bootloader build too. Since some rustflags can break the build (e.g. `-C target-cpu=native`), we should prevent that.

Creating a `cargo/.config` file with an empty `build.rustflags` key in the bootloader repository does not suffice for fixing this because cargo unifies arrays with the values defined in parent directories. So the only way to ensure that no rustflags are passed is to set the RUSTFLAGS environment variable to the empty string, exploiting the fact that it takes precedence over any `build.rustflags` key.
phil-opp added 2 commits April 1, 2020 12:04
The 10.13 image was removed by Azure and no longer builds.
@phil-opp phil-opp merged commit d3b3905 into master Apr 1, 2020
@bors bors bot deleted the fix-rustflags branch April 1, 2020 12:44
phil-opp added a commit that referenced this pull request Apr 1, 2020
@phil-opp
Copy link
Member Author

phil-opp commented Apr 1, 2020

Released as version 0.7.9.

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.

Triple fault when trying to boot kernel in Qemu; Dsound failures (possibly Windows only)
1 participant