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

Support for building cargo examples #134

Open
madsmtm opened this issue Sep 4, 2023 · 4 comments
Open

Support for building cargo examples #134

madsmtm opened this issue Sep 4, 2023 · 4 comments

Comments

@madsmtm
Copy link
Member

madsmtm commented Sep 4, 2023

It would be nice if xbuild supported building cargo examples, so I could do e.g. x build --device=my_device --examples=my_example

@MarijnS95
Copy link
Member

Been annoyed by lack of this as well, but never got around to it. PRs welcome!

@dvc94ch
Copy link
Contributor

dvc94ch commented Sep 4, 2023

The problem is that I'd rather we don't have to reimplement cargo. Anyone know of the status of the cargo libraryfication that was a topic a few years back?

@MarijnS95
Copy link
Member

Likely still nothing more than a topic? I haven't followed up on it, honestly.

@EriKWDev
Copy link

EriKWDev commented Apr 1, 2024

cargo doesn't currently support multiple lib targets. One can workaround this by using [[example]] for the time being rust-lang/cargo#8628 (comment)

My company has a very specific cargo setup for our game and engine which uses the [lib] inside our target for a sub-section of the game whereas the [[bin]]s are used for the actual game. x build seems to assume that the default lib is the one to build (it also ignores the name of the lib btw and assumes the lib and crate have the same name...).

Being able to instead supply a --example would make this work.

Re-implementing cargo is of course not what you should aim for, but similar to cargo flamegraph which supports examples I think a build tool should too.

This is a blocker for xbuild to be used atm

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

No branches or pull requests

4 participants