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.

@xclaesse xclaesse force-pushed the cargo-target-deps branch 3 times, most recently from 763172c to a7f206c Compare October 26, 2024 22:24
@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

@xclaesse
Copy link
Member Author

xclaesse commented Nov 17, 2024

@dcbaker cfg cannot be done in meson.build because it enables features which are global. By the point you interpret the generated meson.build it's too late. I think the meson translate idea is just a lost cause, that cannot work.

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

Fix parser which was creating a new iterator when recursing which caused
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
Copy link
Member Author

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

fixed.

@@ -34,6 +33,7 @@
from .. import mparser
from ..environment import Environment
from ..interpreterbase import SubProject
from ..compilers.rust import RustCompiler

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'RustCompiler' is not used.
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