From nobody Mon Oct 09 15:30:55 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S43001t9mz4wqSy; Mon, 9 Oct 2023 15:30:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S43000Z8Gz3QkK; Mon, 9 Oct 2023 15:30:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696865456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WjRaXGXmBXhNywmDWNLXE5of0GqHJN3AutRV7TCon5E=; b=d29/ltGbvLICjLNgwiGZTJGGVWL0p/3QsDn/JBSzCY4N/ZOq/PGOOX0F377VbX5QPMxMvS ANTBxhSoCRJRWhRBi0rio+iFhcaBmsaTTbTLCZVDsHFGCoSnCb1NVMXfJhOF0PUcmSooB+ ChEZE5pYYJoJyZuCltg2T96csLg6WqiNiMEd/UyeBmUo0rO6B8PYfRzuciNmPwj+SbbLGI spNP+J08fP98XEfrXjPLP0iPj14+fwBVGShOo6vcKdNBeJfHxJ+H4Anu4HfeMrIlctASmT BEbH0pf+YZmTyi/Twldhq7n2xHeBS+CiBQ31C6spwxTohc+DdiOH1eyF20kkag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696865456; a=rsa-sha256; cv=none; b=YqdIO3DCM/eMMMxRXOMyDPxDs9o7jzB8pzqBfJbL51eo0ic6e1LhXxr1+deMm19yAu6rWb BpmpK35QfjdoI/kx3gdycku8o5HnOx54xDHdxfAnMq+nO9idLEZmoy5AbNegq6mJCxJnOl skwQfdw1j370TazRUzxqLdjbBvqe7OW95AWK3r2y11CDrPnZoRrAdE8U9NSJ+/yoqRQbaG JVyPvv1YjRrv3QiUmfni/3ETKhmpagjEA15Tsio2f56x5CSR4ZBrb/As2nWfJnnTi6fLx9 LeC/As444dn1lQqf7q7BY9aEDTHRPBAZN8U7sZ95+0FfbC6JDhLphffJ/q9qig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696865456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WjRaXGXmBXhNywmDWNLXE5of0GqHJN3AutRV7TCon5E=; b=SzUvP7Pz3NBPkrztla5C4SygKtf1Itt25Lw9uEDQCjBU7CIuFSKq8sKZsxf8y+HIZ1fbZ1 n1QtcPLmzJ8R9vIoVrITLbQRQzqDTo+O8VcGxP/aSaIl/TzVmerH56v+YfwpsCpatvmvGw KkOOkQkGz2K4/PCdDdrC3RifOqYBmyI0WDyYymI2sTDd0cDhQHas19XytjZEOT/eGIp+8F Nf7bGLbPtTOUssbehoCebWj71J5kUUTSahWeS60WlcBDKjM/q2hM1Ypz9oEg4i1j0lK7+U H0f/Jkc5S8XLiw/+RDzHM/Mm2ECGx6sF7kNvlEEPXTEmNExC50ssTSqiJtcNTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S42zz6m6jz11W3; Mon, 9 Oct 2023 15:30:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 399FUtrb000590; Mon, 9 Oct 2023 15:30:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 399FUtvL000587; Mon, 9 Oct 2023 15:30:55 GMT (envelope-from git) Date: Mon, 9 Oct 2023 15:30:55 GMT Message-Id: <202310091530.399FUtvL000587@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Charlie Li Subject: git: 098de5bc2195 - main - lang/rust: resurrect PORT_LLVM as a non-default OPTION List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vishwin X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 098de5bc2195a064523eb32e7db6071b2f8ed93a Auto-Submitted: auto-generated The branch main has been updated by vishwin: URL: https://cgit.FreeBSD.org/ports/commit/?id=098de5bc2195a064523eb32e7db6071b2f8ed93a commit 098de5bc2195a064523eb32e7db6071b2f8ed93a Author: Charlie Li AuthorDate: 2023-09-25 19:56:30 +0000 Commit: Charlie Li CommitDate: 2023-10-09 15:30:33 +0000 lang/rust: resurrect PORT_LLVM as a non-default OPTION Rust uses LLVM for code generation [0] and bundles their own copy of a release that they fully support in relation to the rest of rustc. This however adds to an already intensive build process. For the benefit of those building from source, resurrect the PORT_LLVM option, allowing to link with an existing devel/llvm port of the user's choosing within Rust compatibility ranges. This remains unset by default. PORT_LLVM was removed during an era when Rust tracked LLVM trunk, during the LLVM 7.0 development cycle. Starting with LLVM 8.0, Rust tracks LLVM releases with upstream cherry-picks, similar to our base system LLVM process. [1] Additionally, instead of making changes directly in their bundled LLVM, llvm-wrapper takes care of anything needed in that area. [2] Issues stemming from this option have since been resolved or overcome. [0] https://rustc-dev-guide.rust-lang.org/backend/codegen.html [1] https://rustc-dev-guide.rust-lang.org/backend/updating-llvm.html [2] https://github.com/rust-lang/rust/tree/master/compiler/rustc_llvm/llvm-wrapper Co-authored-by: Evgeniy Khramtsov <2khramtsov_gmail.com> Approved by: tobik (rust) Differential Revision: https://reviews.freebsd.org/D32654 --- lang/rust/Makefile | 28 ++++++++++++++++++++++++---- lang/rust/distinfo | 4 ++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/lang/rust/Makefile b/lang/rust/Makefile index 9c2cb3a7b5d4..414c065264dc 100644 --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -48,10 +48,11 @@ CONFLICTS_INSTALL?= rust-nightly # ?= to allow users to still overwrite it in make.conf. TMPDIR?= ${WRKDIR} -OPTIONS_DEFINE= DOCS GDB LTO SOURCES WASM +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) @@ -60,12 +61,12 @@ DOCS_VARS= _RUST_BUILD_DOCS=true \ _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_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_BUILD_WASM=true \ _RUST_TARGETS+=wasm32-unknown-unknown -WASM_VARS_OFF= _RUST_BUILD_WASM=false # See WRKSRC/src/stage0.json for the date and version values BOOTSTRAPS_DATE?= 2023-07-13 @@ -95,6 +96,13 @@ _COMPONENTS+= cargo-${_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 @@ -156,6 +164,11 @@ post-patch: @${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_DEFAULT}"|' \ + ${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}" \ @@ -190,7 +203,11 @@ do-configure: @${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'deny-warnings=false' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'verbose-tests=true' >> ${WRKSRC}/config.toml - @${ECHO_CMD} 'lld=${_RUST_BUILD_WASM}' >> ${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 @@ -230,6 +247,9 @@ do-configure: .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 diff --git a/lang/rust/distinfo b/lang/rust/distinfo index 8ae91f752136..2beb9b476377 100644 --- a/lang/rust/distinfo +++ b/lang/rust/distinfo @@ -49,3 +49,7 @@ SHA256 (rust/2023-07-13/rust-std-1.71.0-riscv64gc-unknown-freebsd.tar.xz) = 4ca3 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 +SHA256 (rust/71958da4854176c50a8b12470b956d5c7ed11817.patch) = 5a6b67dfc1218ea953421816834ffe3aa8ac1fc078dfaea4ebab121460ca5211 +SIZE (rust/71958da4854176c50a8b12470b956d5c7ed11817.patch) = 2007 +SHA256 (rust/6ddf9128b2b55f9def80af57f7353d2521527c6a.patch) = 6eaaaf6714c496b610712aa9ecbe1a1614e042323ec872fbf31a0a74c9020f29 +SIZE (rust/6ddf9128b2b55f9def80af57f7353d2521527c6a.patch) = 1278