diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk index 8caf60926679..18db16f996cd 100644 --- a/Mk/Uses/cargo.mk +++ b/Mk/Uses/cargo.mk @@ -1,422 +1,422 @@ # This file contains logic to ease porting of Rust packages or # binaries using the `cargo` command. # # Feature: cargo # Usage: USES=cargo # Valid ARGS: none # # MAINTAINER: rust@FreeBSD.org .if !defined(_INCLUDE_USES_CARGO_MK) _INCLUDE_USES_CARGO_MK= yes . if !empty(cargo_ARGS) IGNORE+= USES=cargo takes no arguments . endif .sinclude "${MASTERDIR}/Makefile.crates" # List of static dependencies. The format is cratename-version. # CARGO_CRATES will be downloaded from MASTER_SITE_CRATESIO. CARGO_CRATES?= # List of features to build (space separated list). # Use special token --no-default-features to disable default # features by passing it to cargo build/install/test. CARGO_FEATURES?= # Name of the local directory for vendoring crates. CARGO_VENDOR_DIR?= ${WRKSRC}/cargo-crates # Default path for cargo manifest. CARGO_CARGOTOML?= ${WRKSRC}/Cargo.toml CARGO_CARGOLOCK?= ${WRKSRC}/Cargo.lock # Save crates inside ${DISTDIR}/rust/crates by default. CARGO_DIST_SUBDIR?= rust/crates # Generate list of DISTFILES. # Prefer canonical file extension .crate going forward . if make(makesum) CARGO_CRATE_EXT= .crate . else # If there is a rust/crates/*.tar.gz in distinfo keep using the old # extension. We need to delay eval until the last moment for # DISTINFO_FILE. We cache the command output to avoid multiple # slow grep runs for every CARGO_CRATE_EXT access. CARGO_CRATE_EXT= ${defined(_CARGO_CRATE_EXT_CACHE):?${_CARGO_CRATE_EXT_CACHE}:${:!if ${GREP} -q '\(${CARGO_DIST_SUBDIR}/.*\.tar\.gz\)' "${DISTINFO_FILE}" 2>/dev/null; then ${ECHO_CMD} .tar.gz; else ${ECHO_CMD} .crate; fi!:_=_CARGO_CRATE_EXT_CACHE}} . endif _CARGO_CRATES:= ${CARGO_CRATES:N*@git+*} _CARGO_GIT_SOURCES:= ${CARGO_CRATES:M*@git+*} # enumerate crates for unqiue and sane distfile group names _CARGO_CRATES:= ${empty(_CARGO_CRATES):?:${_CARGO_CRATES:range:@i@$i ${_CARGO_CRATES:[$i]}@}} # split up crates into (index, crate, name, version) 4-tuples _CARGO_CRATES:= ${_CARGO_CRATES:C/^([-_a-zA-Z0-9]+)-([0-9].*)/\0 \1 \2/} . for _index _crate _name _version in ${_CARGO_CRATES} # Resolving CRATESIO alias is very inefficient with many MASTER_SITES, consume MASTER_SITE_CRATESIO directly MASTER_SITES+= ${MASTER_SITE_CRATESIO:S,%SUBDIR%,${_name}/${_version},:S,$,:_cargo_${_index},} DISTFILES+= ${CARGO_DIST_SUBDIR}/${_crate}${CARGO_CRATE_EXT}:_cargo_${_index} # Provide pointer to the crate's extraction dir WRKSRC_crate_${_name}= ${CARGO_VENDOR_DIR}/${_crate} # ... also with version suffix in case of multiple versions of the # same crate WRKSRC_crate_${_crate}= ${CARGO_VENDOR_DIR}/${_crate} . endfor _CARGO_AWK= ${AWK} -vCP="${CP}" -vFIND="${FIND}" -vGREP="${GREP}" \ -vCARGO_VENDOR_DIR="${CARGO_VENDOR_DIR}" \ -vGIT_SOURCES="${_CARGO_GIT_SOURCES}" \ -vWRKDIR="${WRKDIR}" -vWRKSRC="${WRKSRC}" \ -f${SCRIPTSDIR}/split-url.awk \ -f${SCRIPTSDIR}/cargo-crates-git-common.awk -f . if !empty(_CARGO_GIT_SOURCES) . for _index _site _filename _wrksrc _crates in ${:!${_CARGO_AWK} ${SCRIPTSDIR}/cargo-crates-git-fetch.awk /dev/null!} MASTER_SITES+= ${_site}:_cargo_git${_index} DISTFILES+= ${_filename}:_cargo_git${_index} . for _crate in ${_crates:S/,/ /g} # Make sure the build dependencies checks below can work for git sourced crates too _CARGO_CRATES+= @git ${_crate} ${_crate} @git # Provide pointer to the crate's extraction dir # # This might not point to the actual crate's sources since a # single git source can contain multiple crates. We cannot collect # subdir information until after the full extraction is done and we # cannot set make variables at that point. This is better than # nothing. WRKSRC_crate_${_crate}= ${WRKDIR}/${_wrksrc} . endfor . endfor . endif # Build dependencies. CARGO_BUILDDEP?= yes . if ${CARGO_BUILDDEP:tl} == "yes" -BUILD_DEPENDS+= ${RUST_DEFAULT}>=1.72.0:lang/${RUST_DEFAULT} +BUILD_DEPENDS+= ${RUST_DEFAULT}>=1.73.0:lang/${RUST_DEFAULT} . elif ${CARGO_BUILDDEP:tl} == "any-version" BUILD_DEPENDS+= ${RUST_DEFAULT}>=0:lang/${RUST_DEFAULT} . endif # Location of toolchain (default to lang/rust's toolchain) CARGO?= ${LOCALBASE}/bin/cargo RUSTC?= ${LOCALBASE}/bin/rustc RUSTDOC?= ${LOCALBASE}/bin/rustdoc # Location of the cargo output directory. CARGO_TARGET_DIR?= ${WRKDIR}/target # Default target platform (affects some RUSTFLAGS if passed) CARGO_BUILD_TARGET?= ${_CARGO_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} _CARGO_RUST_ARCH_amd64= x86_64 _CARGO_RUST_ARCH_i386= i686 _CARGO_RUST_ARCH_riscv64= riscv64gc # Environment for cargo # - CARGO_HOME: local cache of the registry index # - CARGO_BUILD_JOBS: configure number of jobs to run # - CARGO_TARGET_DIR: location of where to place all generated artifacts # - RUST_BACKTRACE: produce backtraces when something in the build panics # - RUSTC: path of rustc binary (default to lang/rust) # - RUSTDOC: path of rustdoc binary (default to lang/rust) # - RUSTFLAGS: custom flags to pass to all compiler invocations that Cargo performs CARGO_ENV+= \ CARGO_HOME=${WRKDIR}/cargo-home \ CARGO_BUILD_JOBS=${MAKE_JOBS_NUMBER} \ CARGO_BUILD_TARGET=${CARGO_BUILD_TARGET} \ CARGO_TARGET_DIR=${CARGO_TARGET_DIR} \ CARGO_TARGET_${CARGO_BUILD_TARGET:S/-/_/g:tu}_LINKER="${CC}" \ RUSTC=${RUSTC} \ RUSTDOC=${RUSTDOC} \ RUSTFLAGS="${RUSTFLAGS} ${LDFLAGS:C/.+/-C link-arg=&/}" . if ${ARCH} != powerpc CARGO_ENV+= RUST_BACKTRACE=1 . endif . if !defined(LTO_UNSAFE) || (defined(LTO_DISABLE_CHECK) && ${ARCH} == riscv64) _CARGO_MSG= "===> Additional optimization to port applied" WITH_LTO= yes . endif # Adjust -C target-cpu if -march/-mcpu is set by bsd.cpu.mk . if ${ARCH} == amd64 || ${ARCH} == i386 RUSTFLAGS+= ${CFLAGS:M-march=*:S/-march=/-C target-cpu=/} . elif ${ARCH:Mpowerpc*} RUSTFLAGS+= ${CFLAGS:M-mcpu=*:S/-mcpu=/-C target-cpu=/:S/power/pwr/} . elif ${ARCH} == aarch64 || ${ARCH} == armv7 RUSTFLAGS+= -C target-cpu=${CPUTYPE:C/\+.+//g} . else RUSTFLAGS+= ${CFLAGS:M-mcpu=*:S/-mcpu=/-C target-cpu=/} . endif . if defined(PPC_ABI) && ${PPC_ABI} == ELFv1 USE_GCC?= yes STRIP_CMD= ${LOCALBASE}/bin/strip # unsupported e_type with base strip . endif # Helper to shorten cargo calls. _CARGO_RUN= ${SETENV} ${MAKE_ENV} ${CARGO_ENV} ${CARGO} CARGO_CARGO_RUN= cd ${WRKSRC}; ${SETENV} CARGO_FREEBSD_PORTS_SKIP_GIT_UPDATE=1 ${_CARGO_RUN} # User arguments for cargo targets. CARGO_BUILD_ARGS?= CARGO_INSTALL_ARGS?= CARGO_INSTALL_PATH?= . CARGO_TEST_ARGS?= CARGO_UPDATE_ARGS?= # Use module targets ? CARGO_BUILD?= yes CARGO_CONFIGURE?= yes CARGO_INSTALL?= yes CARGO_TEST?= yes # rustc stashes intermediary files in TMPDIR (default /tmp) which # might cause issues for users that for some reason space limit # their /tmp. WRKDIR should have plenty of space. # Allow users and ports to still overwrite it. . if ${TMPDIR:U/tmp} == /tmp TMPDIR= ${WRKDIR} . endif # Manage crate features. . if !empty(CARGO_FEATURES:M--no-default-features) CARGO_BUILD_ARGS+= --no-default-features CARGO_INSTALL_ARGS+= --no-default-features CARGO_TEST_ARGS+= --no-default-features . endif . if !empty(CARGO_FEATURES:N--no-default-features) CARGO_BUILD_ARGS+= --features='${CARGO_FEATURES:N--no-default-features}' CARGO_INSTALL_ARGS+= --features='${CARGO_FEATURES:N--no-default-features}' CARGO_TEST_ARGS+= --features='${CARGO_FEATURES:N--no-default-features}' . endif . if !defined(WITH_DEBUG) CARGO_BUILD_ARGS+= --release CARGO_TEST_ARGS+= --release . else CARGO_INSTALL_ARGS+= --debug . endif . if ${_CARGO_CRATES:Mcmake} BUILD_DEPENDS+= cmake:devel/cmake-core . endif . if ${_CARGO_CRATES:Mgettext-sys} CARGO_ENV+= GETTEXT_BIN_DIR=${LOCALBASE}/bin \ GETTEXT_INCLUDE_DIR=${LOCALBASE}/include \ GETTEXT_LIB_DIR=${LOCALBASE}/lib . endif . if ${_CARGO_CRATES:Mjemalloc-sys} BUILD_DEPENDS+= gmake:devel/gmake . endif . if ${_CARGO_CRATES:Mlibgit2-sys} # Use the system's libgit2 instead of building the bundled version CARGO_ENV+= LIBGIT2_SYS_USE_PKG_CONFIG=1 . endif . if ${_CARGO_CRATES:Mlibssh2-sys} # Use the system's libssh2 instead of building the bundled version CARGO_ENV+= LIBSSH2_SYS_USE_PKG_CONFIG=1 . endif . if ${_CARGO_CRATES:Monig_sys} # onig_sys always prefers the system library but will try to link # statically with it. Since devel/oniguruma doesn't provide a static # library it'll link to libonig.so instead. Strictly speaking setting # RUSTONIG_SYSTEM_LIBONIG is not necessary, but will force onig_sys to # always use the system's libonig as returned by `pkg-config oniguruma`. CARGO_ENV+= RUSTONIG_SYSTEM_LIBONIG=1 . endif . if ${_CARGO_CRATES:Mopenssl-src} DEV_WARNING+= "Please make sure this port uses the system OpenSSL and consider removing CARGO_CRATES=${CARGO_CRATES:Mopenssl-src-[0-9]*} (a vendored copy of OpenSSL) from the build, e.g., by patching Cargo.toml appropriately." . endif . if ${_CARGO_CRATES:Mopenssl-sys} # Make sure that openssl-sys can find the correct version of OpenSSL CARGO_ENV+= OPENSSL_LIB_DIR=${OPENSSLLIB} \ OPENSSL_INCLUDE_DIR=${OPENSSLINC} . endif . if ${_CARGO_CRATES:Mpkg-config} .include "${USESDIR}/pkgconfig.mk" . endif . if ${_CARGO_CRATES:Mzstd-sys} # Use the system's zstd instead of building the bundled version CARGO_ENV+= ZSTD_SYS_USE_PKG_CONFIG=1 . endif . for _index _crate _name _version in ${_CARGO_CRATES} # Split up semantic version and try to sanitize it by removing # pre-release identifier (-) or build metadata (+) . if ${_version:S/./ /:S/./ /:C/[-+].*//:_:[#]} == 3 . for _major _minor _patch in $_ # FreeBSD 12.0 changed ABI: r318736 and r320043 # https://github.com/rust-lang/libc/commit/78f93220d70e # https://github.com/rust-lang/libc/commit/969ad2b73cdc . if ${_name} == libc && ${_major} == 0 && (${_minor} < 2 || (${_minor} == 2 && ${_patch} < 38)) DEV_ERROR+= "CARGO_CRATES=${_crate} may be unstable on FreeBSD 12.0. Consider updating to the latest version \(higher than 0.2.37\)." . endif . if ${_name} == libc && ${_major} == 0 && (${_minor} < 2 || (${_minor} == 2 && ${_patch} < 49)) DEV_ERROR+= "CARGO_CRATES=${_crate} may be unstable on aarch64 or not build on armv6, armv7, powerpc64. Consider updating to the latest version \(higher than 0.2.49\)." . endif # FreeBSD 12.0 updated base OpenSSL in r339270: # https://github.com/sfackler/rust-openssl/commit/276577553501 . if ${_name} == openssl && !exists(${PATCHDIR}/patch-openssl-1.1.1) && ${_major} == 0 && (${_minor} < 10 || (${_minor} == 10 && ${_patch} < 4)) DEV_WARNING+= "CARGO_CRATES=${_crate} does not support OpenSSL 1.1.1. Consider updating to the latest version \(higher than 0.10.3\)." . endif . endfor . endif . endfor _USES_extract+= 600:cargo-extract cargo-extract: # target for preparing crates directory. It will put all crates in # the local crates directory. @${ECHO_MSG} "===> Moving crates to ${CARGO_VENDOR_DIR}" @${MKDIR} ${CARGO_VENDOR_DIR} . for _index _crate _name _version in ${_CARGO_CRATES} . if ${_index} != @git @${MV} ${WRKDIR}/${_crate} ${CARGO_VENDOR_DIR}/${_crate} @${PRINTF} '{"package":"%s","files":{}}' \ $$(${SHA256} -q ${DISTDIR}/${CARGO_DIST_SUBDIR}/${_crate}${CARGO_CRATE_EXT}) \ > ${CARGO_VENDOR_DIR}/${_crate}/.cargo-checksum.json @if [ -r ${CARGO_VENDOR_DIR}/${_crate}/Cargo.toml.orig ]; then \ ${MV} ${CARGO_VENDOR_DIR}/${_crate}/Cargo.toml.orig \ ${CARGO_VENDOR_DIR}/${_crate}/Cargo.toml.orig-cargo; \ fi . endif . endfor . if ${CARGO_CONFIGURE:tl} == "yes" _USES_configure+= 250:cargo-configure # configure hook. Place a config file for overriding crates-io index # by local source directory. cargo-configure: # Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh . if defined(_CARGO_MSG) @${ECHO_MSG} ${_CARGO_MSG} . endif @${ECHO_MSG} "===> Cargo config:" @${MKDIR} ${WRKDIR}/.cargo @: > ${WRKDIR}/.cargo/config.toml @${ECHO_CMD} "[source.cargo]" >> ${WRKDIR}/.cargo/config.toml @${ECHO_CMD} "directory = '${CARGO_VENDOR_DIR}'" >> ${WRKDIR}/.cargo/config.toml @${ECHO_CMD} "[source.crates-io]" >> ${WRKDIR}/.cargo/config.toml @${ECHO_CMD} "replace-with = 'cargo'" >> ${WRKDIR}/.cargo/config.toml . if !empty(_CARGO_GIT_SOURCES) @${_CARGO_AWK} ${SCRIPTSDIR}/cargo-crates-git-configure.awk \ /dev/null >> ${WRKDIR}/.cargo/config.toml . endif @${CAT} ${WRKDIR}/.cargo/config.toml @if ! ${GREP} -qF '[profile.release]' ${CARGO_CARGOTOML}; then \ ${ECHO_CMD} "" >> ${CARGO_CARGOTOML}; \ ${ECHO_CMD} "[profile.release]" >> ${CARGO_CARGOTOML}; \ ${ECHO_CMD} "opt-level = 2" >> ${CARGO_CARGOTOML}; \ ${ECHO_CMD} "debug = false" >> ${CARGO_CARGOTOML}; \ fi @${ECHO_MSG} "===> Updating Cargo.lock" @${CARGO_CARGO_RUN} update \ --manifest-path ${CARGO_CARGOTOML} \ --verbose \ --verbose \ ${CARGO_UPDATE_ARGS} . endif . if !target(do-build) && ${CARGO_BUILD:tl} == "yes" do-build: @${CARGO_CARGO_RUN} build \ --manifest-path ${CARGO_CARGOTOML} \ --verbose \ --verbose \ ${CARGO_BUILD_ARGS} . endif . if !target(do-install) && ${CARGO_INSTALL:tl} == "yes" do-install: . for path in ${CARGO_INSTALL_PATH} @${CARGO_CARGO_RUN} install \ --no-track \ --path "${path}" \ --root "${STAGEDIR}${PREFIX}" \ --verbose \ --verbose \ ${CARGO_INSTALL_ARGS} . endfor . endif . if !target(do-test) && ${CARGO_TEST:tl} == "yes" do-test: @${CARGO_CARGO_RUN} test \ --manifest-path ${CARGO_CARGOTOML} \ --verbose \ --verbose \ ${CARGO_TEST_ARGS} . endif # # Helper targets for port maintainers # # cargo-audit generates a vulnerability report using # security/cargo-audit based on the crates in Cargo.lock. cargo-audit: configure @if ! type cargo-audit > /dev/null 2>&1; then \ ${ECHO_MSG} "===> Please install \"security/cargo-audit\""; exit 1; \ fi @${ECHO_MSG} "===> Checking for vulnerable crates" @${CARGO} audit --file ${CARGO_CARGOLOCK} # cargo-crates will output the crates list from Cargo.lock. If there # is no Cargo.lock for some reason, try and generate it first. cargo-crates: cargo-crates-generate-lockfile @${_CARGO_AWK} ${SCRIPTSDIR}/cargo-crates.awk ${CARGO_CARGOLOCK} # cargo-crates-generate-lockfile will try to generate a Cargo.lock file # if it does not exist. cargo-crates-generate-lockfile: extract @if [ ! -r "${CARGO_CARGOLOCK}" ]; then \ ${ECHO_MSG} "===> ${CARGO_CARGOLOCK} not found. Trying to generate it..."; \ cd ${WRKSRC}; ${_CARGO_RUN} generate-lockfile \ --manifest-path ${CARGO_CARGOTOML} \ --verbose; \ fi # cargo-crates-licenses will try to grab license information from # all downloaded crates. cargo-crates-licenses: configure @${FIND} ${CARGO_VENDOR_DIR} -name 'Cargo.toml' -maxdepth 2 \ -exec ${GREP} -H '^license' {} \; \ | ${SED} \ -e 's@^${CARGO_VENDOR_DIR}/@@' \ -e 's@/Cargo.toml:license.*= *"@|@' \ -e 's@"$$@@g' | sort | /usr/bin/column -t -s '|' # cargo-crates-merge will in-place update CARGO_CRATES in the port # based on the crates list from Cargo.lock. If there is no Cargo.lock # for some reason, try and generate it first. cargo-crates-merge: @if ! type portedit > /dev/null 2>&1; then \ ${ECHO_MSG} "===> Please install \"ports-mgmt/portfmt\""; exit 1; \ fi @${MAKE} clean cargo-crates-generate-lockfile @f="${MASTERDIR}/Makefile"; [ -r "${MASTERDIR}/Makefile.crates" ] && f="${MASTERDIR}/Makefile.crates"; \ ${_CARGO_AWK} ${SCRIPTSDIR}/cargo-crates.awk ${CARGO_CARGOLOCK} | \ portedit merge -i $$f; \ ${MAKE} clean makesum; \ ${ECHO_MSG} "${DISTINFO_FILE} and CARGO_CRATES in $$f were updated"; .endif diff --git a/lang/rust-bootstrap/Makefile b/lang/rust-bootstrap/Makefile index 09067e4ff257..d61b6e1b93f2 100644 --- a/lang/rust-bootstrap/Makefile +++ b/lang/rust-bootstrap/Makefile @@ -1,145 +1,145 @@ # Once the bootstraps are available on pkg.FreeBSD.org run sync.sh # to upload them to ~/public_distfiles on freefall in preparation # for the next lang/rust update. PORTNAME= rust -PORTVERSION= 1.72.0 +PORTVERSION= 1.73.0 CATEGORIES= lang MASTER_SITES= https://static.rust-lang.org/dist/ PKGNAMEPREFIX= ${FLAVOR:S/_/-/g}- PKGNAMESUFFIX= -bootstrap DISTNAME= ${PORTNAME}c-${PORTVERSION}-src DIST_SUBDIR= rust MAINTAINER= rust@FreeBSD.org COMMENT= Create bootstrap compilers for building lang/rust WWW= https://www.rust-lang.org/ LICENSE= APACHE20 MIT LICENSE_COMB= dual LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE-APACHE LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT ONLY_FOR_ARCHS= amd64 powerpc64 powerpc64le ONLY_FOR_ARCHS_REASON= untested on other architectures BUILD_DEPENDS= ${FLAVOR:S/_/-/g}-freebsd-sysroot>=a2021.09.14:devel/freebsd-sysroot@${FLAVOR} \ cmake:devel/cmake-core \ gmake:devel/gmake \ rust>=${PORTVERSION}:lang/rust FLAVORS= aarch64 amd64 armv7 i386 powerpc powerpc64 powerpc64le riscv64 FLAVOR?= ${FLAVORS:[1]} USES= cpe ninja:build perl5 python:build tar:xz CPE_VENDOR= ${PORTNAME}-lang # for openssl-src crate USE_PERL5= build PATCHDIR= ${.CURDIR}/../rust/files # rustc stashes intermediary files in TMPDIR (default /tmp) which # might cause issues for users that for some reason space limit # their /tmp. WRKDIR should have plenty of space. # ?= to allow users to still overwrite it in make.conf. TMPDIR?= ${WRKDIR} # Resulting packages are not specific to amd64 NO_ARCH= yes _CARGO_VENDOR_DIR= ${WRKSRC}/vendor _RUST_ARCH_amd64= x86_64 _RUST_ARCH_i386= i686 _RUST_ARCH_powerpc64= powerpc64 _RUST_ARCH_riscv64= riscv64gc _RUST_HOST= ${_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} _RUST_TARGET= ${_RUST_ARCH_${FLAVOR}:U${FLAVOR}}-unknown-${OPSYS:tl} _RUST_LLVM_TARGET= ${_RUST_LLVM_TARGET_${FLAVOR}} _RUST_LLVM_TARGET_aarch64= AArch64 _RUST_LLVM_TARGET_amd64= X86 _RUST_LLVM_TARGET_armv7= ARM _RUST_LLVM_TARGET_i386= X86 _RUST_LLVM_TARGET_powerpc64= PowerPC _RUST_LLVM_TARGET_powerpc64le= PowerPC _RUST_LLVM_TARGET_powerpc= PowerPC _RUST_LLVM_TARGET_riscv64= RISCV .include .if ${OPSYS} != FreeBSD IGNORE= is only for FreeBSD .endif .if (${FLAVOR} == powerpc64le || ${FLAVOR} == riscv64) && ${OSVERSION} < 1300116 IGNORE= will not build on 12.x due to old system .endif .if exists(${PATCHDIR}/${FLAVOR:S/_/-/}) EXTRA_PATCHES+= ${PATCHDIR}/${FLAVOR:S/_/-/} .endif post-patch: # Disable vendor checksums @${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \ ${_CARGO_VENDOR_DIR}/*/.cargo-checksum.json do-configure: # Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh @${ECHO_CMD} 'changelog-seen=2' > ${WRKSRC}/config.toml @${ECHO_CMD} '[build]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'build-dir="${WRKDIR}/_build"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'vendor=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'extended=false' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'python="${PYTHON_CMD}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'docs=false' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'verbose=2' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cargo-native-static=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cargo="${LOCALBASE}/bin/cargo"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'rustc="${LOCALBASE}/bin/rustc"' >> ${WRKSRC}/config.toml .if ${_RUST_HOST} != ${_RUST_TARGET} @${ECHO_CMD} 'host=["${_RUST_HOST}","${_RUST_TARGET}"]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'target=["${_RUST_TARGET}"]' >> ${WRKSRC}/config.toml .endif @${ECHO_CMD} '[rust]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'channel="stable"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'deny-warnings=false' >> ${WRKSRC}/config.toml @${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'link-shared=false' >> ${WRKSRC}/config.toml .if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE) @${ECHO_CMD} 'ccache="${CCACHE_BIN}"' >> ${WRKSRC}/config.toml .else @${ECHO_CMD} 'ccache=false' >> ${WRKSRC}/config.toml .endif # https://github.com/rust-lang/rust/pull/72696#issuecomment-641517185 @${ECHO_CMD} 'ldflags="-lz"' >> ${WRKSRC}/config.toml # we need to make sure to always build llvm with host arch support to get a # host compiler that can build the host->target compiler @${ECHO_CMD} 'targets="${_RUST_LLVM_TARGET};${_RUST_LLVM_TARGET_${ARCH}}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} '[target.${_RUST_TARGET}]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cc="${LOCALBASE}/freebsd-sysroot/${FLAVOR:S/_/-/g}/bin/cc"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cxx="${LOCALBASE}/freebsd-sysroot/${FLAVOR:S/_/-/g}/bin/c++"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'linker="${LOCALBASE}/freebsd-sysroot/${FLAVOR:S/_/-/g}/bin/cc"' >> ${WRKSRC}/config.toml .for _key _util in ar ${AR} ranlib ${RANLIB} @bin="$$(which ${_util})"; \ ${ECHO_CMD} "${_key}=\"$$bin\"" >> ${WRKSRC}/config.toml .endfor .if ${_RUST_HOST} != ${_RUST_TARGET} @${ECHO_CMD} '[target.${_RUST_HOST}]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cc="${CC}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cxx="${CXX}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'linker="${CC}"' >> ${WRKSRC}/config.toml .endif @${ECHO_CMD} '[dist]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml do-build: @cd ${WRKSRC} && \ ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} x.py dist --jobs=${MAKE_JOBS_NUMBER} \ cargo rustc rust-std do-install: @${MKDIR} ${STAGEDIR}${PREFIX}/rust-bootstrap/${FLAVOR} ${INSTALL_DATA} ${WRKDIR}/_build/dist/*-${_RUST_ARCH_${FLAVOR}:U${FLAVOR}}-unknown-${OPSYS:tl}${EXTRACT_SUFX} \ ${STAGEDIR}${PREFIX}/rust-bootstrap/${FLAVOR} @cd ${STAGEDIR}${PREFIX} && \ ${FIND} rust-bootstrap -type f >> ${TMPPLIST} .include diff --git a/lang/rust-bootstrap/distinfo b/lang/rust-bootstrap/distinfo index 5052412ce0de..8cae2863fbb6 100644 --- a/lang/rust-bootstrap/distinfo +++ b/lang/rust-bootstrap/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1692897293 -SHA256 (rust/rustc-1.72.0-src.tar.xz) = d307441f8ee78a7e94f72cb5c81383822f13027f79e67a5551bfd2c2d2db3014 -SIZE (rust/rustc-1.72.0-src.tar.xz) = 151630408 +TIMESTAMP = 1696426328 +SHA256 (rust/rustc-1.73.0-src.tar.xz) = 6eaf672dbea2e6596af8c999f5e6924b9af4bb8b02166bfe0b928e68aa75ae62 +SIZE (rust/rustc-1.73.0-src.tar.xz) = 154319536 diff --git a/lang/rust/Makefile b/lang/rust/Makefile index f17d0d8e8aa6..0ac1edc1be37 100644 --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -1,311 +1,304 @@ PORTNAME= rust -PORTVERSION?= 1.72.0 +PORTVERSION?= 1.73.0 PORTREVISION?= 0 CATEGORIES= lang MASTER_SITES= https://static.rust-lang.org/dist/:src \ https://dev-static.rust-lang.org/dist/:src \ LOCAL/rust:bootstrap \ https://static.rust-lang.org/dist/:bootstrap DISTNAME?= ${PORTNAME}c-${PORTVERSION}-src DISTFILES?= ${NIGHTLY_DATE:D${NIGHTLY_DATE}/}${DISTNAME}${EXTRACT_SUFX}:src \ ${_RUSTC_BOOTSTRAP}${EXTRACT_SUFX}:bootstrap \ ${_RUST_STD_BOOTSTRAP}${EXTRACT_SUFX}:bootstrap \ ${_CARGO_BOOTSTRAP}${EXTRACT_SUFX}:bootstrap DIST_SUBDIR?= rust MAINTAINER= rust@FreeBSD.org COMMENT= Language with a focus on memory safety and concurrency WWW= https://www.rust-lang.org/ LICENSE= APACHE20 MIT LICENSE_COMB= dual LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE-APACHE LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT IGNORE_FreeBSD_12_powerpc= is missing a bootstrap for FreeBSD 12.x powerpc ONLY_FOR_ARCHS?= aarch64 amd64 armv7 i386 powerpc64 powerpc64le powerpc \ riscv64 ONLY_FOR_ARCHS_REASON?= requires prebuilt bootstrap compiler BUILD_DEPENDS= cmake:devel/cmake-core LIB_DEPENDS= libcurl.so:ftp/curl USES= cpe ninja:build pkgconfig python:build ssl tar:xz CPE_VENDOR= rust-lang MAKE_ENV= DESTDIR=${STAGEDIR} \ LIBGIT2_NO_PKG_CONFIG=1 \ OPENSSL_DIR="${OPENSSLBASE}" TEST_ENV= ${MAKE_ENV} \ ALLOW_NONZERO_RLIMIT_CORE=1 CONFLICTS_INSTALL?= rust-nightly # rustc stashes intermediary files in TMPDIR (default /tmp) which # might cause issues for users that for some reason space limit # their /tmp. WRKDIR should have plenty of space. # ?= to allow users to still overwrite it in make.conf. TMPDIR?= ${WRKDIR} OPTIONS_DEFINE= DOCS GDB LTO PORT_LLVM SOURCES WASM OPTIONS_DEFAULT= SOURCES WASM GDB_DESC= Install ports gdb (necessary for debugging rust programs) PORT_LLVM_DESC= Build against devel/llvm instead of bundled copy (experimental) SOURCES_DESC= Install source files WASM_DESC= Build the WebAssembly target (wasm32-unknown-unknown) DOCS_VARS= _RUST_BUILD_DOCS=true \ _COMPONENTS+="rust-docs-${_PACKAGE_VERS}-${_RUST_TARGET} rust-docs-json-${_PACKAGE_VERS}-${_RUST_TARGET}" \ _RUST_TOOLS+=rustdoc DOCS_VARS_OFF= _RUST_BUILD_DOCS=false GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb -PORT_LLVM_USES= llvm:min=14,lib,noexport +PORT_LLVM_USES= llvm:min=15,lib,noexport PORT_LLVM_MAKE_ENV= RUSTFLAGS="-Lnative=${LOCALBASE}/lib" SOURCES_VARS= _COMPONENTS+=rust-src-${_PACKAGE_VERS} \ _RUST_TOOLS+=src WASM_VARS= _COMPONENTS+="rust-analysis-${_PACKAGE_VERS}-wasm32-unknown-unknown rust-std-${_PACKAGE_VERS}-wasm32-unknown-unknown" \ _RUST_TARGETS+=wasm32-unknown-unknown # See WRKSRC/src/stage0.json for the date and version values -BOOTSTRAPS_DATE?= 2023-07-13 -RUST_BOOTSTRAP_VERSION?= 1.71.0 +BOOTSTRAPS_DATE?= 2023-08-24 +RUST_BOOTSTRAP_VERSION?= 1.72.0 CARGO_VENDOR_DIR?= ${WRKSRC}/vendor # Rust's target arch string might be different from *BSD arch strings _RUST_ARCH_amd64= x86_64 _RUST_ARCH_i386= i686 _RUST_ARCH_riscv64= riscv64gc _RUST_TARGET= ${_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} _RUST_TARGETS= ${_RUST_TARGET} _RUST_TOOLS= analysis cargo clippy rust-analyzer rustdoc rustfmt _RUSTC_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rustc-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${_RUST_TARGET} _RUST_STD_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rust-std-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${_RUST_TARGET} _CARGO_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/cargo-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${_RUST_TARGET} _PACKAGE_VERS= ${NIGHTLY_DATE:?nightly:${PORTVERSION}} _COMPONENTS+= cargo-${_PACKAGE_VERS}-${_RUST_TARGET} \ clippy-${_PACKAGE_VERS}-${_RUST_TARGET} \ rustc-${_PACKAGE_VERS}-${_RUST_TARGET} \ rustfmt-${_PACKAGE_VERS}-${_RUST_TARGET} \ rust-analysis-${_PACKAGE_VERS}-${_RUST_TARGET} \ rust-std-${_PACKAGE_VERS}-${_RUST_TARGET} .include -.ifndef NIGHTLY_DATE -PATCH_SITES= https://github.com/rust-lang/rust/commit/ -# LLVM 17 API compatibility fixes -PATCHFILES= 71958da4854176c50a8b12470b956d5c7ed11817.patch:-p1 \ - 6ddf9128b2b55f9def80af57f7353d2521527c6a.patch:-p1 -.endif - .if ${OPSYS} != FreeBSD IGNORE= is only for FreeBSD .endif .if ${ARCH} == powerpc LIB_DEPENDS+= libatomic.so:lang/gcc${GCC_DEFAULT} MAKE_ENV+= RUSTFLAGS="-L/usr/local/lib/gcc${GCC_DEFAULT}" .else MAKE_ENV+= RUST_BACKTRACE=1 .endif # rls doesn't build on rust nightly # rls needs 64-bit atomics: it doesn't build on powerpc .if !defined(NIGHTLY_DATE) && ${ARCH} != powerpc _RUST_TOOLS+= rls _COMPONENTS+= rls-${_PACKAGE_VERS}-${_RUST_TARGET} .endif # per https://rust-lang.github.io/rustup/concepts/components.html # rustc-dev is only usefull on nightly .if defined(NIGHTLY_DATE) _COMPONENTS+= rustc-dev-${_PACKAGE_VERS}-${_RUST_TARGET} .endif .if ${PORT_OPTIONS:MWASM} && ${PORT_OPTIONS:MDOCS} _COMPONENTS+= rust-docs-${_PACKAGE_VERS}-wasm32-unknown-unknown rust-docs-json-${_PACKAGE_VERS}-wasm32-unknown-unknown .endif # If the kernel does not return sane kern.proc.pathname values # for hardlinks then disable hardlinks in the build to avoid # intermittent "can't find crate for `std`" build failures, # c.f. PR248184 # # XXX: Avoiding OSVERSION since it is derived from userland but # the running kernel might still be newer with sane behavior # anyway... .if exists(${PATCHDIR}/no-hardlinks) _KERN_OSRELDATE!= ${SYSCTL} -n kern.osreldate 2>/dev/null || echo 0 . if ${_KERN_OSRELDATE} < 1300521 EXTRA_PATCHES+= ${PATCHDIR}/no-hardlinks . endif .endif .ifdef QEMU_EMULATING IGNORE= fails to build with qemu-user-static .endif .if make(makesum) DISTFILES:= ${DISTFILES:M*\:src} \ ${ONLY_FOR_ARCHS:O:@_arch@${:!${MAKE} ARCH=${_arch} -V'DISTFILES:N*\:src'!}@} .endif post-patch: @${REINPLACE_CMD} 's,gdb,${LOCALBASE}/bin/gdb,' ${WRKSRC}/src/etc/rust-gdb .if defined(NIGHTLY_DATE) @${REINPLACE_CMD} 's/"rustfmt"/"nothx"/' ${WRKSRC}/src/stage0.json .endif # Disable vendor checksums @${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \ ${CARGO_VENDOR_DIR}/*/.cargo-checksum.json post-patch-PORT_LLVM-on: # WASM target hardcodes bundled lld @${REINPLACE_CMD} 's|"rust-lld"|"wasm-ld${LLVM_VERSION}"|' \ ${WRKSRC}/compiler/rustc_target/src/spec/wasm_base.rs do-configure: # Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh .for _component in cargo rust-std rustc @cd ${WRKDIR}/${_component}-*-${OPSYS:tl} && \ ${SH} install.sh --prefix=${WRKDIR}/bootstrap --verbose .endfor @${ECHO_CMD} 'changelog-seen=2' > ${WRKSRC}/config.toml @${ECHO_CMD} '[build]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'build-dir="${WRKDIR}/_build"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'build-stage=2' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'doc-stage=2' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'test-stage=2' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'vendor=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'extended=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'python="${PYTHON_CMD}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'docs=${_RUST_BUILD_DOCS}' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'verbose=2' >> ${WRKSRC}/config.toml .if defined(NIGHTLY_DATE) @${ECHO_CMD} 'profiler=true' >> ${WRKSRC}/config.toml .endif @${ECHO_CMD} 'target=[${_RUST_TARGETS:@.target.@"${.target.}"@:ts,}]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cargo="${WRKDIR}/bootstrap/bin/cargo"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'rustc="${WRKDIR}/bootstrap/bin/rustc"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'tools=[${_RUST_TOOLS:@.tool.@"${.tool.}"@:ts,}]' >> ${WRKSRC}/config.toml @${ECHO_CMD} '[install]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'prefix="${PREFIX}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'sysconfdir="${PREFIX}/etc"' >> ${WRKSRC}/config.toml @${ECHO_CMD} '[rust]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'channel="${PKGNAMESUFFIX:Ustable:S/^-//}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'deny-warnings=false' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'verbose-tests=true' >> ${WRKSRC}/config.toml .if ${PORT_OPTIONS:MWASM} && !${PORT_OPTIONS:MPORT_LLVM} @${ECHO_CMD} 'lld=true' >> ${WRKSRC}/config.toml .else @${ECHO_CMD} 'lld=false' >> ${WRKSRC}/config.toml .endif .if ${PORT_OPTIONS:MLTO} @${ECHO_CMD} 'lto="thin"' >> ${WRKSRC}/config.toml .endif @${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml .if ${PORT_OPTIONS:MLTO} @${ECHO_CMD} 'thin-lto=true' >> ${WRKSRC}/config.toml .endif .if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE) @${ECHO_CMD} 'ccache="${CCACHE_BIN}"' >> ${WRKSRC}/config.toml .else @${ECHO_CMD} 'ccache=false' >> ${WRKSRC}/config.toml .endif @${ECHO_CMD} 'ninja=true' >> ${WRKSRC}/config.toml .if ${ARCH} == powerpc # Rust doesn't call the system compiler with the full version of the target. # This makes powerpc miscompile due to the secure-plt ABI change. # Additionally, force using ld.bfd to work around a linking problem in rustc_mir @${PRINTF} '#!/bin/sh\nexec ${CC} "$$@" --target=powerpc-unknown-freebsd13.0' > ${WRKDIR}/cc-wrapper @${CHMOD} +x ${WRKDIR}/cc-wrapper @${PRINTF} '#!/bin/sh\nexec ${CXX} "$$@" --target=powerpc-unknown-freebsd13.0' > ${WRKDIR}/cxx-wrapper @${CHMOD} +x ${WRKDIR}/cxx-wrapper @${PRINTF} '#!/bin/sh\nexec ${CC} -fuse-ld=bfd "$$@" --target=powerpc-unknown-freebsd13.0' > ${WRKDIR}/ld-wrapper @${CHMOD} +x ${WRKDIR}/ld-wrapper .endif .for _target in ${_RUST_TARGETS} @${ECHO_CMD} '[target.${_target}]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'ar="${AR}"' >> ${WRKSRC}/config.toml .if ${ARCH} == powerpc @${ECHO_CMD} 'cc="${WRKDIR}/cc-wrapper"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cxx="${WRKDIR}/cxx-wrapper"' >> ${WRKSRC}/config.toml .else @${ECHO_CMD} 'cc="${CC}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cxx="${CXX}"' >> ${WRKSRC}/config.toml .endif .if ${ARCH} == powerpc @${ECHO_CMD} 'linker="${WRKDIR}/ld-wrapper"' >> ${WRKSRC}/config.toml .else @${ECHO_CMD} 'linker="${CC}"' >> ${WRKSRC}/config.toml .endif .if ${PORT_OPTIONS:MPORT_LLVM} @${ECHO_CMD} 'llvm-config="${LOCALBASE}/bin/${LLVM_CONFIG}"' >> ${WRKSRC}/config.toml .endif .endfor @${ECHO_CMD} '[dist]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml .if defined(NIGHTLY_DATE) # Don't abort if optional tools fail to build @${ECHO_CMD} 'missing-tools=true' >> ${WRKSRC}/config.toml .endif do-build: @cd ${WRKSRC} && \ ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} x.py dist --jobs=${MAKE_JOBS_NUMBER} do-install: ${RM} -r ${WRKDIR}/_extractdist .for _c in ${_COMPONENTS} ${MKDIR} ${WRKDIR}/_extractdist ${TAR} xf ${WRKDIR}/_build/dist/${_c}.tar.xz -C ${WRKDIR}/_extractdist cd ${WRKDIR}/_extractdist/${_c} && \ ${SH} install.sh \ --docdir="${STAGEDIR}${DOCSDIR}" \ --mandir="${STAGEDIR}${PREFIX}/share/man" \ --prefix="${STAGEDIR}${PREFIX}" ${RM} -r ${WRKDIR}/_extractdist .endfor # We autogenerate the plist file. We do that, instead of the # regular pkg-plist, because several libraries have a computed # filename based on the absolute path of the source files. As it # is user-specific, we cannot know their filename in advance. @${RM} ${STAGEDIR}${DOCSDIR}/*.old \ ${STAGEDIR}${PREFIX}/lib/rustlib/components \ ${STAGEDIR}${PREFIX}/lib/rustlib/install.log \ ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-* \ ${STAGEDIR}${PREFIX}/lib/rustlib/rust-installer-version \ ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh @${FIND} ${STAGEDIR}${PREFIX}/bin ${STAGEDIR}${PREFIX}/lib \ ${STAGEDIR}${PREFIX}/libexec -exec ${FILE} -i {} + | \ ${AWK} -F: '/executable|sharedlib/ { print $$1 }' | ${XARGS} ${STRIP_CMD} @${FIND} ${STAGEDIR}${PREFIX} -not -type d | \ ${SED} -E -e 's,^${STAGEDIR}${PREFIX}/,,' \ -e 's,(share/man/man[1-9]/.*\.[0-9]),\1.gz,' >> ${TMPPLIST} post-install-DOCS-on: # Ignore any left behind empty directories in case some docs fail # to build (failures are ignored due to deny-warnings=false). @${FIND} ${STAGEDIR}${DOCSDIR}/html -empty -type d | \ ${SED} 's,^${STAGEDIR},@comment @dir ,' >> ${TMPPLIST} post-install-SOURCES-on: # Silence stage-qa warnings by sanitizing permissions on sources @${FIND} ${STAGEDIR}${PREFIX}/lib/rustlib/src -type f -exec ${CHMOD} \ ${SHAREMODE} {} + # Note that make test does not work when rust is already installed. do-test: @cd ${WRKSRC} && \ ${SETENV} ${TEST_ENV} ${PYTHON_CMD} x.py test --jobs=${MAKE_JOBS_NUMBER} .include diff --git a/lang/rust/distinfo b/lang/rust/distinfo index 2beb9b476377..42e0f64c458d 100644 --- a/lang/rust/distinfo +++ b/lang/rust/distinfo @@ -1,55 +1,55 @@ -TIMESTAMP = 1692897225 -SHA256 (rust/rustc-1.72.0-src.tar.xz) = d307441f8ee78a7e94f72cb5c81383822f13027f79e67a5551bfd2c2d2db3014 -SIZE (rust/rustc-1.72.0-src.tar.xz) = 151630408 -SHA256 (rust/2023-07-13/rustc-1.71.0-aarch64-unknown-freebsd.tar.xz) = 67a63e4bf9f69f0a07a79e759e754d66afdc1a644c08dc699ffb17083e05199e -SIZE (rust/2023-07-13/rustc-1.71.0-aarch64-unknown-freebsd.tar.xz) = 54896968 -SHA256 (rust/2023-07-13/rust-std-1.71.0-aarch64-unknown-freebsd.tar.xz) = 644b1f08cddb684e19eae04f315c464c1ba1af11c09d59eb4449c1635a7a05f3 -SIZE (rust/2023-07-13/rust-std-1.71.0-aarch64-unknown-freebsd.tar.xz) = 25694436 -SHA256 (rust/2023-07-13/cargo-1.71.0-aarch64-unknown-freebsd.tar.xz) = 9ed2a3f06431a9e962ab29a3a4d4dc5b2e3703460845d9eec45da9f990618fbb -SIZE (rust/2023-07-13/cargo-1.71.0-aarch64-unknown-freebsd.tar.xz) = 7197836 -SHA256 (rust/2023-07-13/rustc-1.71.0-x86_64-unknown-freebsd.tar.xz) = 5d2b10d7b7db4117627aafe9e2bcc8002e714da44fa9dd3aedbc0e50ffe1dd80 -SIZE (rust/2023-07-13/rustc-1.71.0-x86_64-unknown-freebsd.tar.xz) = 45992472 -SHA256 (rust/2023-07-13/rust-std-1.71.0-x86_64-unknown-freebsd.tar.xz) = 38b75d357110e539af7b6b155903adb8f5800226423da5ada798f7e1f768bb40 -SIZE (rust/2023-07-13/rust-std-1.71.0-x86_64-unknown-freebsd.tar.xz) = 26217172 -SHA256 (rust/2023-07-13/cargo-1.71.0-x86_64-unknown-freebsd.tar.xz) = 1d881ed89e9b4eb686a11bdd2f1bebf907fc2da6061192c40ac579a5b26094c7 -SIZE (rust/2023-07-13/cargo-1.71.0-x86_64-unknown-freebsd.tar.xz) = 7973836 -SHA256 (rust/2023-07-13/rustc-1.71.0-armv7-unknown-freebsd.tar.xz) = f2b9db2d046da7494e7c2b0b613f9f469124b6e3711b4904b7207b8d9c39964c -SIZE (rust/2023-07-13/rustc-1.71.0-armv7-unknown-freebsd.tar.xz) = 53254816 -SHA256 (rust/2023-07-13/rust-std-1.71.0-armv7-unknown-freebsd.tar.xz) = a81c72e919a340bdc93e2009d8623fa47f01db342a170d0dd563a06bc00ccb30 -SIZE (rust/2023-07-13/rust-std-1.71.0-armv7-unknown-freebsd.tar.xz) = 25050696 -SHA256 (rust/2023-07-13/cargo-1.71.0-armv7-unknown-freebsd.tar.xz) = bb27f0be22140081b613802cd9f0c38682bc02c7716d41d9ccaa0d861cfc2d47 -SIZE (rust/2023-07-13/cargo-1.71.0-armv7-unknown-freebsd.tar.xz) = 7071008 -SHA256 (rust/2023-07-13/rustc-1.71.0-i686-unknown-freebsd.tar.xz) = 23f9a1fc89db35766dca997bd1f841dd058610f1761989105097710586407c57 -SIZE (rust/2023-07-13/rustc-1.71.0-i686-unknown-freebsd.tar.xz) = 61659320 -SHA256 (rust/2023-07-13/rust-std-1.71.0-i686-unknown-freebsd.tar.xz) = e6b35baff3bcc7dd7feb1447eeaef54fef4136c75af2e6f4b218ff52507b9d63 -SIZE (rust/2023-07-13/rust-std-1.71.0-i686-unknown-freebsd.tar.xz) = 26212032 -SHA256 (rust/2023-07-13/cargo-1.71.0-i686-unknown-freebsd.tar.xz) = eca40d3ec40bad1aec54851768e3a307db38d5989a7b2be80deb4a8dd2983bd2 -SIZE (rust/2023-07-13/cargo-1.71.0-i686-unknown-freebsd.tar.xz) = 8338280 -SHA256 (rust/2023-07-13/rustc-1.71.0-powerpc-unknown-freebsd.tar.xz) = d4bd4f7c38ede47def389ff8b8bf1f994fd15f9ae05824facb48bf8ada1d7ba2 -SIZE (rust/2023-07-13/rustc-1.71.0-powerpc-unknown-freebsd.tar.xz) = 60245728 -SHA256 (rust/2023-07-13/rust-std-1.71.0-powerpc-unknown-freebsd.tar.xz) = 48c3f746fdcedb1decefd5f9bd70343b0b8b7573ffd0b65ea77a67b0ce90ab60 -SIZE (rust/2023-07-13/rust-std-1.71.0-powerpc-unknown-freebsd.tar.xz) = 24179884 -SHA256 (rust/2023-07-13/cargo-1.71.0-powerpc-unknown-freebsd.tar.xz) = 30e1c54c7844094f6c463cc4a9be7455e207db598d12fb9203e47d6951b7de53 -SIZE (rust/2023-07-13/cargo-1.71.0-powerpc-unknown-freebsd.tar.xz) = 8248108 -SHA256 (rust/2023-07-13/rustc-1.71.0-powerpc64-unknown-freebsd.tar.xz) = e57a31a65f3ee3b3540c17ed20ea72895a9ea063a5cd7f621571947c75a982cd -SIZE (rust/2023-07-13/rustc-1.71.0-powerpc64-unknown-freebsd.tar.xz) = 58478560 -SHA256 (rust/2023-07-13/rust-std-1.71.0-powerpc64-unknown-freebsd.tar.xz) = 5ba721993d54d15e6fe87001641eaf30aab2fd099e03119656898809bb607db1 -SIZE (rust/2023-07-13/rust-std-1.71.0-powerpc64-unknown-freebsd.tar.xz) = 24186732 -SHA256 (rust/2023-07-13/cargo-1.71.0-powerpc64-unknown-freebsd.tar.xz) = c46c43a943f2ff631a53c4efb5882756ec0a164368135a54d0f719a65333d1a4 -SIZE (rust/2023-07-13/cargo-1.71.0-powerpc64-unknown-freebsd.tar.xz) = 7780232 -SHA256 (rust/2023-07-13/rustc-1.71.0-powerpc64le-unknown-freebsd.tar.xz) = aefb51616e8165e6dac99291520746a024b71d28c814a2570817473f1a6a20d2 -SIZE (rust/2023-07-13/rustc-1.71.0-powerpc64le-unknown-freebsd.tar.xz) = 60218776 -SHA256 (rust/2023-07-13/rust-std-1.71.0-powerpc64le-unknown-freebsd.tar.xz) = 2f80c9979e9a9dfe4f00fc62fae02656b5263e55c73b990e14b2140cdc620dc5 -SIZE (rust/2023-07-13/rust-std-1.71.0-powerpc64le-unknown-freebsd.tar.xz) = 24236100 -SHA256 (rust/2023-07-13/cargo-1.71.0-powerpc64le-unknown-freebsd.tar.xz) = 17d3145ab8f3d8d28562364f40f25db2fda9b526044e598095eea5cc28e56fec -SIZE (rust/2023-07-13/cargo-1.71.0-powerpc64le-unknown-freebsd.tar.xz) = 8014976 -SHA256 (rust/2023-07-13/rustc-1.71.0-riscv64gc-unknown-freebsd.tar.xz) = efb38a182166f01d4d31a6534afcbaff3c6a1f58bf90f8db5cfd8016ee4ac520 -SIZE (rust/2023-07-13/rustc-1.71.0-riscv64gc-unknown-freebsd.tar.xz) = 70827420 -SHA256 (rust/2023-07-13/rust-std-1.71.0-riscv64gc-unknown-freebsd.tar.xz) = 4ca3b70a9839e567b62fdc71bcbf35782262ec97c35c5a29a02309e8b76efd63 -SIZE (rust/2023-07-13/rust-std-1.71.0-riscv64gc-unknown-freebsd.tar.xz) = 24375500 -SHA256 (rust/2023-07-13/cargo-1.71.0-riscv64gc-unknown-freebsd.tar.xz) = b49977e17a42a9175cfa016941a6006f8e188f610f4ed59945f114fcb9f04820 -SIZE (rust/2023-07-13/cargo-1.71.0-riscv64gc-unknown-freebsd.tar.xz) = 10130160 +TIMESTAMP = 1697357059 +SHA256 (rust/rustc-1.73.0-src.tar.xz) = 6eaf672dbea2e6596af8c999f5e6924b9af4bb8b02166bfe0b928e68aa75ae62 +SIZE (rust/rustc-1.73.0-src.tar.xz) = 154319536 +SHA256 (rust/2023-08-24/rustc-1.72.0-aarch64-unknown-freebsd.tar.xz) = f87def3751c86536dc8c2a1ac493d2832bdfb791a31a4782d5f6d47ae384cd5b +SIZE (rust/2023-08-24/rustc-1.72.0-aarch64-unknown-freebsd.tar.xz) = 54855264 +SHA256 (rust/2023-08-24/rust-std-1.72.0-aarch64-unknown-freebsd.tar.xz) = 6712823eccc77234fe914992f26c37e72e050c85dc78d81f8bcfd5a6c0177779 +SIZE (rust/2023-08-24/rust-std-1.72.0-aarch64-unknown-freebsd.tar.xz) = 26185760 +SHA256 (rust/2023-08-24/cargo-1.72.0-aarch64-unknown-freebsd.tar.xz) = 957c3061c2d4c9bb03c74c059cdba16da5d8c1ba28ce671d762552e67fe02390 +SIZE (rust/2023-08-24/cargo-1.72.0-aarch64-unknown-freebsd.tar.xz) = 8065312 +SHA256 (rust/2023-08-24/rustc-1.72.0-x86_64-unknown-freebsd.tar.xz) = 7e913d82625e1fa9daaf89948d657944685be4bc3b5e136a312f9dc4230d72f2 +SIZE (rust/2023-08-24/rustc-1.72.0-x86_64-unknown-freebsd.tar.xz) = 46396244 +SHA256 (rust/2023-08-24/rust-std-1.72.0-x86_64-unknown-freebsd.tar.xz) = b4982586d84b8d419943083d28f3b3f3992eec99b13dbd7c0a5a8e63bfe3415f +SIZE (rust/2023-08-24/rust-std-1.72.0-x86_64-unknown-freebsd.tar.xz) = 26854796 +SHA256 (rust/2023-08-24/cargo-1.72.0-x86_64-unknown-freebsd.tar.xz) = 0fd521fb5bf0e3a58210eeb242a22f24f92a94b886905f4b895bc36782a7dd78 +SIZE (rust/2023-08-24/cargo-1.72.0-x86_64-unknown-freebsd.tar.xz) = 8866252 +SHA256 (rust/2023-08-24/rustc-1.72.0-armv7-unknown-freebsd.tar.xz) = cd8dfc34e5901dd2845835c7c7978f6a5725e15a3925eaba551b49e104355d4b +SIZE (rust/2023-08-24/rustc-1.72.0-armv7-unknown-freebsd.tar.xz) = 55045532 +SHA256 (rust/2023-08-24/rust-std-1.72.0-armv7-unknown-freebsd.tar.xz) = 519b61de0c56b11f5403a31f5198d93b2109ce7e9777df4899943c97c95c8ee0 +SIZE (rust/2023-08-24/rust-std-1.72.0-armv7-unknown-freebsd.tar.xz) = 25630140 +SHA256 (rust/2023-08-24/cargo-1.72.0-armv7-unknown-freebsd.tar.xz) = 90287dcb755268a67c5959c36d21270d04685ee55878d0314998272b32738dc1 +SIZE (rust/2023-08-24/cargo-1.72.0-armv7-unknown-freebsd.tar.xz) = 7944012 +SHA256 (rust/2023-08-24/rustc-1.72.0-i686-unknown-freebsd.tar.xz) = 103910d967b01ad2a27a886bfca8b64842be9a2b044074f58f56c6cccd2270fe +SIZE (rust/2023-08-24/rustc-1.72.0-i686-unknown-freebsd.tar.xz) = 61326204 +SHA256 (rust/2023-08-24/rust-std-1.72.0-i686-unknown-freebsd.tar.xz) = 1747a9d544c759b8fab05a172f90c5eabde9be4b370d564177487be56549ae52 +SIZE (rust/2023-08-24/rust-std-1.72.0-i686-unknown-freebsd.tar.xz) = 26697152 +SHA256 (rust/2023-08-24/cargo-1.72.0-i686-unknown-freebsd.tar.xz) = eaed4aef4ad1341ebf990fdd264fb639635bc4840221074534af74e443f45f51 +SIZE (rust/2023-08-24/cargo-1.72.0-i686-unknown-freebsd.tar.xz) = 9249016 +SHA256 (rust/2023-08-24/rustc-1.72.0-powerpc-unknown-freebsd.tar.xz) = 43f44d1fd8194921b391d5c46c30163e42742073015dcc713c34ff35a0067bb5 +SIZE (rust/2023-08-24/rustc-1.72.0-powerpc-unknown-freebsd.tar.xz) = 60208348 +SHA256 (rust/2023-08-24/rust-std-1.72.0-powerpc-unknown-freebsd.tar.xz) = de731b713a68c6db6e2bf05a02b8fdee0969cdb80dda756c41956d9a00a3194c +SIZE (rust/2023-08-24/rust-std-1.72.0-powerpc-unknown-freebsd.tar.xz) = 24553168 +SHA256 (rust/2023-08-24/cargo-1.72.0-powerpc-unknown-freebsd.tar.xz) = d266f36de042cad9dd310febad76cf8d11ac1f188e2ce751b95841d7724ae4c8 +SIZE (rust/2023-08-24/cargo-1.72.0-powerpc-unknown-freebsd.tar.xz) = 9247480 +SHA256 (rust/2023-08-24/rustc-1.72.0-powerpc64-unknown-freebsd.tar.xz) = 333d82f18d75b3fcf9ee7afc578bd0ee09a1a1c1f8f9308d0b1c4f9159ca4d2f +SIZE (rust/2023-08-24/rustc-1.72.0-powerpc64-unknown-freebsd.tar.xz) = 58536072 +SHA256 (rust/2023-08-24/rust-std-1.72.0-powerpc64-unknown-freebsd.tar.xz) = d371b600719dc4f500d6a453d64fc713fba0a188ad6c02c72fe25e2e413468a8 +SIZE (rust/2023-08-24/rust-std-1.72.0-powerpc64-unknown-freebsd.tar.xz) = 24770180 +SHA256 (rust/2023-08-24/cargo-1.72.0-powerpc64-unknown-freebsd.tar.xz) = ba4b5d2df913151e70b7d406c49163915b640f7ab6a4360ce0132e5cfa5ad891 +SIZE (rust/2023-08-24/cargo-1.72.0-powerpc64-unknown-freebsd.tar.xz) = 8793828 +SHA256 (rust/2023-08-24/rustc-1.72.0-powerpc64le-unknown-freebsd.tar.xz) = 44eb1bf540f146fb8fafa7585639b08592f0934e81cc95ae4bfdd7d8662da0ad +SIZE (rust/2023-08-24/rustc-1.72.0-powerpc64le-unknown-freebsd.tar.xz) = 60191980 +SHA256 (rust/2023-08-24/rust-std-1.72.0-powerpc64le-unknown-freebsd.tar.xz) = 656950dca59bf303e40263f92694242ec62d992f08a224c600765254e6a20acc +SIZE (rust/2023-08-24/rust-std-1.72.0-powerpc64le-unknown-freebsd.tar.xz) = 24904632 +SHA256 (rust/2023-08-24/cargo-1.72.0-powerpc64le-unknown-freebsd.tar.xz) = a2d11bb9a49f91e3da992fd4d8b141d7221c218a7b2e07af4d1bb486ba95253f +SIZE (rust/2023-08-24/cargo-1.72.0-powerpc64le-unknown-freebsd.tar.xz) = 9067788 +SHA256 (rust/2023-08-24/rustc-1.72.0-riscv64gc-unknown-freebsd.tar.xz) = a0b184b96203a4bd99c78ff61f228f843a6bfbdb6a7c690f1424e55a78c44e41 +SIZE (rust/2023-08-24/rustc-1.72.0-riscv64gc-unknown-freebsd.tar.xz) = 70320872 +SHA256 (rust/2023-08-24/rust-std-1.72.0-riscv64gc-unknown-freebsd.tar.xz) = 24904a553337220e8b50caaec5fe0309c3ef40c58b57102e2b9ee9131c3b981c +SIZE (rust/2023-08-24/rust-std-1.72.0-riscv64gc-unknown-freebsd.tar.xz) = 24923728 +SHA256 (rust/2023-08-24/cargo-1.72.0-riscv64gc-unknown-freebsd.tar.xz) = 52ef515ce550b58954cc71a19696e8bdeee24037273458d4115259725343bd40 +SIZE (rust/2023-08-24/cargo-1.72.0-riscv64gc-unknown-freebsd.tar.xz) = 11394328 SHA256 (rust/71958da4854176c50a8b12470b956d5c7ed11817.patch) = 5a6b67dfc1218ea953421816834ffe3aa8ac1fc078dfaea4ebab121460ca5211 SIZE (rust/71958da4854176c50a8b12470b956d5c7ed11817.patch) = 2007 SHA256 (rust/6ddf9128b2b55f9def80af57f7353d2521527c6a.patch) = 6eaaaf6714c496b610712aa9ecbe1a1614e042323ec872fbf31a0a74c9020f29 SIZE (rust/6ddf9128b2b55f9def80af57f7353d2521527c6a.patch) = 1278 diff --git a/lang/rust/files/patch-bug116845 b/lang/rust/files/patch-bug116845 new file mode 100644 index 000000000000..a8ed00dfa805 --- /dev/null +++ b/lang/rust/files/patch-bug116845 @@ -0,0 +1,34 @@ +From 491a91e8eea27fab4d8123cbfbb01bf1cf251b9c Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Thu, 12 Oct 2023 09:32:17 +0200 +Subject: [PATCH] [PowerPC] Use zext instead of anyext in custom and combine + (#68784) + +This custom combine currently converts `and(anyext(x),c)` into +`anyext(and(x,c))`. This is not correct, because the original expression +guaranteed that the high bits are zero, while the new one sets them to +undef. + +Emit `zext(and(x,c))` instead. + +Fixes https://github.com/llvm/llvm-project/issues/68783. + +(cherry picked from commit 127ed9ae266ead58aa525f74f4c86841f6674793) +--- + llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 2 +- + llvm/test/CodeGen/PowerPC/and-extend-combine.ll | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +index 3ed0a261eb769a1..d4d2da55160e552 100644 +--- src/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp ++++ src/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +@@ -15527,7 +15527,7 @@ SDValue PPCTargetLowering::PerformDAGCombine(SDNode *N, + break; + SDValue ConstOp = DAG.getConstant(Imm, dl, MVT::i32); + SDValue NarrowAnd = DAG.getNode(ISD::AND, dl, MVT::i32, NarrowOp, ConstOp); +- return DAG.getAnyExtOrTrunc(NarrowAnd, dl, N->getValueType(0)); ++ return DAG.getZExtOrTrunc(NarrowAnd, dl, N->getValueType(0)); + } + case ISD::SHL: + return combineSHL(N, DCI);