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

Linearize workspace detection #23

Merged
merged 1 commit into from
Nov 11, 2022
Merged

Conversation

MarijnS95
Copy link
Member

When cargo scans for a workspace it simply walks up the directories until finding the first Cargo.toml with a [workspace] declaration. All crates are detected relative to this, and no special skipping behaviour (walking further up the directories) occurs when a package was not found (was previously happening in find_package()+member()).

Simplify the original code somewhat by making this feat more obvious, rejecting more invalid configurations.

When `cargo` scans for a workspace it simply walks up the directories
until finding the first `Cargo.toml` with a `[workspace]` declaration.
All crates are detected relative to this, and no special skipping
behaviour (walking further up the directories) occurs when a package was
not found (was previously happening in `find_package()+member()`).

Simplify the original code somewhat by making this feat more obvious,
rejecting more invalid configurations.
@MarijnS95 MarijnS95 merged commit 70046ed into master Nov 11, 2022
@MarijnS95 MarijnS95 deleted the linearize-workspace-detection branch November 11, 2022 09:41
MarijnS95 added a commit to MarijnS95/winit that referenced this pull request Nov 23, 2022
Since rust-mobile/cargo-subcommand#23 `cargo-apk`
now strictly searches for workspaces first before committing to finding
the right package _within said workspace_, and bails when no package was
selected since we don't support selecting (building, packaging, running)
>1 target currently.

Perhaps it's a bit hash to enforce this on free-form `cargo apk --`
invocations, but it is what it is.
MarijnS95 added a commit to rust-windowing/winit that referenced this pull request Nov 24, 2022
* ci: Don't use `$CMD` for Android doc building

Since migrating `cargo-apk` to `clap` [it is now annoying] to pass
unknown arguments to an underlying `cargo` command (like `cargo doc`):
fortunately generating docs doesn't need to go through `cargo apk` to
set up cross-compiler/linker environment variables at all.

[it is now annoying]: rust-mobile/ndk#363

* ci: Simplify

* ci: Explicitly build just the `winit` package on Android

Since rust-mobile/cargo-subcommand#23 `cargo-apk`
now strictly searches for workspaces first before committing to finding
the right package _within said workspace_, and bails when no package was
selected since we don't support selecting (building, packaging, running)
>1 target currently.

Perhaps it's a bit hash to enforce this on free-form `cargo apk --`
invocations, but it is what it is.
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.

None yet

2 participants