While maintaing a rust application, I found a cargo.toml that specifies
the git URL with { git="https://..." }, cargo.mk expects a form like { git = "https://" }.
This patch improve the regex making the spaces around the '=' optional
Test: built all ports using the CARGO_USE_GIT feature
Approved by: tobik
Differential Revision: https://reviews.freebsd.org/D29805
MASTER_SITES aliases processing in the framework is very inefficient
and the CRATESIO indirection is not worth it. Normally ports only
have a handful of sites at most, but USES=cargo currently adds one
site for each crate by necessity. The inefficiency suddenly matters
a lot.
By consuming MASTER_SITE_CRATESIO directly we can sidestep this
issue without losing anything.
Before:
$ time make -C www/zola -V MASTER_SITES >/dev/null
4.21 real 4.14 user 0.03 sys
After:
$ time make -C www/zola -V MASTER_SITES >/dev/null
0.60 real 0.58 user 0.02 sys
Build scripts might build bundled libraries but non-error output
is hiddden by cargo. Given a crate with large enough bundled library
(looking at you rusty_v8) the build just sits there in silence
forever and you do not know what is happening or if anything is
happening at all. This also makes Poudriere build logs less useful.
Pass an additional --verbose to cargo to get more noisy output.
https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script
- This Rust release comes with LLVM 10. Drop the LLVM patches we
no longer need.
- On FreeBSD 13.0 powerpc64 set the elfv2 ABI explicitly in the
Rust target instead of patching LLVM.
- Build LLVM with Ninja. It can shorten the build time slightly.
- Force rebuild all consumers to catch regressions early
Changes: https://blog.rust-lang.org/2020/07/16/Rust-1.45.0.html
Tested by: mikael, pkubaj, tobik
With hat: rust
Differential Revision: https://reviews.freebsd.org/D25658
- Remove devel/cargo-tree since it is now integrated into cargo
- Add patch to fix build with LibreSSL 3.1.x and 3.2.0 [1]
- Force rebuild all consumers to catch regressions early
Changes: https://blog.rust-lang.org/2020/06/04/Rust-1.44.0.html
PR: 246332 [1]
Tested by: mikael, tobik
With hat: rust
Differential Revision: https://reviews.freebsd.org/D25099
- Add workaround to fix build when CC/CXX have "clang" in them [1]
- Respect AR to fix build with external toolchains [2]
- Force rebuild all consumers to catch regressions early
Changes: https://blog.rust-lang.org/2020/04/23/Rust-1.43.0.html
PR: 238556 [1], 245583 [2]
Reported by: Matthias Apitz <guru@unixarea.de> [1], Greg V <greg@unrelenting.technology> [2]
Tested by: mikael, pkubaj, tobik
With hat: rust
Differential Revision: https://reviews.freebsd.org/D24521
A crate spec like curl-sys-0.4.30+curl-7.69.1 was incorrectly
interpreted as having a name of 'curl-sys-0.4.30+curl' instead of
'curl-sys' and failed to fetch as a consequence.
Crate names can only be composed of a limited character set [1].
Limit the regular expressions to that set and make them less greedy.
[1] https://doc.rust-lang.org/cargo/reference/manifest.html#the-name-field
PR: 244977
Reported by: jbeich
CARGO_FEATURES is overloaded to accept --no-default-features as a
special token which will set CARGO_{BUILD,INSTALL,TEST}_ARGS
appropriately. This is done in preference over introducing yet
another knob.
- Force rebuild all consumers to fix potential miscompilations with
1.41.0
- Enable SOURCES by default. The sources are indexed by RLS and
required for it to function properly, so they should be available
by default. This also makes sure we test the option properly.
- Remove implied --config=config.toml from x.py args
- Switch to the upstreamed backtrace crate patches like rust-nightly
- Enable WASM by default [0]
- Strip libraries (D23650) [1]
- Simplify plist generation (D23735) [2]
Changes: https://blog.rust-lang.org/2020/02/27/Rust-1.41.1.html
Submitted by: mikael [0,1,2]
With hat: rust
Differential Revision: https://reviews.freebsd.org/D23835
- Force rebuild all consumers to catch regressions early
- Switch to cross-compiled (from amd64) bootstraps for all
architectures generated with the incoming lang/rust-bootstrap
- Update cargo-c to 0.5.2 to unbreak librav1e build
- Make use of regular MAKE_ENV/TEST_ENV in lang/rust
- Turn on RUST_BACKTRACE in lang/rust and USES=cargo to hopefully
produce more useful failure logs when something panics during
builds
Changes: https://blog.rust-lang.org/2020/01/30/Rust-1.41.0.html
Tested by: mikael, tobik
With hat: rust
Differential Revision: https://reviews.freebsd.org/D23385
Remove yet another install metadata file. This should all be
replaced with --no-track once it is part of lang/rust.
https://github.com/rust-lang/cargo/pull/7560
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: .crates2.json
This attempts to provide a nicer error message for the subset of
users who build their own kernels without COMPAT_FREEBSD11 and then
attempt to build lang/rust. The Rust ecosystem currently uses
pre-ino64 syscalls, so building lang/rust without COMPAT_FREEBSD11
is not going to work.
The error message for this is non-obvious and there is a new bug
for this at least every 1-2 months. Hopefully this will improve
the situation a little.
Cargo and Gecko ports are similarly affected, so add the pre-build
check to them too.
Reviewed by: jbeich, mikael.urankar@gmail.com
Tested by: madpilot (negative case)
Approved by: gecko (jbeich)
Differential Revision: https://reviews.freebsd.org/D23100
Cargo vendoring can be useful even for ports that use other build
systems like Meson to call Cargo for the actual build. Often they
use the framework's default do-configure which USES=cargo should
not overwrite.
Remove hacks from games/jaggedalliance2 and x11/squeekboard.
Reviewed by: jbeich
Differential Revision: https://reviews.freebsd.org/D22619
The backtrace-sys crate no longer needs gmake since 0.1.20.
sysutils/flowgger still uses backtrace-sys-0.1.14. Since it is the
only USES=cargo port left that needs it, move the gmake dependency
directly to it instead.
lang/rust currently has backtrace-sys-0.1.30. It also vendors
jemalloc-sys (which also needs gmake to build) but it is hidden
behind rustc's jemalloc feature which we do not currently activate.
It should be safe to remove gmake in lang/rust too.
PR: 242267
Reported by: mikael.urankar@gmail.com
We'll have a new abi on ppc64 soon (ELFv2) which is incompatible with the ELFv1 abi. We need to detect the abi on which we build stuff.
Submitted by: mikael_urankar@gmail.com
Approved by: portmgr (earlier version)
Differential Revision: https://reviews.freebsd.org/D22039
This is a workaround to add some manual "support" for Cargo projects
that use workspaces where the current method of patching is not
good enough as it causes the various Cargo.toml to point to the
wrong directory. With CARGO_GIT_SUBDIR maintainers can control the
patching process a little and point things to the correct subdirectories.
CARGO_GIT_SUBDIR= <group>:<crate name>:<subdir under ${WRKSRC_group}>
This is needed for alacritty 0.4.0-rc2 where the glutin sources are
under ${WRKSRC_glutin}/glutin and not just ${WRKSRC_glutin}. This
causes the following issue:
error: failed to load source for a dependency on `glutin`
Caused by:
Unable to update .../x11/alacritty/work/glutin-7e479d
Caused by:
found a virtual manifest at `.../x11/alacritty/work/glutin-7e479d/Cargo.toml` instead of a package manifest
For glutin we would set CARGO_GIT_SUBDIR=glutin:glutin:glutin to
work around this problem and point the build to
.../x11/alacritty/work/glutin-7e479d/glutin instead.
Fix CARGO_USE_GIT{HU,LA}B when Cargo.toml has URLs that end with
/. This is needed for audio/spotifyd 0.2.16 which has an entry
like
structopt = { git = "https://github.com/TeXitoi/structopt/", rev = "..." }
$ make check-sanity
/!\ geckodriver-0.24.0: Makefile warnings, please consider fixing /!\
CARGO_CRATES=libc-0.2.43 may be unstable on aarch64 or not build on armv6,
armv7, powerpc64. Consider updating to the latest version (higher than 0.2.49).
This will give it at least a chance to build on tier 2 archs. We
bumped libc earlier but this was regressed on in r506813.
The libc warnings in USES=cargo do not seem to be enough. Make
them errors instead.
With hat: rust
Crates like openssl-src-111.3.0+1.1.1c have characters not in
[a-zA-Z0-9]. Use the complement of [a-zA-Z0-9] instead of adding
+ to the list of chars [-.] we currently handle.
It can be used to overwrite the --path argument when calling `cargo
install` to point cargo to different local crates to install. This
might be necessary when ${WRKSRC}/Cargo.toml is only a virtual
manifest.
Cargo normalizes Cargo.toml when crates are published. It creates
a Cargo.toml.orig to preserve the original. Rename them to not
interfere with makepatch and avoid creating a bunch of useless
and wrong files/patch-*Cargo.toml.
Suggested by: mat
Some crates are optional via Cargo features or are only used during
tests, however the framework has no way to discriminate between
test or run dependencies using just CARGO_CRATES leading to more
run dependencies than necessary for some packages. With more ported
Rust applications it's time to let individual ports make that
decision now.
The environmental setup to use dependencies from ports instead of
bundled ones and implied build dependencies (cmake, gmake, pkgconf)
are left in place for now.
Assign cargo.mk to rust@ while here.
- Update devel/racer to latest version that can build with 1.34.0
- Drop no longer needed patch from textproc/ripgrep
- Force rebuild all consumers to catch regressions early
Thanks to Mikaël Urankar for providing updated bootstraps for
aarch64, armv6, armv7, powerpc64.
Changes: https://blog.rust-lang.org/2019/04/11/Rust-1.34.0.html
Reviewed by: jbeich
With hat: rust
Differential Revision: https://reviews.freebsd.org/D19850
- Add a CARGO_USE_GITHUB equivalent for GitLab instances,
CARGO_USE_GITLAB
- Replace CARGO_GH_CARGOTOML with a ${FIND} and just patch
all Cargo.toml under ${WRKDIR}. It is too tedious to find all
the Cargo.toml that need patching manually due to transitive
dependencies.