Skip to content

Commit 5e317d3

Browse files
committed
Upgrade rust to version 1.48.0.
Pkgsrc changes: * Compensate for files being moved around upstream. * Introduce optional, on-by-default semi-static building of cargo, using the internal curl and openssl sources. This reduces the dynamic dependencies of cargo and therefore the rust package itself. Ref. options.mk. * The 1.47.0 bootstrap kits have been re-built with the above option turned on, so no longer depends on curl or openssl from pkgsrc and/or from earlier OS or pkgsrc versions. This should hopefully fix installation of rust with non-default PREFIX, ref. PR#54453. Upstream changes: Version 1.48.0 (2020-11-19) ========================== Language -------- - [The `unsafe` keyword is now syntactically permitted on modules.][75857] This is still rejected *semantically*, but can now be parsed by procedural macros. Compiler -------- - [Stabilised the `-C link-self-contained=<yes|no>` compiler flag.][76158] This tells `rustc` whether to link its own C runtime and libraries or to rely on a external linker to find them. (Supported only on `windows-gnu`, `linux-musl`, and `wasi` platforms.) - [You can now use `-C target-feature=+crt-static` on `linux-gnu` targets.] [77386] Note: If you're using cargo you must explicitly pass the `--target` flag. - [Added tier 2\* support for `aarch64-unknown-linux-musl`.][76420] \* Refer to Rust's [platform support page][forge-platform-support] for more information on Rust's tiered platform support. Libraries --------- - [`io::Write` is now implemented for `&ChildStdin` `&Sink`, `&Stdout`, and `&Stderr`.][76275] - [All arrays of any length now implement `TryFrom<Vec<T>>`.][76310] - [The `matches!` macro now supports having a trailing comma.][74880] - [`Vec<A>` now implements `PartialEq<[B]>` where `A: PartialEq<B>`.][74194] - [The `RefCell::{replace, replace_with, clone}` methods now all use `#[track_caller]`.][77055] Stabilized APIs --------------- - [`slice::as_ptr_range`] - [`slice::as_mut_ptr_range`] - [`VecDeque::make_contiguous`] - [`future::pending`] - [`future::ready`] The following previously stable methods are now `const fn`'s: - [`Option::is_some`] - [`Option::is_none`] - [`Option::as_ref`] - [`Result::is_ok`] - [`Result::is_err`] - [`Result::as_ref`] - [`Ordering::reverse`] - [`Ordering::then`] Cargo ----- Rustdoc ------- - [You can now link to items in `rustdoc` using the intra-doc link syntax.][74430] E.g. ``/// Uses [`std::future`]`` will automatically generate a link to `std::future`'s documentation. See ["Linking to items by name"][intradoc-links] for more information. - [You can now specify `#[doc(alias = "<alias>")]` on items to add search aliases when searching through `rustdoc`'s UI.][75740] Compatibility Notes ------------------- - [Promotion of references to `'static` lifetime inside `const fn` now follows the same rules as inside a `fn` body.][75502] In particular, `&foo()` will not be promoted to `'static` lifetime any more inside `const fn`s. - [Associated type bindings on trait objects are now verified to meet the bounds declared on the trait when checking that they implement the trait.][27675] - [When trait bounds on associated types or opaque types are ambiguous, the compiler no longer makes an arbitrary choice on which bound to use.][54121] - [Fixed recursive nonterminals not being expanded in macros during pretty-print/reparse check.][77153] This may cause errors if your macro wasn't correctly handling recursive nonterminal tokens. - [`&mut` references to non zero-sized types are no longer promoted.][75585] - [`rustc` will now warn if you use attributes like `#[link_name]` or `#[cold]` in places where they have no effect.][73461] - [Updated `_mm256_extract_epi8` and `_mm256_extract_epi16` signatures in `arch::{x86, x86_64}` to return `i32` to match the vendor signatures.][73166] - [`mem::uninitialized` will now panic if any inner types inside a struct or enum disallow zero-initialization.][71274] - [`#[target_feature]` will now error if used in a place where it has no effect.][78143] - [Foreign exceptions are now caught by `catch_unwind` and will cause an abort.][70212] Note: This behaviour is not guaranteed and is still considered undefined behaviour, see the [`catch_unwind`] documentation for further information. Internal Only ------------- These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools. - [Building `rustc` from source now uses `ninja` by default over `make`.][74922] You can continue building with `make` by setting `ninja=false` in your `config.toml`. - [cg_llvm: `fewer_names` in `uncached_llvm_type`][76030] - [Made `ensure_sufficient_stack()` non-generic][76680] [78143]: rust-lang/rust#78143 [76680]: rust-lang/rust#76680 [76030]: rust-lang/rust#76030 [70212]: rust-lang/rust#70212 [27675]: rust-lang/rust#27675 [54121]: rust-lang/rust#54121 [71274]: rust-lang/rust#71274 [77386]: rust-lang/rust#77386 [77153]: rust-lang/rust#77153 [77055]: rust-lang/rust#77055 [76275]: rust-lang/rust#76275 [76310]: rust-lang/rust#76310 [76420]: rust-lang/rust#76420 [76158]: rust-lang/rust#76158 [75857]: rust-lang/rust#75857 [75585]: rust-lang/rust#75585 [75740]: rust-lang/rust#75740 [75502]: rust-lang/rust#75502 [74880]: rust-lang/rust#74880 [74922]: rust-lang/rust#74922 [74430]: rust-lang/rust#74430 [74194]: rust-lang/rust#74194 [73461]: rust-lang/rust#73461 [73166]: rust-lang/rust#73166 [intradoc-links]: https://doc.rust-lang.org/rustdoc/linking-to-items-by-name.html [`catch_unwind`]: https://doc.rust-lang.org/std/panic/fn.catch_unwind.html [`Option::is_some`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.is_some [`Option::is_none`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.is_none [`Option::as_ref`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.as_ref [`Result::is_ok`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.is_ok [`Result::is_err`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.is_err [`Result::as_ref`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.as_ref [`Ordering::reverse`]: https://doc.rust-lang.org/std/cmp/enum.Ordering.html#method.reverse [`Ordering::then`]: https://doc.rust-lang.org/std/cmp/enum.Ordering.html#method.then [`slice::as_ptr_range`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_ptr_range [`slice::as_mut_ptr_range`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_mut_ptr_range [`VecDeque::make_contiguous`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.make_contiguous [`future::pending`]: https://doc.rust-lang.org/std/future/fn.pending.html [`future::ready`]: https://doc.rust-lang.org/std/future/fn.ready.html
1 parent 663c234 commit 5e317d3

13 files changed

+310
-156
lines changed

lang/rust/Makefile

+69-27
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# $NetBSD: Makefile,v 1.208 2020/11/29 20:15:15 he Exp $
1+
# $NetBSD: Makefile,v 1.209 2021/01/01 20:44:48 he Exp $
22

3-
DISTNAME= rustc-1.47.0-src
3+
DISTNAME= rustc-1.48.0-src
44
PKGNAME= ${DISTNAME:S/rustc/rust/:S/-src//}
55
CATEGORIES= lang
66
MASTER_SITES= https://static.rust-lang.org/dist/
@@ -44,12 +44,18 @@ CONFIGURE_ARGS+= --disable-ninja
4444
# XXX: to be enabled in the future
4545
#CONFIGURE_ARGS+= --jemalloc-root=${BUILDLINK_PREFIX.jemalloc}/lib
4646

47+
# Include (optional) settings to cross-build rust
48+
.include "cross.mk"
49+
50+
.if !empty(TARGET)
4751
# Use "dist" build target for cross compile of bootstrap
48-
#BUILD_TARGET= dist
52+
BUILD_TARGET= dist
53+
.else
4954
BUILD_TARGET= build
55+
.endif
5056

51-
# Include (optional) settings to cross-build rust
52-
.include "cross.mk"
57+
# More diag when failing
58+
#MAKE_ENV+= RUST_BACKTRACE=1
5359

5460
# Getting RPATH with $ORIGIN into bootstrap may be troublesome, so
5561
# uncommenting the LD_LIBRARY_PATH setting may be required to run
@@ -154,23 +160,23 @@ BUILDLINK_TRANSFORM.NetBSD+= rm:-Wl,--enable-new-dtags
154160
DISTFILES:= ${DEFAULT_DISTFILES}
155161

156162
.if !empty(MACHINE_PLATFORM:MDarwin-*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
157-
RUST_STAGE0_VER= 1.46.0
163+
RUST_STAGE0_VER= 1.47.0
158164
RUST_ARCH:= x86_64-apple-darwin
159165
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
160166
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
161167
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
162168
pre-build-fix:
163169
.endif
164170
.if !empty(MACHINE_PLATFORM:MLinux-*-i386) || make(distinfo) || make (makesum) || make(mdi)
165-
RUST_STAGE0_VER= 1.46.0
171+
RUST_STAGE0_VER= 1.47.0
166172
RUST_ARCH:= i686-unknown-linux-gnu
167173
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
168174
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
169175
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
170176
pre-build-fix:
171177
.endif
172178
.if !empty(MACHINE_PLATFORM:MLinux-*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
173-
RUST_STAGE0_VER= 1.46.0
179+
RUST_STAGE0_VER= 1.47.0
174180
RUST_ARCH:= x86_64-unknown-linux-gnu
175181
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
176182
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
@@ -187,23 +193,23 @@ RUST_BOOTSTRAP_PATH?= ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}
187193
pre-build-fix:
188194
.endif
189195
.if !empty(MACHINE_PLATFORM:MFreeBSD-*-i386) || make(distinfo) || make (makesum) || make(mdi)
190-
RUST_STAGE0_VER= 1.46.0
196+
RUST_STAGE0_VER= 1.47.0
191197
RUST_ARCH:= i686-unknown-freebsd
192198
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
193199
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
194200
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
195201
pre-build-fix:
196202
.endif
197203
.if !empty(MACHINE_PLATFORM:MFreeBSD-*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
198-
RUST_STAGE0_VER= 1.46.0
204+
RUST_STAGE0_VER= 1.47.0
199205
RUST_ARCH:= x86_64-unknown-freebsd
200206
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
201207
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
202208
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
203209
pre-build-fix:
204210
.endif
205211
.if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || make(distinfo) || make (makesum) || make(mdi)
206-
RUST_STAGE0_VER= 1.46.0
212+
RUST_STAGE0_VER= 1.47.0
207213
RUST_ARCH= i686-unknown-netbsd
208214
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
209215
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
@@ -220,15 +226,15 @@ pre-build-fix:
220226
${TOOLS_PLATFORM.paxctl} +am ${WRKDIR}/rust-bootstrap/bin/rustc
221227
.endif
222228
.if !empty(MACHINE_PLATFORM:MNetBSD-*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
223-
RUST_STAGE0_VER= 1.46.0
229+
RUST_STAGE0_VER= 1.47.0
224230
RUST_ARCH= x86_64-unknown-netbsd
225231
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
226232
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
227233
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
228234
pre-build-fix:
229235
.endif
230236
.if !empty(MACHINE_PLATFORM:MNetBSD-*-powerpc) || make(distinfo) || make (makesum) || make(mdi)
231-
RUST_STAGE0_VER= 1.46.0
237+
RUST_STAGE0_VER= 1.47.0
232238
RUST_ARCH= powerpc-unknown-netbsd
233239

234240
# Cross-built against NetBSD 9.0
@@ -252,7 +258,7 @@ SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
252258
pre-build-fix:
253259
.endif
254260
.if !empty(MACHINE_PLATFORM:MNetBSD-*-aarch64) || make(distinfo) || make (makesum) || make(mdi)
255-
RUST_STAGE0_VER= 1.46.0
261+
RUST_STAGE0_VER= 1.47.0
256262
RUST_ARCH= aarch64-unknown-netbsd
257263
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
258264
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
@@ -262,7 +268,7 @@ SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
262268
pre-build-fix:
263269
.endif
264270
.if !empty(MACHINE_PLATFORM:MNetBSD-*-sparc64) || make(distinfo) || make (makesum) || make(mdi)
265-
RUST_STAGE0_VER= 1.46.0
271+
RUST_STAGE0_VER= 1.47.0
266272
RUST_ARCH= sparc64-unknown-netbsd
267273
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
268274
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
@@ -273,7 +279,7 @@ pre-build-fix:
273279
.endif
274280
.if !empty(MACHINE_PLATFORM:MNetBSD-*-earmv7hf) || make(distinfo) || make (makesum) || make(mdi)
275281
RUST_ARCH= armv7-unknown-netbsd-eabihf
276-
RUST_STAGE0_VER= 1.46.0
282+
RUST_STAGE0_VER= 1.47.0
277283
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
278284
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
279285
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
@@ -282,7 +288,8 @@ SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
282288
pre-build-fix:
283289
.endif
284290

285-
# You may override RUST_BOOTSTRAP_PATH and RUST_ARCH in mk.conf if you have a local bootstrap compiler.
291+
# You may override RUST_BOOTSTRAP_PATH and RUST_ARCH in mk.conf
292+
# if you have a local bootstrap compiler.
286293
.if !defined(RUST_ARCH) && !defined(RUST_BOOTSTRAP_PATH)
287294
NOT_FOR_PLATFORM+= ${MACHINE_PLATFORM}
288295
.else
@@ -299,8 +306,9 @@ TOOLS_PLATFORM.gzcat= ${PREFIX}/bin/gzip -cd
299306

300307
SUBST_CLASSES+= rpath
301308
SUBST_STAGE.rpath= pre-configure
302-
SUBST_FILES.rpath+= src/librustc_codegen_ssa/back/linker.rs
309+
SUBST_FILES.rpath+= compiler/rustc_codegen_ssa/src/back/linker.rs
303310
SUBST_FILES.rpath+= src/bootstrap/builder.rs
311+
SUBST_FILES.rpath+= src/bootstrap/compile.rs
304312
SUBST_VARS.rpath= PREFIX
305313

306314
#
@@ -310,16 +318,25 @@ SUBST_VARS.rpath= PREFIX
310318
# updating and verification.
311319
#
312320
CKSUM_CRATES+= vendor/libc
313-
CKSUMS+= 9f96e346d87296e2b0b87b9fe375d67fb66cd88ce61ea2905466c8c5891d3108
314-
CKSUMS+= ebcb0709586e6ed1e8b4538368201638006e26042d464bbc1151bef9eb158f8c
321+
CKSUMS+= a9e46c0eee970cb5b4bd910924141d223fad4aa45380d3df1ce4b25992a13037
322+
CKSUMS+= 41394431697e352653c37188233bd44776881eb704132203b1a232271d1afd92
315323

316324
CKSUM_CRATES+= vendor/lzma-sys
317325
CKSUMS+= 6fd5e9245db34c6f557b8bfcaf03db82fc88c3b06dbfbb5f03b2bcd138983ef9
318326
CKSUMS+= 5e252578b5d266f6a4c8dc9f71ca7a91536ccb8c5c7d7753b82f12ec886459ef
319327

320328
CKSUM_CRATES+= vendor/stacker
321-
CKSUMS+= 37ef9666d048191eeca23d8f7d99cf912b953cc489bf860107aec306b95b2d99
322-
CKSUMS+= 410f22f5e95860530be1abaaf2e279d2f4226e5c17c2cee302661d8079246b3a
329+
CKSUMS+= cee329550bad2ed1182abb71db9c24558a91b12e1eab8d9a48e23b997bb8f04e
330+
CKSUMS+= 79915b243d02df1dc698f5c2de3a9356c6c296d2dedb06d9035dbcc2f8972cf4
331+
332+
CKSUM_CRATES+= vendor/net2
333+
CKSUMS+= 03836f768aaf8c7bc9a351f3c10ce47d1f27f162133e99941850f84bb0e9dbc5
334+
CKSUMS+= bc857fca2bb7a6c999b19911339dff54a882ef096ad424f21dcec9e13600b871
335+
336+
CKSUM_CRATES+= vendor/openssl-src
337+
CKSUMS+= 29499e62a2cde2fda48d21df58812ee5c198ef744522992bde8faae76747ac08
338+
CKSUMS+= e34f9921c6531d043f3516821442aaeda86c7912d40cbddaf79bba6b08c37952
339+
323340

324341
SUBST_CLASSES+= cksum
325342
SUBST_STAGE.cksum= pre-configure
@@ -330,6 +347,17 @@ SUBST_FILES.cksum+= ${crate}/.cargo-checksum.json
330347
SUBST_SED.cksum+= -e 's,${from},${to},g'
331348
.endfor
332349

350+
# Patchelf appears to create unrecognized binaries...
351+
#.if ${OPSYS} == "NetBSD"
352+
#TOOL_DEPENDS+= patchelf-[0-9]*:../../devel/patchelf
353+
#PATCHELF= ${PREFIX}/bin/patchelf
354+
#FORCE_RPATH= --force-rpath
355+
#.endif
356+
357+
#TOOL_DEPENDS+= patchelf-[0-9]*:../../devel/patchelf
358+
#PATCHELF= ${PREFIX}/bin/patchelf
359+
#FORCE_RPATH= --force-rpath
360+
333361
post-extract:
334362
set -e; \
335363
if ${TEST} -e ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}/install.sh \
@@ -351,6 +379,12 @@ post-extract:
351379
${LN} -s gcc-wrap c++-wrap; \
352380
${LN} -s gcc-wrap clang++-wrap; \
353381
${LN} -s gcc-wrap clang-wrap
382+
# Fixup cargo rpath to pick up libcurl.so
383+
# RPATH='${PREFIX}/lib:/lib:/usr/lib:$$ORIGIN/../lib'; \
384+
# for f in bin/cargo; do \
385+
# f=${RUST_BOOTSTRAP_PATH:Q}/$$f; \
386+
# ${PATCHELF} ${FORCE_RPATH} --set-rpath $${RPATH} $$f; \
387+
# done
354388
.endif
355389

356390
.if ${OPSYS} == "FreeBSD"
@@ -439,20 +473,24 @@ stage0-bootstrap: install
439473
${ECHO} "$${RUST_STD_FILE}"; \
440474
)
441475
.endif
476+
442477
.if ${OS_VARIANT} == "SmartOS"
478+
stage0-bootstrap: install
479+
${RM} -rf ${BOOTSTRAP_TMPDIR}
480+
${MKDIR} ${BOOTSTRAP_TMPDIR}
443481
${CP} -R ${DESTDIR}/${PREFIX}/bin ${BOOTSTRAP_TMPDIR}/
444482
${CP} -R ${DESTDIR}/${PREFIX}/lib ${BOOTSTRAP_TMPDIR}/
445483
${MKDIR} ${BOOTSTRAP_TMPDIR}/lib/pkgsrc
446484
for lib in libgcc_s.so.1 libssp.so.0 libstdc++.so.6; do \
447485
${CP} `${PKG_CC} -print-file-name=$${lib}` \
448486
${BOOTSTRAP_TMPDIR}/lib/pkgsrc/; \
449487
done
450-
# direct dependencies
488+
: direct dependencies
451489
for lib in libLLVM-10.so libcrypto.so.1.1 libcurl.so.4 \
452490
libssl.so.1.1 libz.so.1; do \
453491
${CP} ${PREFIX}/lib/$${lib} ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/; \
454492
done
455-
# libcurl dependencies
493+
: libcurl dependencies
456494
for lib in libiconv.so.2 libidn2.so.0 libintl.so.8 liblber-2.4.so.2 \
457495
libldap-2.4.so.2 libnghttp2.so.14 libsasl2.so.3 \
458496
libssh2.so.1 libunistring.so.2; do \
@@ -527,9 +565,13 @@ DEPENDS+= libatomic-links>=0:../../devel/libatomic-links
527565
DEPENDS+= openssl>=1.1:../../security/openssl
528566
.endif
529567

568+
# This is for when we build natively:
569+
.if ((${OPSYS} == "NetBSD") && \
570+
((${MACHINE_ARCH} == "powerpc") || (${MACHINE_ARCH} == "i386")))
571+
# For 8-byte atomics, required by LLVM
572+
.include "../../devel/libatomic/buildlink3.mk"
573+
.endif
574+
530575
.include "../../devel/zlib/buildlink3.mk"
531576
.include "../../lang/python/tool.mk"
532-
.include "../../security/openssl/buildlink3.mk"
533-
BUILDLINK_API_DEPENDS.curl+= curl>=7.67.0
534-
.include "../../www/curl/buildlink3.mk"
535577
.include "../../mk/bsd.pkg.mk"

0 commit comments

Comments
 (0)