Skip to content

Commit

Permalink
rust178: Add a package for rust version 1.78.0.
Browse files Browse the repository at this point in the history
Pkgsrc changes:
 * Adapt checksums and patches, some have beene intregrated upstream.

Upstream chnages:

Version 1.78.0 (2024-05-02)
===========================

Language
--------
- [Stabilize `#[cfg(target_abi = ...)]`]
  (rust-lang/rust#119590)
- [Stabilize the `#[diagnostic]` namespace and
  `#[diagnostic::on_unimplemented]` attribute]
  (rust-lang/rust#119888)
- [Make async-fn-in-trait implementable with concrete signatures]
  (rust-lang/rust#120103)
- [Make matching on NaN a hard error, and remove the rest of
  `illegal_floating_point_literal_pattern`]
  (rust-lang/rust#116284)
- [static mut: allow mutable reference to arbitrary types, not just
  slices and arrays]
  (rust-lang/rust#117614)
- [Extend `invalid_reference_casting` to include references casting
  to bigger memory layout]
  (rust-lang/rust#118983)
- [Add `non_contiguous_range_endpoints` lint for singleton gaps
  after exclusive ranges]
  (rust-lang/rust#118879)
- [Add `wasm_c_abi` lint for use of older wasm-bindgen versions]
  (rust-lang/rust#117918)
  This lint currently only works when using Cargo.
- [Update `indirect_structural_match` and `pointer_structural_match`
  lints to match RFC]
  (rust-lang/rust#120423)
- [Make non-`PartialEq`-typed consts as patterns a hard error]
  (rust-lang/rust#120805)
- [Split `refining_impl_trait` lint into `_reachable`, `_internal` variants]
  (rust-lang/rust#121720)
- [Remove unnecessary type inference when using associated types
  inside of higher ranked `where`-bounds]
  (rust-lang/rust#119849)
- [Weaken eager detection of cyclic types during type inference]
  (rust-lang/rust#119989)
- [`trait Trait: Auto {}`: allow upcasting from `dyn Trait` to `dyn Auto`]
  (rust-lang/rust#119338)

Compiler
--------

- [Made `INVALID_DOC_ATTRIBUTES` lint deny by default]
  (rust-lang/rust#111505)
- [Increase accuracy of redundant `use` checking]
  (rust-lang/rust#117772)
- [Suggest moving definition if non-found macro_rules! is defined later]
  (rust-lang/rust#121130)
- [Lower transmutes from int to pointer type as gep on null]
  (rust-lang/rust#121282)

Target changes:

- [Windows tier 1 targets now require at least Windows 10]
  (rust-lang/rust#115141)
 - [Enable CMPXCHG16B, SSE3, SAHF/LAHF and 128-bit Atomics in tier 1 Windows]
  (rust-lang/rust#120820)
- [Add `wasm32-wasip1` tier 2 (without host tools) target]
  (rust-lang/rust#120468)
- [Add `wasm32-wasip2` tier 3 target]
  (rust-lang/rust#119616)
- [Rename `wasm32-wasi-preview1-threads` to `wasm32-wasip1-threads`]
  (rust-lang/rust#122170)
- [Add `arm64ec-pc-windows-msvc` tier 3 target]
  (rust-lang/rust#119199)
- [Add `armv8r-none-eabihf` tier 3 target for the Cortex-R52]
  (rust-lang/rust#110482)
- [Add `loongarch64-unknown-linux-musl` tier 3 target]
  (rust-lang/rust#121832)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

Libraries
---------

- [Bump Unicode to version 15.1.0, regenerate tables]
  (rust-lang/rust#120777)
- [Make align_offset, align_to well-behaved in all cases]
  (rust-lang/rust#121201)
- [PartialEq, PartialOrd: document expectations for transitive chains]
  (rust-lang/rust#115386)
- [Optimize away poison guards when std is built with panic=abort]
  (rust-lang/rust#100603)
- [Replace pthread `RwLock` with custom implementation]
  (rust-lang/rust#110211)
- [Implement unwind safety for Condvar on all platforms]
  (rust-lang/rust#121768)
- [Add ASCII fast-path for `char::is_grapheme_extended`]
  (rust-lang/rust#121138)

Stabilized APIs
---------------

- [`impl Read for &Stdin`]
  (https://doc.rust-lang.org/stable/std/io/struct.Stdin.html#impl-Read-for-%26Stdin)
- [Accept non `'static` lifetimes for several `std::error::Error`
  related implementations] (rust-lang/rust#113833)
- [Make `impl<Fd: AsFd>` impl take `?Sized`]
  (rust-lang/rust#114655)
- [`impl From<TryReserveError> for io::Error`]
  (https://doc.rust-lang.org/stable/std/io/struct.Error.html#impl-From%3CTryReserveError%3E-for-Error)

These APIs are now stable in const contexts:

- [`Barrier::new()`]
  (https://doc.rust-lang.org/stable/std/sync/struct.Barrier.html#method.new)

Cargo
-----

- [Stabilize lockfile v4](rust-lang/cargo#12852)
- [Respect `rust-version` when generating lockfile]
  (rust-lang/cargo#12861)
- [Control `--charset` via auto-detecting config value]
  (rust-lang/cargo#13337)
- [Support `target.<triple>.rustdocflags` officially]
  (rust-lang/cargo#13197)
- [Stabilize global cache data tracking]
  (rust-lang/cargo#13492)

Misc
----

- [rustdoc: add `--test-builder-wrapper` arg to support wrappers
  such as RUSTC_WRAPPER when building doctests]
  (rust-lang/rust#114651)

Compatibility Notes
-------------------

- [Many unsafe precondition checks now run for user code with debug
  assertions enabled] (rust-lang/rust#120594)
  This change helps users catch undefined behavior in their code,
  though the details of how much is checked are generally not
  stable.
- [riscv only supports split_debuginfo=off for now]
  (rust-lang/rust#120518)
- [Consistently check bounds on hidden types of `impl Trait`]
  (rust-lang/rust#121679)
- [Change equality of higher ranked types to not rely on subtyping]
  (rust-lang/rust#118247)
- [When called, additionally check bounds on normalized function return type]
  (rust-lang/rust#118882)
- [Expand coverage for `arithmetic_overflow` lint]
  (rust-lang/rust#119432)

Internal Changes
----------------

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

- [Update to LLVM 18](rust-lang/rust#120055)
- [Build `rustc` with 1CGU on `x86_64-pc-windows-msvc`]
  (rust-lang/rust#112267)
- [Build `rustc` with 1CGU on `x86_64-apple-darwin`]
  (rust-lang/rust#112268)
- [Introduce `run-make` V2 infrastructure, a `run_make_support`
  library and port over 2 tests as example]
  (rust-lang/rust#113026)
- [Windows: Implement condvar, mutex and rwlock using futex]
  (rust-lang/rust#121956)
  • Loading branch information
he32 committed May 4, 2024
1 parent ba423a8 commit e762eaa
Show file tree
Hide file tree
Showing 57 changed files with 2,848 additions and 0 deletions.
13 changes: 13 additions & 0 deletions rust178/DESCR
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Rust is a systems programming language focused on three goals: safety,
speed, and concurrency. It maintains these goals without having a
garbage collector, making it a useful language for a number of use cases
other languages aren't good at: embedding in other languages, programs
with specific space and time requirements, and writing low-level code,
like device drivers and operating systems.

It improves on current languages targeting this space by having a number
of compile-time safety checks that produce no runtime overhead, while
eliminating all data races. Rust also aims to achieve "zero-cost
abstractions" even though some of these abstractions feel like those of
a high-level language. Even then, Rust still allows precise control
like a low-level language would.
85 changes: 85 additions & 0 deletions rust178/HOWTO-BOOTSTRAP
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
How to build a rust bootstrap kit using pkgsrc
----------------------------------------------

A rust bootstrap kit is simply a pre-compiled binary of rust and
the rust standard library, and contains the "rust" and "rust-std"
build results, found in

work/rustc-<version>/build/dist/
as
rust-<version>-<target>.tar.xz
and
rust-std-<version>-<target>.tar.xz

These result files are produced when the "dist" build target is
used, ref. BUILD_TARGET. For a normal native build of the rust
pkgsrc package, the default BUILD_TARGET is "build", not "dist".

There are two possible ways to produce a bootstrap kit:

1) a native build. This requires minimum preparation, except
possibly for setting rust.BUILD_TARGET to "dist" via e.g.
/etc/mk.conf. Note that on NetBSD, using the "BUILD_TARGET" ==
"dist" results in the "rust-cargo-static" option being set, ref.
options.mk. This is so that the resulting bootstrap kits are
built with mostly-static linking, reducing the run-time dependencies
of the bootstrap kits.

2) a cross-build. This requires a bit of preparation:

For each target you want to cross-build rust for, you need
- the cross toolchain resulting from "build.sh tools" for
the intended target
- an OS distribution extracted, including the comp.tgz
set so that the target's include files can be used
- for 32-bit ports, the "libatomic" package needs to be
available. I'm sure there's a clever and long-winded
use of pkg_install which can be used to effect this;
I on my hand have always just extracted the tgz file
and done the minimal cleanup of the "cruft" files
which are part of the package meta-data.
- Pick a root directory for the target, e.g. /u/i386.
Below this directory place the "tools" containing
the cross-compiler in a "tools" sub-directory.
Similarly, the extracted OS distribution in the "dest"
sub-directory.

There are two methods available for doing the cross-compile:

a) Using the "cross.mk" file. For an i386 build against i586, the
following settings should be active:

CROSS_ROOT= /u/i386
MAKE_ENV+= CROSS_ROOT=${CROSS_ROOT}
GNU_CROSS_TARGET= i486--netbsdelf
MAKE_ENV+= GNU_CROSS_TARGET=${GNU_CROSS_TARGET}
TARGET= i586-unknown-netbsd
SCRIPTS= ${WRKDIR}/scripts
CONFIGURE_ARGS+= --host=${TARGET}
CONFIGURE_ARGS+= --target=${TARGET}
CONFIGURE_ARGS+= --set=target.${TARGET}.cc=${SCRIPTS}/gcc-wrap
CONFIGURE_ARGS+= --set=target.${TARGET}.cxx=${SCRIPTS}/c++-wrap
CONFIGURE_ARGS+= --set=target.${TARGET}.linker=${SCRIPTS}/gcc-wrap
CONFIGURE_ARGS+= --set=target.${TARGET}.ar=${CROSS_ROOT}/tools/bin/${GNU_CROSS_TARGET}-ar

Then doing a "make" will cross-build rust, including the LLVM
embedded in the rust distribution, ref. the defaulting of that
option when TARGET is defined ref. options.mk.

Note that when TARGET is set, the default build target for
the rust makefile becomes "dist", so there's no need to set
rust.BUILD_TARGET for cross-builds.

b) Using the "do-cross.mk" Makefile. This will attempt to
cross-build rust for all the targets listed in the SHORT_TARGETS
variable in that file. Overriding the root directories for
the various targets can be done by making your own "local-roots.mk"
file, ref. "do-cross.mk".

This will create a "dist" subdirectory in the rust pkgsrc
directory, and the bootstrap kits for each architecture, plus
the library source kit will be placed in this directory.

The bootstrap kits can then be placed in /usr/pkgsrc/distfiles, and
be used by the "next" rust version, where you can use "make makesum"
to compute the updated checksums for the bootstrap kits.
Loading

0 comments on commit e762eaa

Please sign in to comment.