Commit graph

71 commits

Author SHA1 Message Date
Luca Pizzamiglio
58744a0909 Uses/cargo: Improve URL subsitution for ports using CARGO_USE_GIT[HUB|LAB]
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
2021-04-19 11:07:31 +02:00
Tobias Kortkamp
ffd4db6b94
Speed up USES=cargo ports ops
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
2021-04-14 14:22:42 +02:00
Tobias Kortkamp
7bec7b192c
Mk/Uses/cargo.mk: Make build scripts more verbose
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
2021-04-13 09:05:40 +02:00
Mathieu Arnold
5d33e04596
framework: Remove $FreeBSD$
Where appropriate fiddle with a few other things.
2021-04-06 16:27:10 +02:00
Tobias Kortkamp
db4578b35a lang/rust: Update to 1.51.0
- Update devel/racer to 2.1.44

Changes:	https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html
PR:		254578
Reviewed by:	mikael, pkubaj
Exp-run by:	antoine
With hat:	rust
Differential Revision:	https://reviews.freebsd.org/D29425
2021-03-29 18:07:32 +00:00
Mikael Urankar
6bebfaa8a0 lang/rust: Update to 1.50.0
- Use bundled libgit/libssh, the versions in ports are too old
  - Update lang/rust-nightly to 2021-02-12
  - Update devel/racer to 2.1.41
  - Import upstream patch to fix build issue for Firefox and related ports (https://bugzilla.mozilla.org/show_bug.cgi?id=1684261)

Changes: https://github.com/rust-lang/rust/releases/tag/1.50.0

Tested by:	mikael, pkubaj
Differential Revision:	https://reviews.freebsd.org/D28616
2021-02-14 15:45:10 +00:00
Mikael Urankar
4e449e031e lang/rust: Update to 1.48.0
Changes: https://github.com/rust-lang/rust/releases/tag/1.48.0

Reviewed by:	jbeich
Tested by:	bdragon, jbeich, mikael
Differential Revision:	https://reviews.freebsd.org/D27293
2020-11-24 12:48:53 +00:00
Piotr Kubaj
bdab46aa8f Add powerpc64le since it uses the same CPU models as powerpc64. 2020-11-10 15:42:15 +00:00
Mikael Urankar
d9b97de179 lang/rust: Update to 1.47.0
- Add powerpc64le arch (submitted by bdragon in D26711)
  - Disable DOCS, same problem fixed in r546048

  - Update devel/racer to 2.1.36
  - Import upstream patch to fix www/firefox
    (https://hg.mozilla.org/integration/autoland/rev/e2cede25c027)
  - Import gentoo patches to fix www/firefox-esr, www/cliqz and mail/thunderbird
    (https://dev.gentoo.org/~whissi/mozilla/patchsets/firefox-esr-78-patches-03.tar.xz : 0036, 0037 and 0038)
  - Force rebuild all consumers to catch regressions

Changelog:
  https://github.com/rust-lang/rust/releases/tag/1.47.0

Differential Revision:	https://reviews.freebsd.org/D26721
2020-10-13 08:36:35 +00:00
Piotr Kubaj
a9e0b11546 Use correct target-cpu for power* CPU's
Using CPUTYPE?=power9 causes warnings and emits unoptimized code. Rust supports pwr* instead of power*, e.g.:
    pwr3
    pwr4
    pwr5
    pwr5x
    pwr6
    pwr6x
    pwr7
    pwr8
    pwr9
2020-09-19 13:01:35 +00:00
Tobias Kortkamp
c9a06251c5 lang/rust: Update to 1.46.0
- Force rebuild all consumers to catch regressions early

Changes:	https://blog.rust-lang.org/2020/08/27/Rust-1.46.0.html
With hat:	rust
Differential Revision:	https://reviews.freebsd.org/D26176
2020-08-30 18:36:07 +00:00
Tobias Kortkamp
8b057d47a9 lang/rust: Update to 1.45.2
Changes:	https://blog.rust-lang.org/2020/08/03/Rust-1.45.2.html
2020-08-03 15:18:49 +00:00
Tobias Kortkamp
9137d53fe2 lang/rust: Update to 1.45.1
- Apply the "hard links break `env::current_exe()`" workaround from
  r543251 to lang/rust too
- Force rebuild all consumers for the soundness bug in 1.45.0

Changes:	https://blog.rust-lang.org/2020/07/30/Rust-1.45.1.html
With hat:	rust
Differential Revision:	https://reviews.freebsd.org/D25835
2020-07-30 18:26:53 +00:00
Tobias Kortkamp
b0f1d6430e lang/rust: Update to 1.45.0
- 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
2020-07-17 06:44:04 +00:00
Tobias Kortkamp
a48473296f lang/rust: Update to 1.44.0
- 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
2020-06-04 18:08:00 +00:00
Tobias Kortkamp
5abe8902a5 lang/rust: Update to 1.43.0
- 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
2020-04-23 15:32:29 +00:00
Tobias Kortkamp
5ed34ceab6 Mk/Uses/cargo.mk: Add a warning about the openssl-src crate
PR:		245337
2020-04-04 07:40:38 +00:00
Tobias Kortkamp
5d337babdf Mk/Uses/cargo.mk: Better deal with versions with build identifier suffixes
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
2020-03-23 03:57:26 +00:00
Tobias Kortkamp
25b7de7213 lang/rust: Update to 1.42.0
- Force rebuild all consumers to catch regressions early

Changes:	https://blog.rust-lang.org/2020/03/12/Rust-1.42.html
Tested by:	mikael, tobik
With hat:	rust
Differential Revision:	https://reviews.freebsd.org/D24020
2020-03-12 19:39:24 +00:00
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