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.
Add DEFAULT_VERSIONS+=rust=rust-nightly to make.conf(5) if you want to
build consumers using lang/rust-nightly.
Approved by: rust (tobik)
MFH: 2019Q1 (avoid merge conflicts during www/firefox updates)
Differential Revision: https://reviews.freebsd.org/D18634
`cargo install` currently fails with:
error: Using `cargo install` to install the binaries for the package
in current working directory is no longer supported, use `cargo
install --path .` instead.
Also see https://github.com/rust-lang/cargo/issues/5327
- libgit2 in ports is nowadays newer than bundled version
- libssh2 was already unbundled until 1.29.0 update
- Unbundle libssh2 for USES=cargo (unused atm)
PR: 231411
Approved by: rust (dumbbell, tobik)
This will make maintaining ports easier when upstream does not
provide a Cargo.lock on its own.
It uses the crate registry and will output the newest crate versions
available based on the restrictions in Cargo.toml. As such subsequent
runs of `make cargo-crates` might not generate the same output.
Upstream should still be encouraged to provide Cargo.lock if possible.
Requested by: mat
Differential Revision: https://reviews.freebsd.org/D17003
cargo.mk is still too eager in splitting a crate's name and version
in two when the name contains a dash followed by a number. For
example with utf-8-0.7.4 the wrong URL ends up being used in
MASTER_SITES
.../utf/8-0.7.4/download/...
instead of
.../utf-8/0.7.4/download/...
PR: 230413
Reported by: Thomas Hurst <tom@hur.st>
- Add build/lib dependencies, environment variables to ports using
the backtrace-sys, freetype-sys, gettext-sys, onig_sys,
thrussh-libsodium crates instead of doing this individually for
every port.
- Add a DEV_WARNING when using libc versions < 0.2.37 to prevent
instability of Rust applications on 12.0-CURRENT [1]
- Sort cargo-crates-licenses output
Reviewed by: pizzamig, jbeich [1]
Differential Revision: https://reviews.freebsd.org/D15463
The flag has partial support across the tree, and the same effect
can be obtained by using ".undef WITH_DEBUG".
Reviewed by: mat, rene
Approved by: portmgr (rene)
Differential Revision: https://reviews.freebsd.org/D12548
cargo.mk is a little too eager in splitting a crate's name and version
in two when the version contains a dash (e.g. csv-1.0.0-beta.4) and
the wrong URL ends up being used in MASTER_SITES e.g.
.../csv-1.0.0/beta.4/download/...
instead of the correct one
.../csv/1.0.0-beta.4/download/...
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D12628
Cargo started to ship with Rust in 1.19.0_2. I forgot to indicate the
port revision in the 1.19.0_2 commit.
Reported by: jbeich@
Differential Revision: https://reviews.freebsd.org/D12460