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: fix runtime on powerpc64le
Backport an LLVM fix for the loop vectorizer emitting invalid IR
for extractvalue of a widened sadd.with.overflow. On powerpc64le this
broke everything using libbz2-rs-sys (py-maturin, proton-pass-cli) with
"Cannot select: i64 = sign_extend v4i32".
Mk/Uses/cargo.mk, lang/rust: keep RUST_BACKTRACE on powerpc64le
Only backtraces captured by libraries hit the libunwind bug, so disable
those with RUST_LIB_BACKTRACE and keep panic backtraces everywhere. The
fix is in releng/14.5, stable/15 and main.
lang/rust-nightly: update 1.99.0.20260809 → 1.100.0.20260909
- Sync patches to lang/rust
- Force disable profiler on wasm target, it does not build and
is not supposed to according to upstream ([1])
[1] https://github.com/rust-lang/rust/issues/162551
Approved by: rust (implicit)
lang/rust: set RUST_BACKTRACE=1 on recent CURRENT on powerpc64le
After src 70509d1d9cba254dfd5b3dd83d8a011b5e125788, RUST_BACKTRACE=1
doesn't cause a crash anymore.
lang/rust{,-bootstrap}, Mk/Uses/cargo.mk: Relax COMPAT_FREEBSD11 check
lang/rust{,-bootstrap} themselves do not need COMPAT_FREEBSD11 any more,
nor do crates that don't depend on pre-0.2.176 libc. For those that
still do, emit a warning for porters to see so that we can eventually
fully move away from needing COMPAT_FREEBSD11.
Note lang/rust188, and the bootstrap 1.87 it depends on, both predate
1.93, the first version of rust itself to use libc >= 0.2.176, so the
check remains in lang/rust188.
Note also Mk/bsd.gecko.mk does its own thing due to the vendored crates,
and will need its own approach to this issue.
PR: 281600
Reviewed by: mikael (rust)
Approved by: mikael (rust)
MFH: 2026Q3
lang/rust: fix runtime on powerpc64le/CURRENT
powerpc64le switched to 128-bit long double, which is implemented in
compiler_rt (libgcc). Link to libgcc to resolve those symbols correctly.
Noop for older releases.
lang/rust-nightly: update 1.97.0.20260511 → 1.98.0.20260526
- Enable miri
- Include a patch from upstream PR to avoid network access during build
Approved by: rust (implicit)
lang/rust: fix build on armv7
We have previously (cf. PR 282663) disabled the has_thread_local feature
on armv7 to work around an rtld bug. The bug was fixed with D42415, but
the workaround remained. Earlier this year, rust started to fail to
build due to the workaround, as the fallback TLS implementation is
limited to the number of pthread TLS keys (256) and rust has started to
consume more and more of them. While a temporary workaround reducing
the hunger for TLS keys was implemented in 2026Q2, we can actually just
reenable has_thread_local to go back to how things are supposed to work.
PR: 294545
Approved by: mikael (rust)
MFH: no
Revert "lang/rust: fix build with LLVM 22 (PORT_LLVM option)"
This reverts commit 91d047221724449855d84465d8ca53bdddb9fcc2.
This patch was not approved.
This patch interferes with pending rust update (pr 293615)
There was no rush to push this patch since there is a pending rust update (pr
293615)
It breaks lang/rust-nightly
lang/rust: really fix WASM with PORT_LLVM
Bundled LLVM is never built when llvm-config is specified in
config.toml, ie PORT_LLVM, and base system LLVM doesn't support
wasm32-unknown-unknown triple. Restore the previous behaviour of
using clang from the LLVM port when PORT_LLVM is enabled. Also
really fix the ${LLVM_VERSION} logic, as the variable is from
USES=llvm.
lang/rust: privatise ${_LLVM_VERSION}
Did not initially notice the added ${LLVM_VERSION} to denote minimum
required PORT_LLVM version, but privatise to avoid collision with
USES=llvm's ${LLVM_VERSION} logic.
lang/rust: Update to 1.85.1
While here:
- remove rustdoc from _RUST_TOOLS, it has to be added only when
DOCS option is enabled
- add DOCS to OPTIONS_DEFAULT [1]
- building docs on armv7 is fixed
PR: 285381 [1]
lang/rust: do not build the documentation on armv7
A bug [1] prevents documentation from being compiled on this
platform, disable it until it's fixed in a release branch.
[1] https://github.com/rust-lang/rust/pull/137632
Reported by: mmel
lang/rust: Make OpenSSL use the system default truststore in Cargo
Cargo uses curl-rust and git2-rs (which uses curl-rest as well).
Unfortunately, git2-rs calls openssl_probe::init_ssl_cert_env_vars()
unconditionally which breaks the process environment by setting an invalid
value for SSL_CERT_DIR and then the system default truststore is circumvented,
resulting in certificate validation errors even if certctl(8) manages
everything nicely.
Upstream issues:
* https://github.com/alexcrichton/openssl-probe/issues/37
* https://github.com/rust-lang/git2-rs/pull/1130
Reviewed by: jrm (mentor), mikael (rust)
MFH: 2025Q1
Differential Revision: https://reviews.freebsd.org/D49120
devel/RStudio: Revert "feat(create-turbo): apply official-starter transform"
This reverts commit 52c0456dd5ec259ac94ee401db79c7ad3569f914.
I have no idea what lead to this commit into devel/RStudio and
lang/rust-nightly to be made.
lang/rust: reintroduce EXTRA_PATCHES for specific ARCH
It was dropped in 988dc662364d9ab3d7cea82c642068a27b0c1254 but it's
still needed.
Reported by: mandree,mmel
lang/rust: remap debuginfo
Prior to this update, when the rust compiler generates warnings
or errors that refer to source code for the standard library, its
messaging use the build time path, rather than the installed path.
It's probably more useful for most users of rust to not have to
mentally rename files to find the files in question.
PR: 278133
Differential Revision: https://reviews.freebsd.org/D44547
*/*: Sunset 12.4-RELEASE/12-STABLE from ports tree
- Remove all references to defunct ARCH arm
- Remove all references to defunct ARCH sparc64
- Remove x11-drivers/xf86-video-sunffb which requires defunct sparc64
ARCH
- Remove sysutils/afbinit requires defunct sparc64 ARCH
- Remove all references to bktr driver
- Remove all references to defunct FreeBSD_12
- Remove all references to OSVERSION/OSREL corresponding to 12
- Remove conditionals in Mk/Uses/cabal.mk
- Remove sparc reference from Mk/Uses/qt-dist.mk
- Remove BROKEN_sparc64/NOT_FOR_ARCH=sparc64
- Remove BROKEN_FreeBSD_12* from:
- Remove OpenSSL patches from:
- Remove conditional flags for OSVERSION >= 1300000 to fixed flags.
Also move conditional flags for non sparc64/arm ARCH to fixed flags.
Reviewed by: brooks, jbeich, rene, salvadore
Differential Revision: https://reviews.freebsd.org/D42068
lang/rust: resurrect PORT_LLVM as a non-default OPTION
Rust uses LLVM for code generation [0] and bundles their own copy
of a release that they fully support in relation to the rest of
rustc. This however adds to an already intensive build process. For
the benefit of those building from source, resurrect the PORT_LLVM
option, allowing to link with an existing devel/llvm port of the
user's choosing within Rust compatibility ranges. This remains unset
by default.
PORT_LLVM was removed during an era when Rust tracked LLVM trunk,
during the LLVM 7.0 development cycle. Starting with LLVM 8.0, Rust
tracks LLVM releases with upstream cherry-picks, similar to our
base system LLVM process. [1] Additionally, instead of making changes
directly in their bundled LLVM, llvm-wrapper takes care of anything
needed in that area. [2] Issues stemming from this option have since
been resolved or overcome.
[0] https://rustc-dev-guide.rust-lang.org/backend/codegen.html
[1] https://rustc-dev-guide.rust-lang.org/backend/updating-llvm.html
[2]
https://github.com/rust-lang/rust/tree/master/compiler/rustc_llvm/llvm-wrapper
Co-authored-by: Evgeniy Khramtsov <2khramtsov_gmail.com>
Approved by: tobik (rust)
Differential Revision: https://reviews.freebsd.org/D32654
all: remove explicit versions in USES=python for "3.x+"
The logic in USES=python will automatically convert this to 3.8+ by
itself.
Adjust two ports that only had Python 3.7 mentioned but build fine
on Python 3.8 too.
finance/quickfix: mark BROKEN with PYTHON
libtool: compile: c++ -DHAVE_CONFIG_H -I. -I../.. -I -I. -I.. -I../.. -I../C++
-DLIBICONV_PLUG -DPYTHON_MAJOR_VERSION=3 -Wno-unused-variable
-Wno-maybe-uninitialized -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong
-fno-strict-aliasing -DLIBICONV_PLUG -Wall -ansi
-Wno-unused-command-line-argument -Wpointer-arith -Wwrite-strings
-Wno-overloaded-virtual -Wno-deprecated-declarations -Wno-deprecated -std=c++0x
-MT _quickfix_la-QuickfixPython.lo -MD -MP -MF
.deps/_quickfix_la-QuickfixPython.Tpo -c QuickfixPython.cpp -fPIC -DPIC -o
.libs/_quickfix_la-QuickfixPython.o
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean
'-Wno-uninitialized'? [-Wunknown-warning-option]
QuickfixPython.cpp:175:11: fatal error: 'Python.h' file not found
^~~~~~~~~~
1 warning and 1 error generated.
Reviewed by: portmgr, vishwin, yuri
Differential Revision: <https://reviews.freebsd.org/D40568>
lang/rust: Documentation installation fix.
Add the missing _COMPONENTS for the documentation.
Differential Revision: https://reviews.freebsd.org/D40510