rust-osdev / cargo-xbuild

Automatically cross-compiles the sysroot crates core, compiler_builtins, and alloc.
Apache License 2.0
260 stars 25 forks source link

Fix: Not all projects have a root package #61

Closed phil-opp closed 4 years ago

phil-opp commented 4 years ago

Since #57, we try to read the config from the root package of the workspace, instead of just defaulting to the first package. The problem with this is that the new code assumes that there is always a root package in the workspace, which is not true when only a virtual manifest is used at the root.

With this pull request we no longer error for such workspaces. Instead, we emit a warning that no cargo-xbuild configuration is applied and use the default config. This isn't optimal, but there is no canoncial place to read the config from and I can't think of a better approach.

To ensure that future config related errors are easier to debug, this pull request also prints the underlying cause for config load errors.

Fixes #60

phil-opp commented 4 years ago

@ascjones This changes the code that you introduced in #57. Could you test whether your use case still works with this PR?

phil-opp commented 4 years ago

Thanks for verifying that it still works! I didn't think of virtual manifests either, so no worries!

Still, this is much improved now with the warning, where previously it would have silently used the default config.

I fully agree!

phil-opp commented 4 years ago

Published as version 0.5.25