Bug 243850 - lang/rust: fix some stage-qa problems
Summary: lang/rust: fix some stage-qa problems
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: FreeBSD Rust Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-03 17:01 UTC by John Hein
Modified: 2020-02-07 02:24 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (rust)


Attachments
[patch] fix some stage-qa findings (1.04 KB, patch)
2020-02-03 17:01 UTC, John Hein
no flags Details | Diff
[patch] fix some stage-qa findings (v2) (742 bytes, patch)
2020-02-05 16:39 UTC, John Hein
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2020-02-03 17:01:32 UTC
Created attachment 211323 [details]
[patch] fix some stage-qa findings

as of the latest rust update, ports r524658 ...

====> Running Q/A tests (stage-qa)
Error: '/usr/bin/env python' is an invalid shebang you need USES=shebangfix for 'lib/rustlib/src/rust/src/libcore/unicode/unicode.py'
Error: '/usr/bin/env python' is an invalid shebang you need USES=shebangfix for 'lib/rustlib/src/rust/src/libcore/unicode/printable.py'
Warning: Possible REINPLACE_CMD issues
sed failed: file content unchanged from backup: src/librustc_llvm/build.rs
sed failed: file content unchanged from backup: src/bootstrap/native.rs
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/rust



These are the options settings:

% make showconfig
===> The following configuration options are available for rust-1.41.0:
     DOCS=on: Build and/or install documentation
     GDB=on: Install ports gdb (necessary for debugging rust programs)
     SOURCES=on: Install source files
===> Use 'make config' to modify these settings



The attached patch adds knobs to do fix-shebang for the .py files and removes the [now] unnecessary sed(1) from post-patch.
Comment 1 Mikael Urankar freebsd_committer freebsd_triage 2020-02-04 14:18:53 UTC
The reinplace_cmd is needed for ppc64 elfv1, see lang/rust/files/powerpc64-elfv1/*
Comment 2 John Hein 2020-02-05 16:39:03 UTC
Created attachment 211380 [details]
[patch] fix some stage-qa findings (v2)

(In reply to Mikael Urankar from comment #1)
Ah.  I didn't look for %CC% more than 1 level deep in files/.

Updated patch.
Comment 3 Mikael Urankar freebsd_committer freebsd_triage 2020-02-06 19:44:24 UTC
(In reply to John Hein from comment #2)
No need to use +=
It seems there is a leading whitespace for SHEBANG_FILES.
You can list the files without using quotes, you also need a tab between = and the file name.
Can you reformat the patch?
Comment 4 commit-hook freebsd_committer freebsd_triage 2020-02-06 20:52:14 UTC
A commit references this bug:

Author: tobik
Date: Thu Feb  6 20:51:20 UTC 2020
New revision: 525449
URL: https://svnweb.freebsd.org/changeset/ports/525449

Log:
  lang/rust: Silence stage-qa warnings when building with SOURCES=on

  PR:		243850

Changes:
  head/lang/rust/Makefile
Comment 5 John Hein 2020-02-07 02:23:45 UTC
(In reply to Mikael Urankar from comment #3)
The weird formatting is because the patch was missing a line wiith SOURCES_VARS - see patch below:

========================================
--- Makefile    (revision 525454)
+++ Makefile    (working copy)
@@ -74,6 +74,13 @@
 _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-${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}}-${_RUST_TARGET}
 
+SOURCES_USES=          shebangfix
+SOURCES_VARS=  \
+       SHEBANG_FILES+="\
+               src/libcore/unicode/printable.py \
+               src/libcore/unicode/unicode.py \
+               "
+
 .include <bsd.port.pre.mk>
 
 .if exists(${PATCHDIR}/libgit2)
========================================

But tobik's commit fixes it by chmod'ing every src/ file with 444 permissions.  Since qa.sh's shebang check only cares about files w/exec bits, his change solves the shebang check errors - just in a different way (leaves the "bad" shebang, but it doesn't matter since the files are not executable).

I'll close this.