Xavier Claessens
42a4d1aaa0
cargo: Ignore Cargo.lock if toml implementation is missing
...
It is only required if a Cargo subproject is actually configured.
3 months ago
Jussi Pakkanen
0d7bb776e2
Move OptionKey in the option source file.
4 months ago
Sebastian Wick
c199faf980
cargo: Fall back to the checksum in Cargo.lock metadata table
...
In ansi_term-0.12.1 the packages do not have a checksum entry but it can
be found in the global metadata table.
5 months ago
Xavier Claessens
9b8378985d
cargo: Load Cargo.lock
...
Cargo.lock is essentially identical to subprojects/*.wrap files. When a
(sub)project has a Cargo.lock file this allows automatic fallback for
its cargo dependencies.
5 months ago
Jussi Pakkanen
181c3499fd
Fix mypy.
5 months ago
Jussi Pakkanen
5365d9a842
Refactor option classes to their own file.
6 months ago
Charles Brunet
dacb25db10
Improve error messages for invalid option values
...
By adding the option name to UserOption object, it is now possible to
display the name of the affected option when the given option value is
not valid.
Fixes #12635
8 months ago
Xavier Claessens
4d3fb88753
cargo: Add API version into dependency name
8 months ago
Xavier Claessens
3f73aaed2d
cargo: Ensure Dependency.package always has a value
8 months ago
Alyssa Ross
e9ee63ed03
cargo: support lib.path in Cargo.toml
...
Cargo implements this configuration option to override the entry point
of the library.
To get test coverage, I've modified one of the two Cargo subprojects
in the test to use a non-default library entrypoint. The other still
uses the default.
9 months ago
Xavier Claessens
435e881c18
cargo: Call into meson subdir if it exists
...
This allows projects to manually add extra rust args and deps. This is
intended to replace build.rs logic.
9 months ago
Xavier Claessens
4d55645c39
cargo: Abort if features are missing
9 months ago
Xavier Claessens
114e032e6a
cargo: Expose features as Meson boolean options
9 months ago
Xavier Claessens
d075bdb3ca
cargo: Use coredata.stable_version
...
This avoids generated code print warnings when using features introduced
in current dev cycle.
9 months ago
Xavier Claessens
8ca5977572
cargo: Builder: method() object can be any BaseNode
...
StringNode for example also have methods.
9 months ago
Xavier Claessens
53ba7196b9
cargo: Builder: Add support for "!=", "in" and "not in" operators
9 months ago
Xavier Claessens
6cce6c51bf
cargo: Builder: Add support for "+", "+=", "if" and "foreach"
9 months ago
Dylan Baker
55d30b61ff
rust: Add `--extern proc_macro` in `rust.proc_macro() not in cargo translation
...
Cargo does this by default, so it's reasonable that we do the same.
Fixes : #12758
10 months ago
Alaska
b2000620f4
cargo subprojects: don't assume each target has dependencies
...
Previously, creating a meson wrap with "method=cargo"
for https://github.com/sunfishcode/is-terminal would fail,
because its Cargo.toml contains a [target] section without
dependencies.
Instead, we now fall back to an empty list in case of no specified dependencies
(like everywhere else in "_convert_manifest")
1 year ago
Xavier Claessens
3af0632c3d
cargo: Use rust_abi and rust.proc_macro() instead of rust_crate_type
1 year ago
Xavier Claessens
dc329f0f04
interpreter: Add support for cargo subproject
1 year ago
Xavier Claessens
ea42d2d019
cargo: Fix '1.0.45' version conversion
...
The middle 0 was wrongly dropped.
1 year ago
Xavier Claessens
019a0c38c6
cargo: Support all crate library types
1 year ago
Xavier Claessens
d6bf48cd7e
cargo: Package description is optional
1 year ago
Xavier Claessens
3a16da39ad
cargo: Add support for rust_dependency_map
1 year ago
Xavier Claessens
3abe52133d
cargo: Use "-rs" suffix convention to lookup for Rust dependencies
1 year ago
Xavier Claessens
f752efdd88
cargo: interpreter: Reorganize functions order
...
Keep _create_foo() functions together and with a common signature.
That's cleaner especially since we are going to add more of them.
1 year ago
Xavier Claessens
05d5055d85
cargo: Remove unused function
1 year ago
Xavier Claessens
3334addbbd
cargo: Builder: Add dict support
1 year ago
Xavier Claessens
b5b952688f
cargo: builder: Remove all duplicated functions
...
Keep only the Builder class, there is no point in duplicating
everything.
1 year ago
Charles Brunet
5b29eff8ad
parser: simplify other node constructors
1 year ago
Charles Brunet
0f4891cdf4
parser: simplify Assignment and PlusAssignment nodes
1 year ago
Charles Brunet
02ff9553db
parser: add SymbolNode to preserve operators
1 year ago
Charles Brunet
306562b466
parser: use IdNode for function name and assignment name
1 year ago
Charles Brunet
5707d39017
parser: preserve number base
1 year ago
Eli Schwartz
0bb1647fd1
move various bits of type-checking only code to TYPE_CHECKING blocks
...
Mostly detected with flake8-type-checking. Also quote T.cast() first
arguments, since those are not affected by future annotations.
1 year ago
Dylan Baker
f02e26877d
cargo/interpreter: Implement an interpreter for Cargo TOML
...
This converts a Cargo TOML file into Meson AST
Co-Authored-By: Thibault Saunier <tsaunier@igalia.com>
1 year ago
Dylan Baker
4017dab484
cargo/cfg: Add a parser for the rust/cargo cfg() expressions
...
This uses a recursive descent parser + lexer to create an IR from cfg()
expressions, which it then converts into meson IR.
1 year ago
Dylan Baker
5e59e5a9e4
cargo/version: add a function to convert cargo versioning to meson
1 year ago
Dylan Baker
b01ae087f5
cargo: Add a builder module to the cargo package
...
This is a helper, currently only used by cargo. It could be moved later
if there are other users.
1 year ago
Dylan Baker
71325547aa
cargo/manifest: Add a file with type definitions of the cargo manifest format
...
Co-Authored-By: Thibault Saunier <tsaunier@igalia.com>
1 year ago