Commit graph

52 commits

Author SHA1 Message Date
Tobias Kortkamp
debce79335 Mk/Uses/cargo.mk: Allow disabling default features via CARGO_FEATURES
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.
2020-03-04 15:00:17 +00:00
Tobias Kortkamp
daf2ea4a45 lang/rust: Update to 1.41.1
- 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
2020-02-27 15:22:28 +00:00
Tobias Kortkamp
83209114b8 lang/rust: Update to 1.41.0
- 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
2020-01-30 20:00:06 +00:00
Tobias Kortkamp
5e9a789ce5 Mk/Uses/cargo.mk: Unbreak install with rust-nightly
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
2020-01-23 09:08:34 +00:00
Tobias Kortkamp
83096313be lang/rust: Add COMPAT_FREEBSD11 canary
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
2020-01-13 18:36:04 +00:00
Tobias Kortkamp
6474c40f73 lang/rust: Update to 1.40.0
- 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/12/19/Rust-1.40.0.html
Tested by:	mikael.urankar@gmail.com, tobik
With hat:	rust
Differential Revision:	https://reviews.freebsd.org/D22843
2019-12-19 16:14:48 +00:00
Tobias Kortkamp
a775a5b8ec Mk/Uses/cargo.mk: Do not override do-configure
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
2019-12-01 08:43:43 +00:00
Tobias Kortkamp
24db7d8caa lang/rust, Mk/Uses/cargo.mk: Drop gmake build dependency for backtrace-sys
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
2019-11-29 22:12:35 +00:00
Piotr Kubaj
95a1d26f49 Mk/bsd.port.mk: detect powerpc64 abi
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
2019-11-29 15:02:14 +00:00
Tobias Kortkamp
ab415159b8 Mk/Uses/cargo.mk: Add CARGO_GIT_SUBDIR hook to provide hints for CARGO_USE_GIT*
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.
2019-11-19 21:08:10 +00:00
Tobias Kortkamp
2fe5565445 lang/rust: Update to 1.39.0
- Force rebuild all consumers to catch regressions early
- Partially apply D20792 in preparation for PPC_ABI support
- Add LibreSSL 3.0.x support [1]

Thanks to Mikaël Urankar for providing updated bootstraps for
aarch64, armv6, armv7, powerpc64.

Changes:	https://blog.rust-lang.org/2019/11/07/Rust-1.39.0.html
PR:		241411 [1]
Tested by:	mikael.urankar@gmail.com, tobik
With hat:	rust
Differential Revision:	https://reviews.freebsd.org/D22240
2019-11-07 18:07:20 +00:00
Tobias Kortkamp
79acffacdf Mk/Uses/cargo.mk: Handle git URLs that end with /
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 = "..." }
2019-09-27 12:51:19 +00:00
Tobias Kortkamp
deaa22d85c lang/rust: Update to 1.38.0
- 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/09/26/Rust-1.38.0.html
Tested by:	jbeich, mikael.urankar@gmail.com, tobik
With hat:	rust
Differential Revision:	https://reviews.freebsd.org/D21778
2019-09-27 09:35:20 +00:00
Tobias Kortkamp
1dd577aa35 Mk/Uses/cargo.mk: Add gmake build dependency for jemalloc-sys 2019-09-16 12:39:57 +00:00
Tobias Kortkamp
40666d2b8f lang/rust: Update to 1.37.0
- 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/08/15/Rust-1.37.0.html
Tested by:	jbeich, tobik, greg@unrelenting.technology (aarch64)
With hat:	rust
Differential Revision:	https://reviews.freebsd.org/D21247
2019-08-15 14:30:16 +00:00
Tobias Kortkamp
076bb3ef0b Mk/Uses/cargo.mk: Add support for CARGO_USE_GITLAB/GL_TUPLE to cargo-crates 2019-08-06 08:12:39 +00:00
Tobias Kortkamp
7e5e3b9071 www/geckodriver: Bump libc crate version again
$ 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
2019-07-18 08:18:05 +00:00
Tobias Kortkamp
fbe6dc595d Mk/Uses/cargo.mk: Handle distfile group names properly
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.
2019-07-15 08:46:13 +00:00
Tobias Kortkamp
f69160b440 lang/rust: Update to 1.36.0
- 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/07/04/Rust-1.36.0.html
Tested by:	jbeich, mikael.urankar@gmail.com
With hat:	rust
Differential Revision:	https://reviews.freebsd.org/D20810
2019-07-04 14:41:57 +00:00
Tobias Kortkamp
4eab6d1261 Mk/Uses/cargo.mk: Add CARGO_INSTALL_PATH knob
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.
2019-06-10 10:56:04 +00:00
Tobias Kortkamp
45b4cf53f5 Mk/Uses/cargo.mk: QoL improvement during makepatch
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
2019-05-24 07:57:11 +00:00
Tobias Kortkamp
f30ebc2bec lang/rust: Update to 1.35.0
- 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/05/23/Rust-1.35.0.html
Reviewed by:	jbeich
Tested by:	pkubaj (powerpc64), mikael.urankar@gmail.com (aarch64)
With hat:	rust
Differential Revision:	https://reviews.freebsd.org/D20332
2019-05-24 03:25:11 +00:00
Tobias Kortkamp
6bd3ed2a9b lang/rust: Update to 1.34.2
- While here add patches from [1] for LibreSSL 2.9.1 support

[1] https://github.com/sfackler/rust-openssl/pull/1097

Changes:	https://blog.rust-lang.org/2019/05/13/Security-advisory.html
Changes:	https://blog.rust-lang.org/2019/05/14/Rust-1.34.2.html
PR:		237495 [1]
Security:	37528379-76a8-11e9-a4fd-00012e582166
2019-05-15 03:12:15 +00:00
Tobias Kortkamp
23e6c4fb94 Mk/Uses/cargo.mk: Push lib dependencies back down into ports
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.
2019-04-17 07:33:34 +00:00
Tobias Kortkamp
67b6dd1b42 lang/rust: Update to 1.34.0
- 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
2019-04-11 19:39:28 +00:00
Tobias Kortkamp
c14ae21835 Mk/Uses/cargo.mk: Add GitLab support and drop CARGO_GH_CARGOTOML
- 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.
2019-03-25 06:28:20 +00:00
Jan Beich
52696a8ba6 USES=cargo to omit -C link-arg if LDFLAGS is empty
DPorts overrides USE_GCC logic and doesn't opt in into SSP_CFLAGS, so
its LDFLAGS are empty by default.

PR:		236529
Reported by:	Antonio Huete Jimenez
2019-03-14 17:31:45 +00:00
Tobias Kortkamp
297275401f Mk/Uses/cargo.mk: Require ports gcc on powerpc64 same as lang/rust
PR:		235063
2019-03-02 00:35:33 +00:00
Jan Beich
87378368c4 lang/rust: update to 1.33.0
- www/firefox temporarily loses SIMD in charset conversion, see
  https://bugzilla.mozilla.org/show_bug.cgi?id=1521249
- Force rebuild all consumers to catch regressions early

Changes:	https://blog.rust-lang.org/2019/02/28/Rust-1.33.0.html
Tested by:	Mikaël Urankar (aarch64, armv6, armv7, powerpc64), Piotr Kubaj (powerpc64)
Approved by:	rust (tobik)
Differential Revision:	https://reviews.freebsd.org/D19354
2019-02-28 18:51:45 +00:00
Jan Beich
f8eead936c USES=cargo to update libc to 0.2.49 for Tier2
PR:		235063
Differential Revision:	https://reviews.freebsd.org/D19309
2019-02-28 18:47:28 +00:00
Tobias Kortkamp
5aa07820a6 Add a CRATESIO entry for crates.io to bsd.sites.mk
Switch cargo.mk over to it.

Differential Revision:	https://reviews.freebsd.org/D19133
2019-02-15 12:04:50 +00:00
Alex Dupre
b1cc1bb18b Don't break when there are multiple libc versions in crates. 2019-02-15 09:33:48 +00:00
Tobias Kortkamp
d01e77a55f Mk/Uses/cargo.mk: Silence "you need USES=ssl" QA warning
We already have it via CARGO_CRATES=openssl-sys-*.

Differential Revision:	https://reviews.freebsd.org/D19044
2019-02-08 12:19:30 +00:00
Jan Beich
6f333b0b12 lang/rust: update to 1.32.0
- devel/racer no longer needs to dowgrade rustc-ap-syntax
- Force rebuild all consumers to catch regressions early

Changes:	https://blog.rust-lang.org/2019/01/17/Rust-1.32.0.html
Approved by:	rust (tobik)
Differential Revision:	https://reviews.freebsd.org/D18858
2019-01-17 19:50:38 +00:00
Jan Beich
076bf84a1c Allow overriding rust dependency
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
2019-01-04 04:00:39 +00:00
Tobias Kortkamp
54d5b897b0 Mk/Uses/cargo.mk: Fix install for Rust 2018 edition applications
`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
2018-12-16 12:08:32 +00:00
Jan Beich
7102e5e9fc USES=cargo to respect CC for linking
Reported by:	tijl
Approved by:	rust (tobik)
Differential Revision:	https://reviews.freebsd.org/D18528
2018-12-14 18:20:35 +00:00
Jan Beich
7c64203f67 lang/rust: update to 1.31.0
- devel/racer no longer needs to dowgrade rustc-ap-syntax
- Force rebuild all consumers to catch regressions early

Changes:	https://blog.rust-lang.org/2018/12/06/Rust-1.31.0.html
Approved by:	rust (tobik)
Differential Revision:	https://reviews.freebsd.org/D18427
2018-12-06 17:11:14 +00:00
Jan Beich
af90810038 USES=cargo to convert LDFLAGS into RUSTFLAGS
Approved by:	rust (tobik)
Differential Revision:	https://reviews.freebsd.org/D18039
2018-12-06 17:07:42 +00:00
Tobias Kortkamp
8a5005334f Warn maintainers when OpenSSL 1.1.1 support is missing when using
an outdated openssl < 0.10.4 crate.

Submitted by:	jbeich
Differential Revision:	https://reviews.freebsd.org/D18292
2018-11-29 11:05:39 +00:00
Tobias Kortkamp
365e668d98 Bump minimum Rust version after rP482993 2018-10-26 16:18:28 +00:00
Tobias Kortkamp
df73097802 Bump minimum Rust version in Mk/Uses/cargo.mk
Given that at least ripgrep will soon require Rust >= 1.28.0 [1]
and given the recently discovered buffer overflow vulnerability in
the standard library of Rust < 1.29.1 [2] bump it to 1.29.1 to avoid
surprises.

[1] https://github.com/BurntSushi/ripgrep/issues/1019
[2] https://groups.google.com/forum/#!topic/rustlang-security-announcements/CmSuTm-SaU0
2018-09-28 18:47:25 +00:00
Jan Beich
49c8598e32 lang/rust: unbundle libgit2/libssh2
- 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)
2018-09-21 11:16:08 +00:00
Tobias Kortkamp
80e8f971e5 Mk/Uses/cargo.mk: Let 'cargo-crates' generate Cargo.lock if it does not exist
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
2018-09-04 07:26:02 +00:00
Tobias Kortkamp
5821244d9a Mk/Uses/cargo.mk: Fix crate name and version split (take 2)
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>
2018-08-07 19:55:32 +00:00
Tobias Kortkamp
ad49ddf876 Mk/Uses/cargo.mk: Encode more crate build dependencies
- 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
2018-06-14 09:56:02 +00:00
Tobias Kortkamp
96dff11bed Mk/Uses/cargo.mk: Respect CPUTYPE
C and C++ code can be built targeting newer CPUs if user defined
CPUTYPE in make.conf.  Let's opt-in for Rust as well.

PR:		223939
Submitted by:	jbeich
2017-11-29 11:06:11 +00:00
Guido Falsi
b1fac01e5e Retire WITHOUT_DEBUG flag.
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
2017-10-15 14:05:04 +00:00
Tobias Kortkamp
3bd9ad9532 Mk/Uses/cargo.mk: Fix crate name and version split
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
2017-10-12 10:51:00 +00:00
Jean-Sébastien Pédron
bae5285e87 Mk/Uses/cargo.mk: Fix version of Rust which started to ship Cargo
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
2017-09-22 13:57:16 +00:00