Skip to content

Commit

Permalink
Update rust to version 1.34.0.
Browse files Browse the repository at this point in the history
Pkgsrc changes:
 * Bump required rust version to build to 1.33.0.
 * Adapt patches to changed file locations.
 * (I worry about 32-bit ports, now that Atomic64 apparently is First-Class;
   this has been built on NetBSD/amd64 so far)

Upstream changes:

Version 1.34.0 (2019-04-11)
==========================

Language
--------
- [You can now use `#[deprecated = "reason"]`][58166] as a shorthand for
  `#[deprecated(note = "reason")]`. This was previously allowed by mistake
  but had no effect.
- [You can now accept token streams in `#[attr()]`,`#[attr[]]`, and
  `#[attr{}]` procedural macros.][57367]
- [You can now write `extern crate self as foo;`][57407] to import your
  crate's root into the extern prelude.


Compiler
--------
- [You can now target `riscv64imac-unknown-none-elf` and
  `riscv64gc-unknown-none-elf`.][58406]
- [You can now enable linker plugin LTO optimisations with
  `-C linker-plugin-lto`.][58057] This allows rustc to compile your Rust code
  into LLVM bitcode allowing LLVM to perform LTO optimisations across C/C++ FFI
  boundaries.
- [You can now target `powerpc64-unknown-freebsd`.][57809]


Libraries
---------
- [The trait bounds have been removed on some of `HashMap<K, V, S>`'s and
  `HashSet<T, S>`'s basic methods.][58370] Most notably you no longer require
  the `Hash` trait to create an iterator.
- [The `Ord` trait bounds have been removed on some of `BinaryHeap<T>`'s basic
  methods.][58421] Most notably you no longer require the `Ord` trait to create
  an iterator.
- [The methods `overflowing_neg` and `wrapping_neg` are now `const` functions
  for all numeric types.][58044]
- [Indexing a `str` is now generic over all types that
  implement `SliceIndex<str>`.][57604]
- [`str::trim`, `str::trim_matches`, `str::trim_{start, end}`, and
  `str::trim_{start, end}_matches` are now `#[must_use]`][57106] and will
  produce a warning if their returning type is unused.
- [The methods `checked_pow`, `saturating_pow`, `wrapping_pow`, and
  `overflowing_pow` are now available for all numeric types.][57873] These are
  equivalvent to methods such as `wrapping_add` for the `pow` operation.


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

#### std & core
* [`Any::type_id`]
* [`Error::type_id`]
* [`atomic::AtomicI16`]
* [`atomic::AtomicI32`]
* [`atomic::AtomicI64`]
* [`atomic::AtomicI8`]
* [`atomic::AtomicU16`]
* [`atomic::AtomicU32`]
* [`atomic::AtomicU64`]
* [`atomic::AtomicU8`]
* [`convert::Infallible`]
* [`convert::TryFrom`]
* [`convert::TryInto`]
* [`iter::from_fn`]
* [`iter::successors`]
* [`num::NonZeroI128`]
* [`num::NonZeroI16`]
* [`num::NonZeroI32`]
* [`num::NonZeroI64`]
* [`num::NonZeroI8`]
* [`num::NonZeroIsize`]
* [`slice::sort_by_cached_key`]
* [`str::escape_debug`]
* [`str::escape_default`]
* [`str::escape_unicode`]
* [`str::split_ascii_whitespace`]

#### std
* [`Instant::checked_add`]
* [`Instant::checked_sub`]
* [`SystemTime::checked_add`]
* [`SystemTime::checked_sub`]

Cargo
-----
- [You can now use alternative registries to crates.io.][cargo/6654]

Misc
----
- [You can now use the `?` operator in your documentation tests without manually
  adding `fn main() -> Result<(), _> {}`.][56470]

Compatibility Notes
-------------------
- [`Command::before_exec` is now deprecated in favor of the
  unsafe method `Command::pre_exec`.][58059]
- [Use of `ATOMIC_{BOOL, ISIZE, USIZE}_INIT` is now deprecated.][57425] As you
  can now use `const` functions in `static` variables.

[58370]: rust-lang/rust#58370
[58406]: rust-lang/rust#58406
[58421]: rust-lang/rust#58421
[58166]: rust-lang/rust#58166
[58044]: rust-lang/rust#58044
[58057]: rust-lang/rust#58057
[58059]: rust-lang/rust#58059
[57809]: rust-lang/rust#57809
[57873]: rust-lang/rust#57873
[57604]: rust-lang/rust#57604
[57367]: rust-lang/rust#57367
[57407]: rust-lang/rust#57407
[57425]: rust-lang/rust#57425
[57106]: rust-lang/rust#57106
[56470]: rust-lang/rust#56470
[cargo/6654]: rust-lang/cargo#6654
[`Any::type_id`]: https://doc.rust-lang.org/std/any/trait.Any.html#tymethod.type_id
[`Error::type_id`]: https://doc.rust-lang.org/std/error/trait.Error.html#tymethod.type_id
[`atomic::AtomicI16`]: https://doc.rust-lang.org/std/atomic/struct.AtomicI16.html
[`atomic::AtomicI32`]: https://doc.rust-lang.org/std/atomic/struct.AtomicI32.html
[`atomic::AtomicI64`]: https://doc.rust-lang.org/std/atomic/struct.AtomicI64.html
[`atomic::AtomicI8`]: https://doc.rust-lang.org/std/atomic/struct.AtomicI8.html
[`atomic::AtomicU16`]: https://doc.rust-lang.org/std/atomic/struct.AtomicU16.html
[`atomic::AtomicU32`]: https://doc.rust-lang.org/std/atomic/struct.AtomicU32.html
[`atomic::AtomicU64`]: https://doc.rust-lang.org/std/atomic/struct.AtomicU64.html
[`atomic::AtomicU8`]: https://doc.rust-lang.org/std/atomic/struct.AtomicU8.html
[`convert::Infallible`]: https://doc.rust-lang.org/std/convert/enum.Infallible.html
[`convert::TryFrom`]: https://doc.rust-lang.org/std/convert/trait.TryFrom.html
[`convert::TryInto`]: https://doc.rust-lang.org/std/convert/trait.TryInto.html
[`iter::from_fn`]: https://doc.rust-lang.org/std/iter/fn.from_fn.html
[`iter::successors`]: https://doc.rust-lang.org/std/iter/fn.successors.html
[`num::NonZeroI128`]: https://doc.rust-lang.org/std/num/struct.NonZeroI128.html
[`num::NonZeroI16`]: https://doc.rust-lang.org/std/num/struct.NonZeroI16.html
[`num::NonZeroI32`]: https://doc.rust-lang.org/std/num/struct.NonZeroI32.html
[`num::NonZeroI64`]: https://doc.rust-lang.org/std/num/struct.NonZeroI64.html
[`num::NonZeroI8`]: https://doc.rust-lang.org/std/num/struct.NonZeroI8.html
[`num::NonZeroIsize`]: https://doc.rust-lang.org/std/num/struct.NonZeroIsize.html
[`slice::sort_by_cached_key`]: https://doc.rust-lang.org/std/slice/fn.sort_by_cached_key
[`str::escape_debug`]: https://doc.rust-lang.org/std/primitive.str.html#method.escape_debug
[`str::escape_default`]: https://doc.rust-lang.org/std/primitive.str.html#method.escape_default
[`str::escape_unicode`]: https://doc.rust-lang.org/std/primitive.str.html#method.escape_unicode
[`str::split_ascii_whitespace`]: https://doc.rust-lang.org/std/primitive.str.html#method.split_ascii_whitespace
[`Instant::checked_add`]: https://doc.rust-lang.org/std/time/struct.Instant.html#method.checked_add
[`Instant::checked_sub`]: https://doc.rust-lang.org/std/time/struct.Instant.html#method.checked_sub
[`SystemTime::checked_add`]: https://doc.rust-lang.org/std/time/struct.SystemTime.html#method.checked_add
[`SystemTime::checked_sub`]: https://doc.rust-lang.org/std/time/struct.SystemTime.html#method.checked_sub
  • Loading branch information
he32 committed Apr 14, 2019
1 parent e2f706c commit 9852670
Show file tree
Hide file tree
Showing 12 changed files with 138 additions and 151 deletions.
22 changes: 11 additions & 11 deletions lang/rust/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# $NetBSD: Makefile,v 1.93 2019/04/08 14:18:39 gdt Exp $
# $NetBSD: Makefile,v 1.94 2019/04/14 12:42:03 he Exp $

DISTNAME= rustc-1.33.0-src
DISTNAME= rustc-1.34.0-src
PKGNAME= ${DISTNAME:S/rustc/rust/:S/-src//}
CATEGORIES= lang
MASTER_SITES= http://static.rust-lang.org/dist/
Expand Down Expand Up @@ -144,42 +144,42 @@ BUILDLINK_TRANSFORM.NetBSD+= rm:-Wl,--enable-new-dtags
# own bootstrap. See the stage0-bootstrap below for more details.
#
DISTFILES:= ${DEFAULT_DISTFILES}
RUST_STAGE0_VER= 1.32.0
RUST_STAGE0_VER= 1.33.0
#
.if !empty(MACHINE_PLATFORM:MDarwin-*-i386) || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.32.0
RUST_STAGE0_VER= 1.33.0
RUST_ARCH:= i686-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:MDarwin-*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.32.0
RUST_STAGE0_VER= 1.33.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.32.0
RUST_STAGE0_VER= 1.33.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.32.0
RUST_STAGE0_VER= 1.33.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
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
pre-build-fix:
.endif
.if !empty(MACHINE_PLATFORM:MSunOS-*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.32.0
RUST_STAGE0_VER= 1.33.0
RUST_ARCH:= x86_64-sun-solaris
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 @@ -188,15 +188,15 @@ RUST_BOOTSTRAP_PATH?= ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}
pre-build-fix:
.endif
.if !empty(MACHINE_PLATFORM:MFreeBSD-*-i386) || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.32.0
RUST_STAGE0_VER= 1.33.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.32.0
RUST_STAGE0_VER= 1.33.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 @@ -221,7 +221,7 @@ pre-build-fix:
${TOOLS_PLATFORM.paxctl} +am ${WRKDIR}/rust-bootstrap/bin/cargo
.endif
.if !empty(MACHINE_PLATFORM:MNetBSD-*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.32.0
RUST_STAGE0_VER= 1.33.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
147 changes: 73 additions & 74 deletions lang/rust/distinfo

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions lang/rust/patches/patch-src_librustc__llvm_build.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
$NetBSD: patch-src_librustc__llvm_build.rs,v 1.3 2019/03/07 20:19:11 jperkin Exp $
$NetBSD: patch-src_librustc__llvm_build.rs,v 1.4 2019/04/14 12:42:03 he Exp $

fix build on NetBSD HEAD-llvm. XXX there is probably a better way to do this.

--- src/librustc_llvm/build.rs.orig 2018-12-18 23:11:17.000000000 +0000
--- src/librustc_llvm/build.rs.orig 2019-04-10 18:45:55.000000000 +0000
+++ src/librustc_llvm/build.rs
@@ -244,8 +244,14 @@ fn main() {
} else if target.contains("freebsd") {
@@ -246,7 +246,13 @@ fn main() {
"c++"
} else if target.contains("netbsd") && llvm_static_stdcpp.is_some() {
- // NetBSD uses a separate library when relocation is required
// NetBSD uses a separate library when relocation is required
- "stdc++_pic"
+ // NetBSD uses a separate library when relocation is required
+ if env::var_os("PKGSRC_HAVE_LIBCPP").is_some() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
$NetBSD: patch-src_llvm_CMakeLists.txt,v 1.1 2018/06/21 17:13:13 jperkin Exp $
$NetBSD: patch-src_llvm-project_llvm_CMakeLists.txt,v 1.1 2019/04/14 12:42:03 he Exp $

Don't implement sys/regset.h workaround, fix source instead.

--- src/llvm/CMakeLists.txt.orig 2018-03-10 02:51:13.000000000 +0000
+++ src/llvm/CMakeLists.txt
--- src/llvm-project/llvm/CMakeLists.txt.orig 2018-03-10 02:51:13.000000000 +0000
+++ src/llvm-project/llvm/CMakeLists.txt
@@ -806,11 +806,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBS
link_directories("/usr/local/lib")
endif(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
$NetBSD: patch-src_llvm_cmake_modules_AddLLVM.cmake,v 1.3 2018/09/24 03:42:42 minskim Exp $
$NetBSD: patch-src_llvm-project_llvm_cmake_modules_AddLLVM.cmake,v 1.1 2019/04/14 12:42:03 he Exp $

"-z discard-unused" is only supported by Oracle Solaris ld.
On Darwin, use correct install-name for shared libraries.

--- src/llvm/cmake/modules/AddLLVM.cmake.orig 2018-08-01 16:32:37.000000000 +0000
+++ src/llvm/cmake/modules/AddLLVM.cmake
--- src/llvm-project/llvm/cmake/modules/AddLLVM.cmake.orig 2018-08-01 16:32:37.000000000 +0000
+++ src/llvm-project/llvm/cmake/modules/AddLLVM.cmake
@@ -219,8 +219,6 @@ function(add_link_opts target_name)
set_property(TARGET ${target_name} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,-dead_strip")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
$NetBSD: patch-src_llvm_include_llvm-c_DataTypes.h,v 1.1 2018/09/14 10:04:43 jperkin Exp $
$NetBSD: patch-src_llvm-project_llvm_include_llvm-c_DataTypes.h,v 1.1 2019/04/14 12:42:03 he Exp $

Don't implement sys/regset.h workaround, fix source instead.

--- src/llvm/include/llvm-c/DataTypes.h.orig 2018-08-01 16:32:37.000000000 +0000
+++ src/llvm/include/llvm-c/DataTypes.h
--- src/llvm-project/llvm/include/llvm-c/DataTypes.h.orig 2018-08-01 16:32:37.000000000 +0000
+++ src/llvm-project/llvm/include/llvm-c/DataTypes.h
@@ -87,4 +87,27 @@ typedef signed int ssize_t;
#define HUGE_VALF (float)HUGE_VAL
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$NetBSD: patch-src_llvm-project_llvm_include_llvm_Analysis_ConstantFolding.h,v 1.1 2019/04/14 12:42:03 he Exp $

Fix SunOS CS conflict not handled by include/llvm-c/DataTypes.h

--- src/llvm-project/llvm/include/llvm/Analysis/ConstantFolding.h.orig 2018-08-01 16:32:37.000000000 +0000
+++ src/llvm-project/llvm/include/llvm/Analysis/ConstantFolding.h
@@ -20,6 +20,10 @@
#ifndef LLVM_ANALYSIS_CONSTANTFOLDING_H
#define LLVM_ANALYSIS_CONSTANTFOLDING_H

+#ifdef __sun
+#undef CS
+#endif
+
namespace llvm {
class APInt;
template <typename T> class ArrayRef;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
$NetBSD: patch-src_tools_cargo_tests_testsuite_build.rs,v 1.3 2019/03/03 09:16:21 he Exp $
$NetBSD: patch-src_tools_cargo_tests_testsuite_build.rs,v 1.4 2019/04/14 12:42:03 he Exp $

Don't attempt incremental operations on sparc64, ref.
https://sources.debian.org/patches/cargo/0.29.0-1/2007_sparc64_disable_incremental_build.patch/

--- src/tools/cargo/tests/testsuite/build.rs.orig 2018-10-24 20:01:28.000000000 +0000
--- src/tools/cargo/tests/testsuite/build.rs.orig 2019-04-10 18:46:16.000000000 +0000
+++ src/tools/cargo/tests/testsuite/build.rs
@@ -38,6 +38,7 @@ fn cargo_fail_with_no_stderr() {

/// Check that the `CARGO_INCREMENTAL` environment variable results in
/// `rustc` getting `-Zincremental` passed to it.
/// Checks that the `CARGO_INCREMENTAL` environment variable results in
/// `rustc` getting `-C incremental` passed to it.
+#[cfg(not(target_arch = "sparc64"))]
#[test]
fn cargo_compile_incremental() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
$NetBSD: patch-src_tools_rls_src_cmd.rs,v 1.1 2018/12/21 23:12:34 he Exp $
$NetBSD: patch-src_tools_rls_rls_src_cmd.rs,v 1.1 2019/04/14 12:42:03 he Exp $

--- src/tools/rls/src/cmd.rs.orig 2018-12-18 23:12:41.000000000 +0000
+++ src/tools/rls/src/cmd.rs
Use 32-bit atomic instead of 64-bit; latter may not be available on
32-bit platforms (powerpc, earmv7).

--- src/tools/rls/rls/src/cmd.rs.orig 2019-04-10 18:46:16.000000000 +0000
+++ src/tools/rls/rls/src/cmd.rs
@@ -17,7 +17,7 @@ use crate::config::Config;
use crate::server::{self, LsService, Notification, Request, RequestId};
use rls_analysis::{AnalysisHost, Target};
use rls_vfs::Vfs;
-use std::sync::atomic::{AtomicU64, Ordering};
+use std::sync::atomic::{AtomicU32, Ordering};

use languageserver_types::{
use lsp_types::{
ClientCapabilities, CodeActionContext, CodeActionParams, CompletionItem,
@@ -424,8 +424,8 @@ fn url(file_name: &str) -> Url {
@@ -323,8 +323,8 @@ fn url(file_name: &str) -> Url {
}

fn next_id() -> RequestId {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
$NetBSD: patch-src_tools_rls_src_server_io.rs,v 1.1 2018/12/21 23:12:34 he Exp $
$NetBSD: patch-src_tools_rls_rls_src_server_io.rs,v 1.1 2019/04/14 12:42:03 he Exp $

--- src/tools/rls/src/server/io.rs.orig 2018-12-18 23:12:41.000000000 +0000
+++ src/tools/rls/src/server/io.rs
Use 32-bit atomic instead of 64-bit; latter may not be available on
32-bit platforms (powerpc, earmv7).

--- src/tools/rls/rls/src/server/io.rs.orig 2019-04-10 18:46:16.000000000 +0000
+++ src/tools/rls/rls/src/server/io.rs
@@ -17,7 +17,7 @@ use crate::lsp_data::{LSPNotification, L

use std::fmt;
Expand All @@ -11,7 +14,7 @@ $NetBSD: patch-src_tools_rls_src_server_io.rs,v 1.1 2018/12/21 23:12:34 he Exp $
use std::sync::Arc;

use jsonrpc_core::{self as jsonrpc, response, version, Id};
@@ -190,14 +190,14 @@ pub trait Output: Sync + Send + Clone +
@@ -182,13 +182,13 @@ pub trait Output: Sync + Send + Clone +
/// An output that sends notifications and responses on `stdout`.
#[derive(Clone)]
pub(super) struct StdioOutput {
Expand All @@ -21,14 +24,13 @@ $NetBSD: patch-src_tools_rls_src_server_io.rs,v 1.1 2018/12/21 23:12:34 he Exp $

impl StdioOutput {
/// Construct a new `stdout` output.
crate fn new() -> StdioOutput {
StdioOutput {
- next_id: Arc::new(AtomicU64::new(1)),
+ next_id: Arc::new(AtomicU32::new(1)),
}
pub(crate) fn new() -> StdioOutput {
- StdioOutput { next_id: Arc::new(AtomicU64::new(1)) }
+ StdioOutput { next_id: Arc::new(AtomicU32::new(1)) }
}
}
@@ -215,7 +215,7 @@ impl Output for StdioOutput {

@@ -205,7 +205,7 @@ impl Output for StdioOutput {
}

fn provide_id(&self) -> RequestId {
Expand Down
16 changes: 0 additions & 16 deletions lang/rust/patches/patch-src_tools_tidy_src_features.rs

This file was deleted.

0 comments on commit 9852670

Please sign in to comment.