Bug 239154

Summary: lang/go14: fix shebangs after update to go1.4-bootstrap-20171003
Product: Ports & Packages Reporter: John Hein <jcfyecrayz>
Component: Individual Port(s)Assignee: Julien Laffaye <jlaffaye>
Status: Closed Overcome By Events    
Severity: Affects Some People CC: dmgk, jlaffaye
Priority: --- Flags: bugzilla: maintainer-feedback? (jlaffaye)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
[patch] fix g014 shebangs for bash scripts
jcfyecrayz: maintainer-approval? (jlaffaye)
patch file
dmgk: maintainer-approval? (jlaffaye)
[patch] run bash script with bash rather than /bin/sh jcfyecrayz: maintainer-approval? (jlaffaye)

Description John Hein 2019-07-12 04:14:14 UTC
Created attachment 205710 [details]
[patch] fix g014 shebangs for bash scripts

'make -C /usr/ports/lang/go14 stage-qa' gives this error:

Error: '/bin/bash' is an invalid shebang you need USES=shebangfix for 'go14/misc/makerelease/darwin/scripts/postinstall'
Error: '/bin/bash' is an invalid shebang you need USES=shebangfix for 'go14/misc/makerelease/darwin/scripts/preinstall'


The attached patch fixes it.  One could also develop a patch to skip installing the files as I believe they probably aren't needed for the freebsd port.  But this patch seemed easy and the files involved are tiny, so removing them from the package doesn't save (much) space.
Comment 1 Dmitri Goutnik freebsd_committer freebsd_triage 2019-07-16 15:09:02 UTC
Created attachment 205820 [details]
patch file

An extended version of the patch that

- Fixes QA errors
- Trims stuff not needed for building/testing or lang/go bootstrapping 
- Fixes test target

Passes poudriere testport on 120a, 120i, 112a
Comment 2 commit-hook freebsd_committer freebsd_triage 2019-07-19 09:21:31 UTC
A commit references this bug:

Author: jlaffaye
Date: Fri Jul 19 09:20:50 UTC 2019
New revision: 506918
URL: https://svnweb.freebsd.org/changeset/ports/506918

Log:
  lang/go14: fixes QA errors and remove unneeded files

  PR:		239154
  Submitted by:	Dmitri Goutnik <dg@syrec.org>

Changes:
  head/lang/go14/Makefile
  head/lang/go14/pkg-plist
Comment 3 John Hein 2019-07-19 13:22:51 UTC
That's better if none of those files (that are now no longer installed) are needed.  Thanks, Dmitri.

One nitpick left that I noticed...

src/runtime/mknacl.sh still has /bin/bash.  stage-qa doesn't find it because there are no execute permissions on the installed file.  But it should be fixed or not installed if not needed.
Comment 4 John Hein 2019-07-22 13:42:21 UTC
Re-opening.

After the commit, there were still errors due to running make.bash with /bin/sh ('type -t' is a bashism).  It's not serious, but it should be fixed.  The patch (attached next) also fixes the issue from comment 3.
Comment 5 John Hein 2019-07-22 13:47:49 UTC
Created attachment 205992 [details]
[patch] run bash script with bash rather than /bin/sh

make.bash has some bash-isms, so use bash rather than /bin/sh.
Fix bad shebang for mknacl.sh
Comment 6 John Hein 2019-07-22 13:52:54 UTC
(In reply to John Hein from comment #4)
By the way, the errors due to using type -t you see during the build are:

-t: not found
-t: not found
Comment 7 Dmitri Goutnik freebsd_committer freebsd_triage 2019-09-23 15:07:25 UTC
(In reply to John Hein from comment #6)
Hi John,

I would be hesitant to add bash to BUILD_DEPENDS, given that sh is already able to run make.bash (despite some warnings). Perhaps it would make sense to patch make.bash instead and replace `$(type -t foo)` with `$(type foo 2>/dev/null)` which seems to be a good enough approximation.
Comment 8 Dmitri Goutnik freebsd_committer freebsd_triage 2020-03-17 12:29:09 UTC
lang/go was switched to the new bootstrap and lang/go14 was removed by r528577.