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

cargo: Add support for target specific dependencies #13780

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

xclaesse
Copy link
Member

@xclaesse xclaesse commented Oct 11, 2024

No description provided.

Add cfg token to be able to parse the top level cfg() function.

Fix parser which was creating a new iterator when recursing which causer
the caller function's iterator to not have advanced when recursing
function returns.
We'll need to evaluate those expressions before generating the AST.
Instead take a config key-value dictionary and evaluate the expression
to return a boolean.
@xclaesse xclaesse force-pushed the cargo-target-deps branch 2 times, most recently from 946ea69 to 763172c Compare October 25, 2024 15:02
@xclaesse
Copy link
Member Author

CI passed, any objection?

@eli-schwartz
Copy link
Member

First commit message has a typo: "causer" -> "caused".

I can't spot any obvious problems with the change but I would like to defer to @dcbaker on this as I don't know this subsystem very well.

@dcbaker
Copy link
Member

dcbaker commented Nov 1, 2024

The first patch seems fine.

The second means we can't reuse the same Meson generated between a host and build machine configuration, since now we've hard coded all of the machine info, nor could this parser be used in a generic meson translate command that takes a cargo manifest and produces a valid meson.build someone could use to start converting, that seems bad?

I'm in general concerned about hardcoding machine information into the cargo Interpreter, now that it's a a class and we store a single instance in Environment, although there isn't too much in this that looks difficult to refactor into a cross compatible soluton, apart from the thing above.

So, you have my RB for patches 1 and 3, but I'm absolutely not convinced by 2

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.

3 participants