Created attachment 213290 [details] Append --prefix to CARGO_BUILD_ARGS, unless already set My PREFIX is set to /opt and multimedia/librav1e failed to stage overnight: ... ===> Staging for librav1e-0.3.1_3 ===> Generating temporary packing list Finished release [optimized + debuginfo] target(s) in 0.16s Building pkg-config file Installing pkg-config file Installing header file Installing static library Installing shared library strip: open /spare/usr/ports/multimedia/librav1e/work/stage/opt/lib/*.so failed: No such file or directory *** Error code 1 Indeed, instead of ${STAGEDIR}/opt, the port installed under ${STAGEDIR}/usr/local ... Maybe, some day, our wonderful automated build-tools will learn to catch these errors too. Though adding `--prefix ${PREFIX}` to the port is easy, I think, this fix belongs to Mk/Uses/cargo.mk -- for all cargo-using ports.
Mk/Uses/cargo.mk is maintained by rust@, not portmgr@.
Comment on attachment 213290 [details] Append --prefix to CARGO_BUILD_ARGS, unless already set > +.if ! ${CARGO_BUILD_ARGS:M--prefix*} > +CARGO_BUILD_ARGS+= --prefix ${PREFIX:Q} > +.endif --prefix is not supported by "cargo build" unlike "cargo cbuild". What fixed multimedia/librav1e now breaks multimedia/rav1e: =======================<phase: build >============================ ===> Building for rav1e-0.3.1_2 error: Found argument '--prefix' which wasn't expected, or isn't valid in this context USAGE: cargo build --manifest-path <PATH> --release --verbose For more information try --help *** Error code 1
USES=cargo ports are already PREFIX-safe unless they are doing something special. Anyway `cargo build` does not take a --prefix argument (Jan has already posted the error), so this patch is nonsense and rejected since it would break every USES=cargo port. librav1e is abusing CARGO_BUILD_ARGS for `cargo cinstall` and should be fixed instead to not use CARGO_BUILD_ARGS or pass --prefix itself.
A commit references this bug: Author: jbeich Date: Sat Apr 11 16:18:18 UTC 2020 New revision: 531433 URL: https://svnweb.freebsd.org/changeset/ports/531433 Log: multimedia/librav1e: unbreak PREFIX != LOCALBASE $ poudriere testport -Pj 113i386 multimedia/librav1e [...] strip: open /wrkdirs/usr/ports/multimedia/librav1e/work/stage/prefix/librav1e-0.3.1_3/lib/*.so failed: No such file or directory PR: 245536 Reported by: mi Changes: head/multimedia/librav1e/Makefile
A commit references this bug: Author: jbeich Date: Sat Apr 11 16:19:19 UTC 2020 New revision: 531434 URL: https://svnweb.freebsd.org/changeset/ports/531434 Log: MFH: r531433 multimedia/librav1e: unbreak PREFIX != LOCALBASE $ poudriere testport -Pj 113i386 multimedia/librav1e [...] strip: open /wrkdirs/usr/ports/multimedia/librav1e/work/stage/prefix/librav1e-0.3.1_3/lib/*.so failed: No such file or directory PR: 245536 Reported by: mi Approved by: ports-secteam blanket Changes: _U branches/2020Q2/ branches/2020Q2/multimedia/librav1e/Makefile
(In reply to Tobias Kortkamp from comment #3) > librav1e is abusing CARGO_BUILD_ARGS for `cargo cinstall` and should be > fixed instead to not use CARGO_BUILD_ARGS or pass --prefix itself. This is intentional. librav1e needs USES=cargo while "cargo cbuild" shares "cargo build" flags e.g., - --release dependeding on WITH_DEBUG - --features, --all-features, --no-default-features depending on CARGO_FEATURES Discrepancy in flags is either due to bugs in cargo-c or historical raisins in cargo (e.g., --release default).
(In reply to commit-hook from comment #4) > multimedia/librav1e: unbreak PREFIX != LOCALBASE This is not quite accurate, for the record. LOCALBASE is also /opt on the system, where the error manifested. Thanks for the prompt fix!