Commit graph

45 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
3130d6b687 lang/rust: Add support for LibreSSL 2.6.3
Patches come from upstream:
    https://github.com/sfackler/rust-openssl

PR:		223500
Reported by:	Charlie Li <ml+freebsd-bugs@vishwin.info>
2017-11-09 14:14:59 +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
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
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
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
Thomas Zander
57bec1dacb Update to upstream version 1.16.0 2017-03-19 12:08:08 +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
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
6d498fee32 Update to upstream version 1.10.0 2016-07-10 04:20:09 +00:00
Thomas Zander
35862d3bc3 Update to upstream release 1.9.0 2016-05-31 21:23:59 +00:00
Thomas Zander
1d29f2c4c1 Make recent stage0 snapshot known to build system on DragonFly
Language changes require very recent stage0 snapshots to build
rust 1.8.0. Upstream forgot to make these snapshots known to the
build system. While this was patched for FreeBSD in r413501, it
was missed for DragonFly. This changeset fixes this.
2016-04-17 10:33:47 +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
Thomas Zander
aa3056e413 Fix staging error on systems where security/sudo is present
PR:		207930
Reported by:	pete@hayes.id.au, kib (via mail)
2016-03-27 17:10:15 +00:00
Thomas Zander
3295b60571 Update to upstream version 1.7.0 2016-03-05 12:41:03 +00:00
Thomas Zander
802d19424f - Take maintainership
- Provide target for 'make test': Use bundled rust regression test suite
- Use bundled LLVM for now: Built with it, rust passes more regression tests
- Bump PORTREVISION
2015-11-07 22:17:36 +00:00
Thomas Zander
77c24edc61 Enable rust on i386 2015-09-19 18:22:06 +00:00
Vanilla I. Shu
92219a48b9 1: Upgrade to 1.2.0.
2: add libedit to USES.
2015-09-03 15:22:07 +00:00
Jean-Sébastien Pédron
c67d07b850 lang/rust: Use LLVM 3.6 from Ports instead of the bundled one
Dependencies are updated: Perl is not a dependency at all and Python is
a build dependency only.

Rust may fail to build if a previous version is already installed
because the bootstrapped rustc puts "-L/usr/local/lib" at the beginning
of the linker flags. Therefore, mark rust as a CONFLICTS_BUILD with
itself.

Fix the build as a normal user by setting permissions on all directories
to 0755 [1].

Be closer to the standalone installer's file hierarchy by installing
files such as "components", "manifest-rustc" and "uninstall.sh".

Add "files/patch-src_librustc__back_target_freebsd__base.rs"
to remove "-L/usr/local/lib", "-L/usr/local/lib/gcc46" and
"-L/usr/local/lib/gcc44" from the builtin linker flags.

Differential Revision:	https://reviews.freebsd.org/D2466
Submitted by:	Chris Hutchinson [1]
Reviewed by:	jonathan, kwm
Approved by:	jonathan
2015-06-24 17:09:27 +00:00
Thomas Zander
809287503d - Update to first stable upstream release 1.0.0
- Reflect stable release in pkg-descr
- Pet portlint

PR:		200284
Submitted by:	maciej@pasternacki.net
Reviewed by:	riggs
2015-05-18 22:32:17 +00:00
Bartek Rutkowski
c5e0460bcc lang/rust: update 0.11.0 -> 0.12.0
- Delete obsolete patch
- Convert to @dir usage

Approved by:	mentors (implicit)
2014-10-26 17:39:54 +00:00
John Marino
b13d6b9703 lang/rust: Fix link issue and build failure
[1] Linking fails with missing reference to __morestack symbol
[2] gpy fails with error about missing sem implementation

PR:		189357 [1]
PR:		191927 [2]
Submitted by:	bertrand.augereau (gmail) [1]
Submitted by:	maintainer: mitsuruike (gmail) [2]
2014-07-28 22:58:33 +00:00
Alexey Dokuchaev
35eec38ead - Give the reason why the port is currently amd64-only
- Remove no-op patch file (builds just fine with -Werror as it seems)
- In BATCH or PACKAGE_BUILDING modes, produce verbose build logs
- Rework post-extract target: do not extract bootstrap compiler ourselves,
  put it into expected download directory instead; this also allows us to
  optimize away RUST_TARGET knob and post-patch hack
- Since the port is for FreeBSD 10+, no need to explicitly depend on
  libexecinfo.so
- Use OPTIONS helpers, perform some other minor Makefile cleanups
- Augment port description text while I am here
2014-07-23 07:41:07 +00:00
Bartek Rutkowski
df4a2efa1a lang/rust: update 0.10 -> 0.11
Approved by:	marino (mentor)
2014-07-11 07:27:37 +00:00
Eitan Adler
4a4e829231 lang/rust: update to 0.9
- stagiy
- mark as broken on 10+
- update to 0.9
- add new options
- add LICENSE

PR:		ports/185868
PR:		ports/185865
Submitted by:	Oleksii Tsai <oleksii.tsai@googlemail.com>
Approved by:	Jyun-Yan You <jyyou@cs.nctu.edu.tw> (maintainer)
2014-03-15 07:03:58 +00:00
Vanilla I. Shu
fc6ba6c023 Upgrade to 0.8.
PR:		ports/182502
Submitted by:	maintainer
2013-10-06 03:32:29 +00:00
Vanilla I. Shu
49195bfe10 Upgrade to 0.7.
PR:		ports/180405
Submitted by:	maintainer
2013-07-09 12:51:31 +00:00
Li-Wen Hsu
363f864259 - Update to 0.6
PR:		ports/177665
Submitted by:	Jyun-Yan You <jyyou@cs.nctu.edu.tw> (maintainer)
2013-04-24 13:46:41 +00:00
Li-Wen Hsu
c4f6241798 - Update to 0.5
PR:		ports/174670
Submitted by:	Jyun-Yan You <jyyou@cs.nctu.edu.tw> (maintainer)
2013-01-07 06:35:04 +00:00
Vanilla I. Shu
ff96836264 Upgrade to 0.4.
PR:		ports/172791
Submitted by:	maintainer
Feature safe:   yes
2012-10-18 07:03:50 +00:00
Alex Kozlov
686606009c - Update to 0.3 (see https://github.com/mozilla/rust/blob/release-0.3/RELEASES.txt)
PR:	ports/169906
Submitted by:	Jyun-Yan You <jyyou@cs.nctu.edu.tw> (maintainer)
2012-07-19 22:06:33 +00:00
Michael Scheidell
c144b0fb1c - Update to 0.2
- The bootstrap compiler needs "cc" to link objects.

PR:		ports/166551
Submitted by:	Jyun-Yan You <jyyou@cs.nctu.edu.tw> (maintainer)
Feature safe:	yes
2012-04-07 16:22:23 +00:00
Jason Helfman
58cbc31364 - fix linker errors for systems that have installed llvm
- let clang build llvm
- fix build on ${OSVERSION} < 800107

PR: ports/164467
Submitted by: maintainer, jyyou at cs.nctu.edu.tw
Approved by:	crees (mentor)
2012-02-02 18:17:31 +00:00
Li-Wen Hsu
a7fe5ec546 Add rust 0.1, a language with a focus on memory safety and concurrency.
PR:		ports/164366
Submitted by:	Jyun-Yan You <jyyou@cs.nctu.edu.tw>
2012-01-23 16:07:04 +00:00