Created attachment 263870 [details] patch Currently Mk/Uses/cargo.mk builds purely Rust ports. The attached patch allows to build ports that are in other languages but that have Rust parts. In short: Ports that build Rust subprojects would define CARGO_SRC_SUBDIR=path/to/rust/subproject. This adjusts paths where vendored crates are supplied (.cargo/config.toml). This also makes CARGO_BUILD, CARGO_INSTALL, CARGO_TEST to default to "no", because these would be invoked by the project. For an example please see the cad/librepcb patch in the dependent PR.
s/subdurectory/subdirectory/ Does it break existing port? Feel free to commit it if there is no fallout.
(In reply to Mikael Urankar from comment #1) Thanks for a quick approval, Mikael. I've built ~20 Rust ports and there doesn't seem to be any breakage.
Committed.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=310d28456b124865b43f95dfceed14942a70f622 commit 310d28456b124865b43f95dfceed14942a70f622 Author: Yuri Victorovich <yuri@FreeBSD.org> AuthorDate: 2025-09-18 19:08:12 +0000 Commit: Yuri Victorovich <yuri@FreeBSD.org> CommitDate: 2025-09-19 02:02:02 +0000 Mk/Uses/cargo.mk: Allow to build Rust subprojects cargo-based ports can now set CARGO_SRC_SUBDIR=path/to/rust/subproject and it will be configured correctly. The build/install/test phases would be done by the enclosing project. PR: 289659 Approved by: mikael@ (on behalf of rust@) Mk/Uses/cargo.mk | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-)
It seems this patch breaks some ports (I don't have an exhaustive list: devel/parol devel/parol-ls devel/py-qcs-sdk-python error: failed to load manifest for workspace member `/wrkdirs/usr/ports/devel/parol/work/parol-1.0.1/crates/.cargo` referenced via `crates/*` by workspace at `/wrkdirs/usr/ports/devel/parol/work/parol-1.0.1/Cargo.toml` Caused by: failed to read `/wrkdirs/usr/ports/devel/parol/work/parol-1.0.1/crates/.cargo/Cargo.toml` Caused by: No such file or directory (os error 2) *** Error code 101 Something needs to be adjusted in such ports?
(In reply to Mikael Urankar from comment #5) Hi Mikael, Thanks for reporting the failing ports. This is caused by a quite special unanticipated condition. I will fix these shortly. There might be other ports like this.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=4f8b9cbc02461fbcc38f91daa1764f3385e19221 commit 4f8b9cbc02461fbcc38f91daa1764f3385e19221 Author: Yuri Victorovich <yuri@FreeBSD.org> AuthorDate: 2025-09-20 09:13:15 +0000 Commit: Yuri Victorovich <yuri@FreeBSD.org> CommitDate: 2025-09-20 09:31:36 +0000 devel/parol{,-ls}: Fix build by adjusting top-level Cargo.toml PR: 289659 devel/parol-ls/Makefile | 8 +++++--- devel/parol-ls/files/patch-Cargo.toml (new) | 13 +++++++++++++ devel/parol/Makefile | 8 +++++--- devel/parol/files/patch-Cargo.toml (new) | 13 +++++++++++++ 4 files changed, 36 insertions(+), 6 deletions(-)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=5b29ffd394cbe7b9b327c0b1b51e4576d928f067 commit 5b29ffd394cbe7b9b327c0b1b51e4576d928f067 Author: Yuri Victorovich <yuri@FreeBSD.org> AuthorDate: 2025-09-20 09:43:32 +0000 Commit: Yuri Victorovich <yuri@FreeBSD.org> CommitDate: 2025-09-20 09:44:13 +0000 devel/py-qcs-sdk-python: Fix build by adjusting top-level Cargo.toml PR: 289659 devel/py-qcs-sdk-python/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
(In reply to Yuri Victorovich from comment #6) I couldn't find other ports with the same problem, closing. Thanks for the quick fix.