Skip to content

Commit

Permalink
Update lang/rust to version 1.50.0.
Browse files Browse the repository at this point in the history
Pkgsrc changes:
 * Adjust patches, re-compute line offsets, fix capitalization.
 * Remove i686/FreeBSD support, no longer provided upstream.
 * Bump bootstraps to 1.49.0.
 * Change USE_TOOLS from bsdtar to gtar.
 * Reduce diffs to pkgsrc-wip package patches.
 * Allow rust.BUILD_TARGET to override automatic choice of target.
 * Add an i586/NetBSD (pentium) bootstrap variant (needs testing),
   not yet added as bootstrap since 1.49 doesn't have that variant.

Upstream changes:

Version 1.50.0 (2021-02-11)
============================

Language
-----------------------
- [You can now use `const` values for `x` in `[x; N]` array
  expressions.][79270] This has been technically possible since
  1.38.0, as it was unintentionally stabilized.
- [Assignments to `ManuallyDrop<T>` union fields are now considered
  safe.][78068]

Compiler
-----------------------
- [Added tier 3\* support for the `armv5te-unknown-linux-uclibceabi`
  target.][78142]
- [Added tier 3 support for the `aarch64-apple-ios-macabi` target.][77484]
- [The `x86_64-unknown-freebsd` is now built with the full toolset.][79484]

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

Libraries
-----------------------

- [`proc_macro::Punct` now implements `PartialEq<char>`.][78636]
- [`ops::{Index, IndexMut}` are now implemented for fixed sized
  arrays of any length.][74989]
- [On Unix platforms, the `std::fs::File` type now has a "niche"
  of `-1`.][74699] This value cannot be a valid file descriptor,
  and now means `Option<File>` takes up the same amount of space
  as `File`.

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

- [`bool::then`]
- [`btree_map::Entry::or_insert_with_key`]
- [`f32::clamp`]
- [`f64::clamp`]
- [`hash_map::Entry::or_insert_with_key`]
- [`Ord::clamp`]
- [`RefCell::take`]
- [`slice::fill`]
- [`UnsafeCell::get_mut`]

The following previously stable methods are now `const`.

- [`IpAddr::is_ipv4`]
- [`IpAddr::is_ipv6`]
- [`Layout::size`]
- [`Layout::align`]
- [`Layout::from_size_align`]
- `pow` for all integer types.
- `checked_pow` for all integer types.
- `saturating_pow` for all integer types.
- `wrapping_pow` for all integer types.
- `next_power_of_two` for all unsigned integer types.
- `checked_power_of_two` for all unsigned integer types.

Cargo
-----------------------

- [Added the `[build.rustc-workspace-wrapper]` option.][cargo/8976]
  This option sets a wrapper to execute instead of `rustc`, for
  workspace members only.
- [`cargo:rerun-if-changed` will now, if provided a directory, scan the entire
  contents of that directory for changes.][cargo/8973]
- [Added the `--workspace` flag to the `cargo update` command.][cargo/8725]

Misc
----

- [The search results tab and the help button are focusable with
  keyboard in rustdoc.][79896]
- [Running tests will now print the total time taken to execute.][75752]

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

- [The `compare_and_swap` method on atomics has been deprecated.][79261]
  It's recommended to use the `compare_exchange` and
  `compare_exchange_weak` methods instead.
- [Changes in how `TokenStream`s are checked have fixed some cases
  where you could write unhygenic `macro_rules!` macros.][79472]
- [`#![test]` as an inner attribute is now considered unstable like
  other inner macro attributes, and reports an error by default
  through the `soft_unstable` lint.][79003]
- [Overriding a `forbid` lint at the same level that it was set is
  now a hard error.][78864]
- [Dropped support for all cloudabi targets.][78439]
- [You can no longer intercept `panic!` calls by supplying your
  own macro.][78343] It's recommended to use the `#[panic_handler]`
  attribute to provide your own implementation.
- [Semi-colons after item statements (e.g. `struct Foo {};`) now
  produce a warning.][78296]

[74989]: rust-lang/rust#74989
[79261]: rust-lang/rust#79261
[79896]: rust-lang/rust#79896
[79484]: rust-lang/rust#79484
[79472]: rust-lang/rust#79472
[79270]: rust-lang/rust#79270
[79003]: rust-lang/rust#79003
[78864]: rust-lang/rust#78864
[78636]: rust-lang/rust#78636
[78439]: rust-lang/rust#78439
[78343]: rust-lang/rust#78343
[78296]: rust-lang/rust#78296
[78068]: rust-lang/rust#78068
[75752]: rust-lang/rust#75752
[74699]: rust-lang/rust#74699
[78142]: rust-lang/rust#78142
[77484]: rust-lang/rust#77484
[cargo/8976]: rust-lang/cargo#8976
[cargo/8973]: rust-lang/cargo#8973
[cargo/8725]: rust-lang/cargo#8725
[`IpAddr::is_ipv4`]: https://doc.rust-lang.org/stable/std/net/enum.IpAddr.html#method.is_ipv4
[`IpAddr::is_ipv6`]: https://doc.rust-lang.org/stable/std/net/enum.IpAddr.html#method.is_ipv6
[`Layout::align`]: https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.align
[`Layout::from_size_align`]: https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.from_size_align
[`Layout::size`]: https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.size
[`Ord::clamp`]: https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html#method.clamp
[`RefCell::take`]: https://doc.rust-lang.org/stable/std/cell/struct.RefCell.html#method.take
[`UnsafeCell::get_mut`]: https://doc.rust-lang.org/stable/std/cell/struct.UnsafeCell.html#method.get_mut
[`bool::then`]: https://doc.rust-lang.org/stable/std/primitive.bool.html#method.then
[`btree_map::Entry::or_insert_with_key`]: https://doc.rust-lang.org/stable/std/collections/btree_map/enum.Entry.html#method.or_insert_with_key
[`f32::clamp`]: https://doc.rust-lang.org/stable/std/primitive.f32.html#method.clamp
[`f64::clamp`]: https://doc.rust-lang.org/stable/std/primitive.f64.html#method.clamp
[`hash_map::Entry::or_insert_with_key`]: https://doc.rust-lang.org/stable/std/collections/hash_map/enum.Entry.html#method.or_insert_with_key
[`slice::fill`]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.fill
  • Loading branch information
he32 committed Apr 19, 2021
1 parent 04b28e8 commit 39635f8
Show file tree
Hide file tree
Showing 27 changed files with 243 additions and 205 deletions.
41 changes: 19 additions & 22 deletions lang/rust/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# $NetBSD: Makefile,v 1.229 2021/04/16 01:14:37 gutteridge Exp $
# $NetBSD: Makefile,v 1.230 2021/04/19 17:08:09 he Exp $

DISTNAME= rustc-1.49.0-src
DISTNAME= rustc-1.50.0-src
PKGNAME= ${DISTNAME:S/rustc/rust/:S/-src//}
PKGREVISION= 1
CATEGORIES= lang
MASTER_SITES= https://static.rust-lang.org/dist/

Expand Down Expand Up @@ -49,11 +48,15 @@ CONFIGURE_ARGS+= --disable-ninja
# Include (optional) settings to cross-build rust
.include "cross.mk"

.if !empty(rust.BUILD_TARGET)
BUILD_TARGET= ${rust.BUILD_TARGET)
.endif

.if !empty(TARGET)
# Use "dist" build target for cross compile of bootstrap
BUILD_TARGET= dist
BUILD_TARGET?= dist
.else
BUILD_TARGET= build
BUILD_TARGET?= build
.endif

# Getting RPATH with $ORIGIN into bootstrap may be troublesome, so
Expand Down Expand Up @@ -157,23 +160,23 @@ BUILDLINK_TRANSFORM.NetBSD+= rm:-Wl,--enable-new-dtags
DISTFILES:= ${DEFAULT_DISTFILES}

.if !empty(MACHINE_PLATFORM:MDarwin-*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.48.0
RUST_STAGE0_VER= 1.49.0
RUST_ARCH:= x86_64-apple-darwin
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
pre-build-fix:
.endif
.if !empty(MACHINE_PLATFORM:MLinux-*-i386) || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.48.0
RUST_STAGE0_VER= 1.49.0
RUST_ARCH:= i686-unknown-linux-gnu
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
pre-build-fix:
.endif
.if !empty(MACHINE_PLATFORM:MLinux-*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.48.0
RUST_STAGE0_VER= 1.49.0
RUST_ARCH:= x86_64-unknown-linux-gnu
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
Expand All @@ -186,7 +189,7 @@ pre-build-fix:
# x86_64-sun-solaris bootstrap and comment out the overrides.
#
.if !empty(MACHINE_PLATFORM:MSunOS-*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.48.0
RUST_STAGE0_VER= 1.49.0
RUST_ARCH:= x86_64-unknown-illumos
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
SITES.${RUST_STAGE0}= https://us-east.manta.joyent.com/pkgsrc/public/pkg-bootstraps/
Expand All @@ -199,16 +202,8 @@ CONFIGURE_ARGS+= --host=${RUST_ARCH}
CONFIGURE_ARGS+= --target=${RUST_ARCH}
pre-build-fix:
.endif
.if !empty(MACHINE_PLATFORM:MFreeBSD-*-i386) || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.48.0
RUST_ARCH:= i686-unknown-freebsd
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
pre-build-fix:
.endif
.if !empty(MACHINE_PLATFORM:MFreeBSD-*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.48.0
RUST_STAGE0_VER= 1.49.0
RUST_ARCH:= x86_64-unknown-freebsd
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
Expand All @@ -233,7 +228,7 @@ pre-build-fix:
${TOOLS_PLATFORM.paxctl} +am ${WRKDIR}/rust-bootstrap/bin/rustc
.endif
.if !empty(MACHINE_PLATFORM:MNetBSD-*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.48.0
RUST_STAGE0_VER= 1.49.0
RUST_ARCH= x86_64-unknown-netbsd
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
Expand Down Expand Up @@ -343,7 +338,7 @@ CKSUMS+= 9e146a847e1f726fa7d7eae224aaa925030287f99770f950a012cb398e088d12

CKSUM_CRATES+= vendor/openssl-src
CKSUMS+= 03dcdaac7de880b860ecfe859ba2ac3e46c8f46a7bf948aa674147eebee421b0
CKSUMS+= 41ab6811d4ffde68f245e5097081ba8052a07a4b86df69a356ba11205e7e2210
CKSUMS+= 90456c77ade1702fbf116d9cdc57c0c8dba5f059f591d3dffc9b54c7a7088be8

SUBST_CLASSES+= cksum
SUBST_STAGE.cksum= pre-configure
Expand All @@ -370,11 +365,13 @@ post-extract:
${RM} -f c++-wrap; \
${RM} -f clang++-wrap; \
${RM} -f clang-wrap; \
${RM} -f ar-wrap; \
${CP} ${.CURDIR}/files/gcc-wrap .; \
${CHMOD} +x gcc-wrap; \
${LN} -s gcc-wrap c++-wrap; \
${LN} -s gcc-wrap clang++-wrap; \
${LN} -s gcc-wrap clang-wrap
${LN} -s gcc-wrap clang-wrap; \
${LN} -s gcc-wrap ar-wrap
.endif

.if ${OPSYS} == "FreeBSD"
Expand Down Expand Up @@ -444,7 +441,7 @@ GENERATE_PLIST+= ${FIND} ${DESTDIR}${PREFIX} \( -type f -o -type l \) -print | \
#BOOTSTRAP_NAME= ${PKGNAME_NOREV:C/rust/rust-nightly/}-${RUST_ARCH}
BOOTSTRAP_NAME= ${PKGNAME_NOREV}-${RUST_ARCH}
BOOTSTRAP_TMPDIR= ${WRKDIR}/${BOOTSTRAP_NAME}
USE_TOOLS+= bsdtar
USE_TOOLS+= gtar

# The NetBSD part is so far untested, because I could not convince
# the rust build to use the gcc wrapper when building natively,
Expand Down
6 changes: 3 additions & 3 deletions lang/rust/buildlink3.mk
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# $NetBSD: buildlink3.mk,v 1.7 2020/11/13 20:35:58 he Exp $

BUILDLINK_TREE+= rust
# $NetBSD: buildlink3.mk,v 1.8 2021/04/19 17:08:09 he Exp $

#
# DO NOT include this directly! Use rust.mk instead.
#

BUILDLINK_TREE+= rust

.if !defined(RUST_BUILDLINK3_MK)
RUST_BUILDLINK3_MK:=

Expand Down
16 changes: 10 additions & 6 deletions lang/rust/cross.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: cross.mk,v 1.3 2020/07/16 09:35:37 jperkin Exp $
# $NetBSD: cross.mk,v 1.4 2021/04/19 17:08:09 he Exp $

# These settings may be used to cross-build rust.
#
Expand All @@ -18,6 +18,7 @@
#CROSS_ROOT= /u/9.0-macppc
#CROSS_ROOT= /u/evbarm64
#CROSS_ROOT= /u/i386
#CROSS_ROOT= /
#MAKE_ENV+= CROSS_ROOT=${CROSS_ROOT}

# The GNU cross target designation
Expand All @@ -37,14 +38,17 @@
#TARGET= powerpc-unknown-netbsd
#TARGET= aarch64-unknown-netbsd
#TARGET= i686-unknown-netbsd
#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
# Pick one:
#CONFIGURE_ARGS+= --set=target.${TARGET}.ar=${CROSS_ROOT}/tools/bin/${GNU_CROSS_TARGET}-ar
#CONFIGURE_ARGS+= --set=target.${TARGET}.ar=${SCRIPTS}/ar-wrap

# May be required when cross-building on NetBSD
#MAKE_ENV+= OPENSSL_DIR=/usr
Expand All @@ -53,15 +57,15 @@
# Cross-compile illumos target. The host is identical, it's just the target
# that is renamed from x86_64-sun-solaris to x86_64-unknown-illumos.
#
#TARGET= x86_64-unknown-illumos
#TARGET= x86_64-unknown-illumos
#
# Use these variables for "cross-compiling" from x86_64-sun-solaris.
#
#CONFIGURE_ARGS+= --set=target.${TARGET}.llvm-config=${LLVM_CONFIG_PATH}
#CONFIGURE_ARGS+= --host=${TARGET}
#CONFIGURE_ARGS+= --target=${TARGET}
#CONFIGURE_ARGS+= --set=target.${TARGET}.llvm-config=${LLVM_CONFIG_PATH}
#CONFIGURE_ARGS+= --host=${TARGET}
#CONFIGURE_ARGS+= --target=${TARGET}
#
# Set this variable when using a native x86_64-unknown-illumos bootstrap, as
# the build still defaults to x86_64-sun-solaris based on uname.
#
#CONFIGURE_ARGS+= --build=${TARGET}
#CONFIGURE_ARGS+= --build=${TARGET}
Loading

0 comments on commit 39635f8

Please sign in to comment.