Rust is an open-source systems programming language that runs blazingly
fast, prevents almost all crashes, and eliminates data races.
Some of its features:
- Algebraic data types, type inference
- Pattern matching and closures
- Concurrency without data races
- Guaranteed memory safety
- Optional garbage collection
- Zero-cost abstractions
- Minimal runtime
- Efficient C bindings
===> The following configuration options are available for rust-1.99.1_1:
DOCS=on: Build and/or install documentation
GDB=off: Install ports gdb (necessary for debugging rust programs)
LTO=off: Use Link-Time Optimization
PORT_LLVM=off: Build against devel/llvm instead of bundled copy (experimental)
SOURCES=on: Install source files
WASM=on: Build the WebAssembly target (wasm32-unknown-unknown)
===> Use 'make config' to modify these settings
lang/rust: Always replace bootstrap versions in `stage0.txt`
This simplifies the `Makefile`. The condition was fragile anyway because
it was based solely on the Makefile and not the actual content of
`stage0.txt`.
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
|
(Only the first 15 lines of the commit message are shown above )
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)
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
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]
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@
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
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)
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
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>
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,
(Only the first 15 lines of the commit message are shown above )
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@
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>
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.
(Only the first 15 lines of the commit message are shown above )
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
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
lang/rust*: Advise users to mount procfs
Add a pkg-message to these ports advising users to mount procfs to see
backtraces.
Reviewed by: dumbbell, riggs
Approved by: dumbbell (ports)
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9838
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
lang/rust: regenerate distinfo.x86_64 for DF rust 1.14
I'm not sure how this was misgenerated previously. This matches the
version available via LOCAL/marino
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
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)
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.
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
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
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`
- 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
lang/rust and lang/rust-nightly: Build-conflict with themselves
A newer version of Rust fails to build if an older version is installed
because the build process picks libraries in %%LOCALBASE%%/lib before
those from the build directory.
In the pkg-plist of both ports, `x86_64-unknown-freebsd` is now a
variable automatically set in the Makefile. This avoids the need for a
separate port for DragonFlyBSD. [1]
Still in the pkg-plist, RUST_VSN_HASH is automatically computed in the
lang/rust's Makefile, like it was already done for lang/rust-nightly.
lang/rust-nightly USES libedit. patch-mk_main.mk was copied from
lang/rust so the correct library is picked (ie. the one from Ports, not
(Only the first 15 lines of the commit message are shown above )
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
lang/rust: fixes
- Remove extra STRIP_CMD from the Makefile
- Fix SRIP_CMD that was stripping statically linked libraries
Approved by: mentors (implicit)
- 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
This patch fixes the problem that it attempts to fetch a file during building.
It adds snapshot to distfiles and removes code for downloading.
PR: ports/168223
Submitted by: Jyun-Yan You <jyyou _at_ cs.nctu.edu.tw> (maintainer)
Reported by: pointyhat-west
Approved by: decke (mentor)
- 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