-
Notifications
You must be signed in to change notification settings - Fork 6
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
Support autobins
and target renaming [lib]
and [[bin]]
#17
Conversation
I found some more peculiar details: [[bin]]
name = "cargo-subcommand" This matches the
So we should keep that in mind too - for this PR we should probably check for the file paths and error accordingly if it doesn't exist. |
not sure how to proceed here. is this ready for review? |
Discuss the review comments I opened, so that I can clean up and finalize this PR. I can also do the more elaborate target selection on my own first, if that's desired. Perhaps we should aim to land #15 first though. Forgot to mention that this approach doesn't add an extra |
I'd suggest we land #15 first and then see about this one. |
4ca5238
to
97481bd
Compare
I've only rebased this to resolve conflicts for now, we'll need to change Steps are pretty much going to be as follows:
Perhaps we can already do the filtering in between step 1 and 2, and then again only run auto target discovery for the target types that were enabled on the cmdline. Again though, it feels like we're seriously reinventing the wheel here trying to mimic |
@MarijnS95 Maybe using the
It feels like a perfect match for |
@quomaz both Then there are multiple crates to read information like this, there's also |
1f52870
to
f715c99
Compare
f715c99
to
c20ac24
Compare
…[[example]]` renames (#26) rust-mobile/cargo-subcommand#17
Fixes rust-mobile/cargo-apk#7
@dvc94ch this WIP PR pulls the lib rename changes out of #15 and expands it with similar changes for
[[bin]]
and supportingautobins=false
. We'll have to rework whatArtifact
s to return to the user given that by default the library and all binary targets are built: https://doc.rust-lang.org/cargo/commands/cargo-build.html#target-selection. This is different forcargo run
which only picks one binary target (I think from the shared pool ofsrc/main.rs
,src/bin/*
, and any other file specified through[[bin]]
) and otherwise errors out.At the same time I'm thinking about renaming
Root
toLib
andBin
or otherwise passing such information, so that a caller likecargo-apk
knows what it builds (and error accordingly, sincecargo-apk
always tries to packagelib<artifact>.so
when it is in fact a binary... resulting in the usual cryptic errors).