Skip to content

Commit

Permalink
lang/rust: Fix DOCS build, unbreak RUST_BACKTRACE
Browse files Browse the repository at this point in the history
- Fix DOCS build by disabling deny-warnings (rustc equivalent to
  -Werror).  Let's not fail the entire build just because a handful
  of docs fail to build due to -D broken-intra-doc-links [0]
- Only install the host target docs.  We otherwise waste time with
  a rust-docs install-uninstall-install cycle for each additional
  target during stage.
- Backport FreeBSD support for gimli, unbreak RUST_BACKTRACE, and
  have useful stack traces with actual content again [1]
- While here also strip binaries under libexec/ and ack reading of
  src/bootstrap/CHANGELOG.md (changelog-seen=2)

[0] rust-lang/rust#76526

PR:		253557 [1]
Submitted by:	jbeich [1]


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@569007 35697150-7ecd-e111-bb59-0022644237b5
  • Loading branch information
tobik committed Mar 23, 2021
1 parent d8e6623 commit 1fe1318
Show file tree
Hide file tree
Showing 4 changed files with 948 additions and 4 deletions.
1 change: 1 addition & 0 deletions lang/rust-bootstrap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

PORTNAME= rust
PORTVERSION= 1.50.0
PORTREVISION= 1
CATEGORIES= lang
MASTER_SITES= https://static.rust-lang.org/dist/:rust \
LOCAL/mikael:armbase \
Expand Down
16 changes: 12 additions & 4 deletions lang/rust/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

PORTNAME= rust
PORTVERSION?= 1.50.0
PORTREVISION?= 0
PORTREVISION?= 1
CATEGORIES= lang
MASTER_SITES= https://static.rust-lang.org/dist/:src \
https://dev-static.rust-lang.org/dist/:src \
Expand Down Expand Up @@ -46,7 +46,6 @@ CONFLICTS_INSTALL?= rust-nightly

OPTIONS_DEFINE= DOCS GDB SOURCES WASM
OPTIONS_DEFAULT= SOURCES WASM
OPTIONS_EXCLUDE= DOCS # https://github.com/rust-lang/rust/issues/76526
.if defined(NIGHTLY_DATE)
OPTIONS_EXCLUDE+= SOURCES
.endif
Expand Down Expand Up @@ -122,7 +121,8 @@ do-configure:
@cd ${WRKDIR}/${_component}-*-${OPSYS:tl} && \
${SH} install.sh --prefix=${WRKDIR}/bootstrap --verbose
.endfor
@${ECHO_CMD} '[build]' > ${WRKSRC}/config.toml
@${ECHO_CMD} 'changelog-seen=2' > ${WRKSRC}/config.toml
@${ECHO_CMD} '[build]' >> ${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
Expand All @@ -141,6 +141,7 @@ do-configure:
@${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
@${ECHO_CMD} 'lld=${_RUST_BUILD_WASM}' >> ${WRKSRC}/config.toml
@${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml
Expand Down Expand Up @@ -196,12 +197,19 @@ do-install:
${STAGEDIR}${PREFIX}/lib/rustlib/install.log \
${STAGEDIR}${PREFIX}/lib/rustlib/manifest-* \
${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh
@${FIND} ${STAGEDIR}${PREFIX}/bin ${STAGEDIR}${PREFIX}/lib -exec ${FILE} -i {} + | \
@${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} \
Expand Down
Loading

0 comments on commit 1fe1318

Please sign in to comment.