Commit graph

90 commits

Author SHA1 Message Date
Jean-Sébastien Pédron
c988c24319 lang/rust: Disable "omit frame pointers"
Before the patch, the default behavior of the compiler was to omit frame
pointers. However, even though it looks fine for the code produced
by the compiler, the compiler itself was broken. When there was a
compilation error, rustc panics to report that error. While handling
that panic, it tries to unwind the stack but fails to do so, which
results in an abort(3).

Here is an example:

    $ rustc hello.rs
    error: invalid reference to argument `0` (no arguments given)
     --> hello.rs:2:5
      |
    2 |     println!("Hello {}")
      |     ^^^^^^^^^^^^^^^^^^^^
      |
      = note: this error originates in a macro outside of the current crate

    error: aborting due to previous error

    fatal runtime error: failed to initiate panic, error 5
    Abort trap (core dumped)

The problem also exists on other systems such as OpenBSD and
i686-unknown-linux-musl. "omit frame pointers" was already disabled for
i686-unknown-linux-musl:
88a28ff602/src/librustc_back/target/i686_unknown_linux_musl.rs (L22)

The patch does the same for *-unknown-freebsd.

See the upstream bug for more informations:
https://github.com/rust-lang/rust/issues/43575
2017-11-30 13:33:05 +00:00
Jan Beich
d65b2886b1 lang/rust: avoid LLVM targeting SSE2 on i386 by default
This may help ports like textproc/ripgrep to run on old hardware.
Rust itself still requires SSE2 until bootstrap is regenerated.

PR:		223415
Approved by:	rust (dumbbell)
2017-11-27 22:02:29 +00:00
Jean-Sébastien Pédron
fefc322b07 lang/rust: Remove the LLVM_PORT option
FTR, this option allowed to used LLVM from ports instead of building the
bundled copy.

The problem is that this combination isn't really tested upstream. This
led to regressions which are difficult to diagnose. For instance, in
Rust 1.21.0, the bundled LLVM provided a new API to query the features
supported by the target arch. The equivalent code inside Rust was
removed to use that new API. Unfortunately, building Rust 1.21.0+ with a
copy of LLVM not providing this API didn't failed but instead made that
list of CPU features empty. This resulted in the following obscure build
failure in Firefox:

    error[E0432]: unresolved import `x86::sse2`

To avoid future pain for both end users and maintainers, we decided to
remove that option. Yes, it will increase the (already long) time to
build Rust, but it should save time wasted on debugging what is not
really supported anyway.

PR:		223342, 223300
Reported by:	Many users
2017-11-27 18:16:15 +00:00
Jean-Sébastien Pédron
ba01899161 lang/rust: Update to 1.22.1
Support for LibreSSL up-to 2.6.3 is now included, thus we can remove the
patches to the `openssl` and `openssl-sys` crates.

The renewed bootstrap for aarch64 was created on 11.0-RELEASE, instead
of 11.1-STABLE. It should allow it to run on all 11.x and thus fix the
build on 11.0-RELEASE. [1]

PR:		223009 [1]
2017-11-27 08:20:32 +00:00
Jean-Sébastien Pédron
410580ce93 lang/rust: Fix paths in manifest-rls-preview
Like other manifests, without this, it still references the stage
directory. This error is reported when DEVELOPER=YES is set.

While here, strip `bin/rls`.

Reported by:	bar@, cpm@
2017-10-29 12:38:09 +00:00
Jean-Sébastien Pédron
76740e13d8 lang/rust: Update to 1.21.0
The official bootstraps wouldn't work: rustc was stalled on a mutex
while compiling a crate early in the build. This was solved by creating
a new bootstraps for "rustc" and "rust-std" from the existing FreeBSD
package. We keep using the official "cargo" bootstrap.

PR:		223123
2017-10-28 09:13:21 +00:00
Jan Beich
03b1a75e35 lang/rust: unbreak FFI for returning struct on i386
As this fixes Stylo on i386, remove the workaround in www/firefox.

PR:		223047
Suggested by:	Sebastien Marie <semarie@openbsd.org>
Approved by:	rust (dumbbell)
MFH:		2017Q4 (required by Firefox 57 scheduled on 2017-11-14)
2017-10-23 22:58:48 +00:00
Jean-Sébastien Pédron
67a4c4a209 lang/rust: Add support for LibreSSL 2.6.1 and 2.6.2
Patches come from upstream:
    https://github.com/sfackler/rust-openssl

PR:		222359
Reported by:	Charlie Li <ml+freebsd-bugs@vishwin.info>,
		Piotr Kubaj <pkubaj@anongoth.pl>,
		w.schwarzenfeld@utanet.at,
		nhoyle@hoyletech.com
2017-10-11 12:28:00 +00:00
Jean-Sébastien Pédron
97c4fb35a8 lang/rust: Update to 1.20.0
This patch only upgrades the port to Rust 1.20.0. The PR also covers a
build failure with the latest LibreSSL, which is not addressed here.

PR:		222359
Reported by:	Charlie Li <ml+freebsd-bugs@vishwin.info>
2017-10-04 08:13:38 +00:00
Jean-Sébastien Pédron
0cc13b3d48 lang/rust: Install Cargo + use bundled crates
This port now provides Cargo. This is the recommended now because Cargo
won't be provided separately in the future.

To build Cargo, we set `extended = true` in `config.toml`. As a side
effect, this flag also installs Rust source code. The port has a new
`SOURCES` option (disabled by default) to keep those sources.

As a consequence of this, `devel/cargo` is removed. Several ports
and Makefiles in Mk were updated to depend on `lang/rust` instead of
`devel/cargo`.

The other big change in this patch is the use of the bundled crates,
instead of relying on Cargo's registry (which was part of the distfiles,
in order to allow offline builds). So now, we don't need to prepare the
registry when updating this port.

This has several other benefits:
    * It fixes the build with sudo(8).
    * It fixes the use of the ino-64 patch (it was not applied to the
      registry, thus not used).

Compilation errors were fixed in the ino-64 patch.

Various `.cargo-checksum.json` files are updated after the sources are
patched (FBSD10_FIX, ino-64, and so on). This fixes builds which were
failing with errors such as:

    error: the listed checksum of `.../rustc-1.19.0-src/src/vendor/lzma-sys/xz-5.2.3/build-aux/config.rpath` has changed:
    expected: c8b4c017079da9dfb3086a0583e60ffe736184d89005dc5973f0bb0fd17c04bb
    actual:   561b00eb30ecaef2c9da17bc195e7d2a7ea63facea38ea9849fbb0ed340bebba

PR:		221088
Reported by:	joneum@, nwhitehorn@, romain@,
		Ekaterina Vaartis <vaartis@cock.li>,
		david@catwhisker.org,
		fullermd@over-yonder.net,
		rum1cro@yandex.ru,
		w.schwarzenfeld@utanet.at
Differential Revision:	https://reviews.freebsd.org/D11783
2017-09-15 18:01:17 +00:00
Thomas Zander
de97c5e9a7 Allow RUST_BACKTRACE to work without /proc mounted
Submitted by:	jbeich
Differential Revision:	https://reviews.freebsd.org/D11574
2017-09-10 16:49:46 +00:00
Jean-Sébastien Pédron
650b93f90c lang/rust: Turn off PORT_LLVM by default
This change was accidentally committed with the previous commit.
2017-07-28 23:03:26 +00:00
Jean-Sébastien Pédron
5d7e68a151 lang/rust: Fix build with PORT_LLVM
The path to `llvm-config40` was set to the empty string in the generated
`config.toml`, because I was still using the ${LLVM_PREFIX} variable
instead of the appropriate ${LLVM_CONFIG}. Bad completion and lack of
testing, sorry for that...

Reported by:	Rainer Hurling <rhurlin@gwdg.de>,
		Walter Schwarzenfeld <w.schwarzenfeld@utanet.at>,
		dim@
2017-07-28 22:30:39 +00:00
Jean-Sébastien Pédron
df5438d295 lang/rust: Fix ${PORT_LLVM_BUILD_DEPENDS}
The BUILD_DEPENDS argument for the PORT_LLVM option was not updated: it
was using the ${LLVM_PREFIX} variable which was removed. Now, it uses
${LOCALBASE} and ${LLVM_VER} as a suffix to the executable verified.

Submitted by:	Rainer Hurling <rhurlin@gwdg.de>
Reported by:	Rainer Hurling <rhurlin@gwdg.de>
2017-07-28 16:29:08 +00:00
Jean-Sébastien Pédron
771fbc02f4 lang/rust: Update to 1.19.0
The main change in the port is the switch from configure+make to the
`x.py` build script. This is the recommended way of building Rust. It
takes a configuration file, `config.toml`, which, in the port case,
indicates:

 * where to install things;
 * which release channel to use;
 * where to find Python and llvm-config;
 * if documentation should be also built.

The build process should now honor ${MAKE_JOBS_NUMBER} instead of always
using all available CPU cores.

The Cargo registry archive is significantly larger. It includes the
whole registry index (not only the crates needed by Rust). If the index
is missing, Cargo wants to download it from crates.io and I couldn't
find a way to convince it skip it.

New bootstraps for FreeBSD/aarch64 were prepared for this update. Those
are based on Rust 1.18.0 and Cargo 0.19.0.

CONFLICTS_BUILD with installed lang/rust and lang/rust-nightly is
commented out for now. I couldn't see any build failure with an installed
lang/rust so it looks promising. But I couldn't test with an installed
lang/rust-nightly because the latter is marked BROKEN for now. Once it's
restored, I'll do more testing and hopefully completely remove this
CONFLICTS_BUILD variables.
2017-07-28 10:18:54 +00:00
Jean-Sébastien Pédron
bc63a7ccbe lang/rust: Fix value of ${CARGO_BOOTSTRAP_DIR_aarch64}
It was pointing to the wrong directory.

Reported by:	jbeich@
2017-06-18 12:20:01 +00:00
Jean-Sébastien Pédron
8c78bf0c00 lang/rust: Enable on FreeBSD/aarch64 + various fixes
This port now uses an unofficial bootstrap of Rust 1.17.0 and Cargo
0.18.0 for FreeBSD/aarch64. Here are my notes to create this boostrap:
https://gist.github.com/dumbbell/b587da50ef014078da9e732a4331ebad

The port's Makefile was changed to:
    - allow to override the versions and directories of the bootstrap
      archives;
    - patch the bootstrap script and manifest with those
      versions/directories.

Beside changes to support FreeBSD/aarch64, the port received the
following fixes:
    - Pass python path to the configure script.
    - Fix and simplify the extraction of rust-std bootstrap by re-using
      existing variables.
    - Make sure tar(1) doesn't produce sparse file entries when it
      recreates the rust-std bootstrap because Python 2's tarfile module
      doesn't support them (PR 219842).

PR:		216143, 219842
Differential Revision:	https://reviews.freebsd.org/D10857
2017-06-17 14:44:30 +00:00
Thomas Zander
588a1dd506 Fix build on HEAD
Submitted by:	dim, rhurlin@gwdg.de (via mail)
2017-06-13 05:34:55 +00:00
Thomas Zander
0375d315c0 Update to upstream version 1.18.0, set MAINTAINER to rust@ 2017-06-10 17:48:58 +00:00
Thomas Zander
cdde29f0d0 Fix build on pre-ino64 / on i386
Submitted by:	kib
Differential Revision:	https://reviews.freebsd.org/D10973
2017-05-29 05:00:54 +00:00
Konstantin Belousov
421e541db5 Fix lang/rust after ino64 src commit.
Approved by:  bapt, dumbbell
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D10799
2017-05-27 12:06:40 +00:00
Thomas Zander
49c06d8d47 Update to upstream version 1.17.0
Submitted by:	dumbbell (see phabric URL)
Reviewed by:	riggs
Differential Revision:	https://reviews.freebsd.org/D10691
2017-05-14 15:26:44 +00:00
Alex Kozlov
f37a53c2ba - Remove checks for .PARSEDIR and vestiges of pmake support
PR:	218832
Approved by:	portmgr (antoine)
2017-04-26 19:04:30 +00:00
Thomas Zander
57bec1dacb Update to upstream version 1.16.0 2017-03-19 12:08:08 +00:00
Jean-Sébastien Pédron
cc125b3b4b lang/rust, lang/rust-nightly: Generate PLIST in post-install
Several libraries have their filename computed and based on the absolute
path to source files. Therefore, we need to generate the PLIST. Rust
installer already produces manifests listing files it installs. The port
now uses those files to complete `${TMPPLIST}`.

While the port built fine in Poudriere, it failed when built directly on
the host (regular make or with portmaster(1)) or using a different tool
such as Synth. This commit fixes the build for those methods.

Handling of DOCS-specific files is also unified with normal files. This
gets rid of code duplication.

How to do reproducible builds will be studied later.

PR:		217309
Reported by:	Several people on freebsd-ports@ or Bugzilla
Tested by:	Almost everyone who reported the issue
Approved by:	antoine (mentor), riggs (maintainer of lang/rust)
Differential Revision:	https://reviews.freebsd.org/D9816
2017-03-06 13:27:57 +00:00
Jean-Sébastien Pédron
8b84c255e7 lang/rust, lang/rust-nightly: Update to 1.15.1 and 1.17.0 respectively
Both versions of Rust seen changes to their build system. Now they
require a bootstrap of Cargo and thus, a snapshot of Cargo's registry.

Each library has its own suffix instead of a common suffix for a given
version of Rust. Thus all future updates of the ports will include
changes to their plist.

$DISTFILES are now all under the `rust` directory in `$DISTDIR`. A
similar change will be committed to devel/cargo later.

lang/rust-nightly is enabled on i386 (bugzilla 216143). The source
snapshot also contains everything to build it on aarch64, but enabling
it will be committed later.

PR:		216143
Approved by:	riggs, bapt (mentor), antoine (mentor)
Differential Revision:	https://reviews.freebsd.org/D9286
2017-02-22 19:04:03 +00:00
Sunpoet Po-Chuan Hsieh
e0b379fa6f Remove BROKEN_FreeBSD_9
Approved by:	portmgr (blanket)
2017-01-01 03:45:12 +00:00
Thomas Zander
ab4c6046eb Update to upstream version 1.14.0 2016-12-24 19:40:55 +00:00
Thomas Zander
9439a669a2 Update to upstream version 1.13.0 2016-11-11 21:45:40 +00:00
Mathieu Arnold
d26ef18700 Cleanup no longer needed CHMOD usage after r424898.
PR:		213743
Submitted by:	mat
Exp-run by:	antoine
Sponsored by:	Absolight
2016-11-02 22:45:14 +00:00
Thomas Zander
aa005f6642 Update to upstream release 1.12.1
Release 1.12.1 is a maintenance release which fixes some
regressions in the 1.12.0 version, including memory corruption
under certain conditions. Details can be found in the release
announcement: https://blog.rust-lang.org/2016/10/20/Rust-1.12.1.html

MFH:		2016Q4
2016-10-22 12:37:02 +00:00
Dmitry Marakasov
ce67c40af2 - Unconditionally verbosify build as per PHB
Approved by:	portmgr blanket
2016-10-10 23:54:26 +00:00
Thomas Zander
f5a0c66880 Update to upstream release 1.12.0 2016-10-01 14:28:38 +00:00
Thomas Zander
43a31b7fc5 Update to upstream release 1.11.0 2016-08-20 05:57:34 +00:00
Thomas Zander
5e3a6e5de2 Fix build with non-standard PREFIX
PR:		211686
Submitted by:	mi
2016-08-09 21:41:25 +00:00
Jean-Sébastien Pédron
b3457490d0 lang/rust-nightly: Update to 1.12.0; snapshot from 2016-07-17
Reviewed by:	asomers, jbeich, riggs
Approved by:	jbeich, riggs
Differential Revision:	https://reviews.freebsd.org/D7275
2016-07-26 07:39:29 +00:00
John Marino
d4d58faea9 lang/rust: Update distinfo.x86_64 for DragonFly support
A custom bootstrap compiler package had to be created for DragonFly using
FreeBSD's as a model since upstream did not provide one for DF this time.

Approved by:	riggs (maintainer)
2016-07-12 11:49:49 +00:00
Thomas Zander
eb50a84b80 Fix build with PORT_LLVM OPTION; rust now requires LLVM 3.8
Reported by:	Kevin Oberman <rkoberman@gmail.com> via e-mail
2016-07-11 10:47:33 +00:00
Thomas Zander
6d498fee32 Update to upstream version 1.10.0 2016-07-10 04:20:09 +00:00
Thomas Zander
e889edec1b Add DOCS OPTION for html docs, bump PORTREVISION
PR:		210613
Reported by:	beyert@cs.ucr.edu
Reviewed by:	riggs, marino, jbeich
Differential Revision:	https://reviews.freebsd.org/D7050
2016-07-02 19:06:34 +00:00
Thomas Zander
35862d3bc3 Update to upstream release 1.9.0 2016-05-31 21:23:59 +00:00
Thomas Zander
541aeef968 Update to upstream version 1.8.0
While on it:
- Incorporate patch by jbeich (D5897) to allow build with gcc

Differential Revision:	https://reviews.freebsd.org/D5897
2016-04-17 10:21:20 +00:00
Jan Beich
811236773d lang/rust: unbreak non-poudriere build after r412305
gmake[1]: Leaving directory '/wrkdirs/usr/ports/lang/rust/work/rustc-1.7.0'
sed: /wrkdirs/usr/ports/lang/rust/work/stage/usr/local/lib/rustlib/manifest-rust-std-x86_64-unknown-: No such file or directory
*** Error code 1

PR:		208527
Pointy hat:	jbeich
Tested by:	Marko Cupać <marko.cupac@mimar.rs>, pilot513@gmail.com
Approved by:	riggs (maintainer)
MFH:		2016Q2
2016-04-07 07:17:45 +00:00
Jan Beich
c5433c2e29 lang/rust: enslave lang/rust-nightly
* rust: drop no longer used RUST_SOURCE variable
* rust: apply rust-nightly FIXME comment about stage-qa (strip)
* rust-nightly: properly conflict for install with rust package
* rust-nightly: inherit |make test| support from r401025
* rust-nightly: as DOCSDIR is the same drop unnecessary DOCS option

Approved by:	riggs, dumbbell (maintainers)
Differential Revision:	https://reviews.freebsd.org/D5789
2016-04-02 14:49:00 +00:00
Mathieu Arnold
a9dcad2fff Remove ${PORTSDIR}/ from dependencies, categories h, i, j, k, and l.
With hat:	portmgr
Sponsored by:	Absolight
2016-04-01 14:08:37 +00:00
Jan Beich
bd780e4f43 lang/rust: apply minor style
- Fix MIT view for LICENSES_ASK=1
- Convert BROKEN to new syntax
- Concatenate find(1) arguments and drop unnecessary `cd`
2016-04-01 01:16:08 +00:00
Jan Beich
0e6b1c7f1c lang/rust: unblock DragonFly build
=> rust-stage0-.tar.bz2 doesn't seem to exist in /portdistfiles/.
=> Attempting to fetch http://static.rust-lang.org/stage0-snapshots/rust-stage0-.tar.bz2
fetch: http://static.rust-lang.org/stage0-snapshots/rust-stage0-.tar.bz2: Not Found

Reported by:	muscles.dragonflybsd.org
Approved by:	portmgr "just fix it" blanket
2016-03-31 20:04:49 +00:00
Thomas Zander
7af83eacba Re-enable build with ports LLVM by non-default OPTION
PR:		208250
Submitted by:	jbeich
2016-03-25 06:38:23 +00:00
Thomas Zander
3295b60571 Update to upstream version 1.7.0 2016-03-05 12:41:03 +00:00
Thomas Zander
c7dfd4a451 Update to upstream version 1.6.0 2016-01-22 06:13:25 +00:00