Commit Graph

16 Commits

Author SHA1 Message Date
Enrico Scholz
5fe47418ba cargo_common: use 'config.toml' instead of plain 'config'
cargo configuration has been renamed from plain 'config' to
'config.toml' in rust-1.38.

Using the old name is still supported but creates warnings like

| $ cargo
| warning: `/sdk.../home/cargo/config` is deprecated in favor of `config.toml`
| note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`

Use the new name.

(From OE-Core rev: 94b7d1a6cdb44949f8a96213ff2e45fafd759442)

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-25 12:17:22 +00:00
Chris Spencer
0043986334 cargo_common.bbclass: Support git repos with submodules
This is useful for cargo dependencies specified as git repositories, where
those repositories themselves have submodules that need to be checked out.

(From OE-Core rev: f871d9d6094ec0001d826e4b5b3395c1842631bb)

Signed-off-by: Chris Spencer <spencercw@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-08 14:28:49 +01:00
Peter Marko
7afa4f50b4 cargo: remove True option to getVar calls
Layer cleanup similar to
https://git.openembedded.org/openembedded-core/commit/?id=26c74fd10614582e177437608908eb43688ab510

(From OE-Core rev: 9a2ed52473a3e4eb662509824ef8e59520ebdefb)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-06-27 13:03:34 +01:00
Richard Purdie
71c6db8e65 recipes: Start WORKDIR -> UNPACKDIR transition
Replace references of WORKDIR with UNPACKDIR where it makes sense to do
so in preparation for changing the default value of UNPACKDIR.

(From OE-Core rev: 1f18b9a512800860d5153d89eb82b56388efad6f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-21 12:08:04 +01:00
Alex Kiernan
6543d3c5e9 cargo: Add CARGO_LOCK_PATH for path to Cargo.lock
When building a workspace enabled project, the Cargo.lock is found at
the root of the project, not alongside the Cargo.toml. Expose
CARGO_LOCK_PATH so it can be explicitly configured.

(From OE-Core rev: 30159f88a97c73d234f69c5800ba2adb0e26ad44)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09 19:17:11 +00:00
Alex Kiernan
dddfe1e3f4 rust: cargo: Convert single-valued variables to weak defaults
All of these variables are single-valued, so we can use weak-defaults
for them and only see the final assignment after parsing.

(From OE-Core rev: 3221e82a35a149fdf38fe66dcd5de758ac1b9185)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09 19:17:11 +00:00
Alex Kiernan
43df94f7af cargo: Move CARGO_MANIFEST_PATH/CARGO_SRC_DIR to cargo_common
cargo_common_do_configure uses CARGO_MANIFEST_PATH (which depends on
CARGO_SRC_DIR), but their definition was in cargo.bbclass.

(From OE-Core rev: 740374a13ad5359767b421666decf50c158ea0df)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09 19:17:11 +00:00
Alex Kiernan
a8f959a8d3 cargo: Rename MANIFEST_PATH -> CARGO_MANIFEST_PATH
This variable is a piece of recipe configurable interface, scope it with
the class name to make that clear.

(From OE-Core rev: 0101de25832fbed3d08cd522512784133c628cad)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08 16:58:34 +00:00
Frederic Martinsons
2dd04232e7 cargo_common.bbclass: Handle Cargo.lock modifications for git dependencies
Now we use --frozen, Cargo.lock cannot be modified by cargo build.
These patched git dependencies requires that the git url is removed
from Cargo.lock.

Fixes #15104

(From OE-Core rev: b80f756dd480fc92f58d7e10105d3a2427a32795)

Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-09 13:22:00 +01:00
Alexander Kanavin
9400e5bd58 time64.inc: annotate and clean up recipe-specific Y2038 exceptions
Additionally:
- drop pseudo from INSANE_SKIP for 32bit time API check
(pseudo passes the check; it's not clear where the issue may have been)

- move rust exceptions to the cargo class, as the problem
is common across the ecosystem, and needs to be fixed in the
libc crate.

(From OE-Core rev: d3d406bf636e579c17708b408e11c12d252533ee)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-28 23:02:50 +01:00
Alexander Kanavin
fa8b714d7a cargo.bbclass: set up cargo environment in common do_compile
cargo_do_compile runs only if the recipe is built using cargo
as the top level tool. Some recipes hide usage of cargo inside setuptools
(or autoconf) and use do_compile definitions specific to those,
and so the environment isn't properly set up.

This was exposed by latest versions of python3-cryptography.

(From OE-Core rev: 9f4ff643a028d7f5670d80861f2ce19ca2d90faa)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-27 16:23:40 +01:00
Frederic Martinsons
ddf65370a9 cargo_common.bbclass: add support of user in url for patch
To handle url like git://git@repo/project

(From OE-Core rev: ad99ede096aff03c974b8725d90d3c9d1056bae0)

Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 11:36:26 +01:00
Alex Kiernan
0d099fa404 cargo_common.bbclass: Support local github repos
Since disable network was added cargo configurations which reference git
repos fail as they attempt to fetch across the network as part of
do_compile, even if EXTRA_OECARGO_PATHS to add them as part of `paths`
is used, as this is documented as only working for packages which exist
in crates.io.

Add parsing of the SRC_URIs for git repos and include `[patch]` sections
to redirect to the checked out source repos which the bitbake fetcher
has already populated.

There are still cases which don't work - if you have multiple copies of
the same repo with different revisions, there's currently no way to
represent that and anything using a repo which has a virtual manifest
will fail to build (see https://github.com/rust-lang/cargo/issues/4934).

(From OE-Core rev: 684a8af41c5bb70db68e75f72bdc4c9b09630810)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-01 11:36:26 +01:00
Alex Kiernan
d9e944a0e8 cargo_common.bbclass: Fix typos
(From OE-Core rev: c7a92180b21e75a84f632e4c16e63dc1f4861a00)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-01 17:34:58 +00:00
Khem Raj
081a3655fb cargo_common.bbclass: Add missing space in shell conditional code
Fixes cofigure errors in rust recipes e.g.

tmp/work/riscv32-yoe-linux-musl/rust/1.62.1-r0/temp/run.setup_cargo_environment.3047487: line 215: [: missing `]'

(From OE-Core rev: 9ff2817536f4b568e702470789efeab0008d73a0)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-21 22:51:43 +01:00
Richard Purdie
fd1517e2b5 classes: Update classes to match new bitbake class scope functionality
Move classes to classes-global or classes-recipe as appropriate to take
advantage of new bitbake functionality to check class scope/usage.

(From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12 15:27:17 +01:00