commit 3dedec9
hovercats
·
2026-06-08 21:09:43 +0000 UTC
parent 68b39be
go/go-bootstrap: drop
11 files changed,
+0,
-220
+0,
-35
1@@ -1,35 +0,0 @@
2-#!/bin/sh -e
3-
4-# Disable stripping of binaries.
5-# This breaks Go.
6-:> nostrip
7-
8-patch -p1 < 0001-use-POSIX-sh-and-remove-bashisms.patch
9-
10-export CC="${CC:-cc}"
11-export CFLAGS="$CFLAGS -std=c17"
12-export GOARCH=amd64
13-export GO_LDFLAGS="-w -s"
14-
15-mk() (
16- export GOROOT="$1"
17- export GOROOT_FINAL="$2"
18-
19- cd "$GOROOT"
20-
21- (
22- cd src
23- ./make.bash
24- )
25-
26- mkdir -p "$GOROOT_FINAL"
27- cp -pPR bin pkg src "$GOROOT_FINAL"
28-)
29-
30-mk "$PWD/go1.4-bootstrap" "$PWD/lib/go1.4-bootstrap"
31-
32-GOROOT_BOOTSTRAP="$PWD/lib/go1.4-bootstrap" \
33- mk "$PWD/go1.17.13" "$PWD/lib/go1.17.13"
34-
35-GOROOT_BOOTSTRAP="$PWD/lib/go1.17.13" \
36- mk "$PWD/go$2" "$1/usr/lib/go$2"
+0,
-4
1@@ -1,4 +0,0 @@
2-fb555f6674734d4f36e88594f29aede488ff75a36f659b4eee08217183905f1a12
3-fab34f540e4ad83908f3c897053cb0d5529452f81fce530cec916aa7b9c6948b69
4-e38b036986f4969980664342af2e0b14c503bf4222b980f2bfdcb32fd62fde146d
5-8d0ad35b60b098294705bf964aab84d469f34b6de5d2eaed04ff037fb25a2c0125
1@@ -1,90 +0,0 @@
2-From f5046858f3da701dad0647207d957e1301c0d7f8 Mon Sep 17 00:00:00 2001
3-From: hovercats <hovercatswithlasereyes@protonmail.com>
4-Date: Sun, 25 May 2025 06:52:08 +0200
5-Subject: [PATCH] use POSIX sh and remove some bashism
6-
7----
8- go1.17.13/src/make.bash | 4 ++--
9- go1.20.6/src/make.bash | 4 ++--
10- go1.4-bootstrap/src/make.bash | 10 +++++-----
11- 4 files changed, 26 insertions(+), 26 deletions(-)
12-
13-diff --git a/go1.17.13/src/make.bash b/go1.17.13/src/make.bash
14-index 7986125a..d1a77270 100755
15---- a/go1.17.13/src/make.bash
16-+++ b/go1.17.13/src/make.bash
17-@@ -1,4 +1,4 @@
18--#!/usr/bin/env bash
19-+#!/bin/sh
20- # Copyright 2009 The Go Authors. All rights reserved.
21- # Use of this source code is governed by a BSD-style
22- # license that can be found in the LICENSE file.
23-@@ -154,7 +154,7 @@ fi
24-
25- export GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
26- export GOROOT="$(cd .. && pwd)"
27--IFS=$'\n'; for go_exe in $(type -ap go); do
28-+for go_exe in $(command -v go); do
29- if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
30- goroot=$(GOROOT='' GOOS='' GOARCH='' "$go_exe" env GOROOT)
31- if [ "$goroot" != "$GOROOT" ]; then
32-diff --git a/go1.20.6/src/make.bash b/go1.20.6/src/make.bash
33-index c07f39bb..7aefc113 100755
34---- a/go1.20.6/src/make.bash
35-+++ b/go1.20.6/src/make.bash
36-@@ -1,4 +1,4 @@
37--#!/usr/bin/env bash
38-+#!/bin/sh
39- # Copyright 2009 The Go Authors. All rights reserved.
40- # Use of this source code is governed by a BSD-style
41- # license that can be found in the LICENSE file.
42-@@ -163,7 +163,7 @@ fi
43- export GOROOT_BOOTSTRAP
44-
45- export GOROOT="$(cd .. && pwd)"
46--IFS=$'\n'; for go_exe in $(type -ap go); do
47-+for go_exe in $(command -v go); do
48- if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
49- goroot=$(GOROOT='' GOOS='' GOARCH='' "$go_exe" env GOROOT)
50- if [ "$goroot" != "$GOROOT" ]; then
51-diff --git a/go1.4-bootstrap/src/make.bash b/go1.4-bootstrap/src/make.bash
52-index 104c3ba5..f05a635c 100755
53---- a/go1.4-bootstrap/src/make.bash
54-+++ b/go1.4-bootstrap/src/make.bash
55-@@ -1,4 +1,4 @@
56--#!/usr/bin/env bash
57-+#!/bin/sh
58- # Copyright 2009 The Go Authors. All rights reserved.
59- # Use of this source code is governed by a BSD-style
60- # license that can be found in the LICENSE file.
61-@@ -102,7 +102,7 @@ done
62- # Test for debian/kFreeBSD.
63- # cmd/dist will detect kFreeBSD as freebsd/$GOARCH, but we need to
64- # disable cgo manually.
65--if [ "$(uname -s)" == "GNU/kFreeBSD" ]; then
66-+if [ "$(uname -s)" = "GNU/kFreeBSD" ]; then
67- export CGO_ENABLED=0
68- fi
69-
70-@@ -122,15 +122,15 @@ case "$GOHOSTARCH" in
71- 386) mflag=-m32;;
72- amd64) mflag=-m64;;
73- esac
74--if [ "$(uname)" == "Darwin" ]; then
75-+if [ "$(uname)" = "Darwin" ]; then
76- # golang.org/issue/5261
77- mflag="$mflag -mmacosx-version-min=10.6"
78- fi
79- # if gcc does not exist and $CC is not set, try clang if available.
80--if [ -z "$CC" -a -z "$(type -t gcc)" -a -n "$(type -t clang)" ]; then
81-+if [ -z "$CC" -a -z "$(command -v gcc)" -a -n "$(command -v clang)" ]; then
82- export CC=clang CXX=clang++
83- fi
84--${CC:-gcc} $mflag -O2 -Wall -Werror -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
85-+${CC:-gcc} $mflag -std=gnu17 -O2 -Wall -Werror -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
86-
87- # -e doesn't propagate out of eval, so check success by hand.
88- eval $(./cmd/dist/dist env -p || echo FAIL=true)
89---
90-2.49.0
91-
+0,
-4
1@@ -1,4 +0,0 @@
2-https://golang.org/dl/go1.20.6.src.tar.gz go1.20.6
3-https://golang.org/dl/go1.17.13.src.tar.gz go1.17.13
4-https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz go1.4-bootstrap
5-patches/0001-use-POSIX-sh-and-remove-bashisms.patch
+0,
-1
1@@ -1 +0,0 @@
2-1.20.6 1
+0,
-49
1@@ -1,49 +0,0 @@
2-#!/bin/sh -e
3-
4-# Disable stripping of binaries.
5-# This breaks Go.
6-:> nostrip
7-
8-patch -p1 < 0001-src-make.bash-use-POSIX-sh-and-remove-some-bashism.patch
9-
10-export CC="${CC:-cc}"
11-export GOARCH=amd64
12-export GO_LDFLAGS="-w -s"
13-
14-export GOROOT_BOOTSTRAP="/usr/lib/go1.20.6"
15-export GOROOT="$PWD"
16-export GOROOT_FINAL="/usr/lib/go"
17-
18-(
19- cd src
20- ./make.bash -v
21-)
22-
23-cd "$GOROOT"
24-
25-mkdir -p "$1/usr/bin" "$1/usr/lib/go"
26-
27-ln -s ../lib/go/bin/go "$1/usr/bin"
28-ln -s ../lib/go/bin/gofmt "$1/usr/bin"
29-
30-cp -pPR misc bin pkg src lib go.env "$1/usr/lib/go"
31-
32-# Remove unneeded files.
33-rm -f "$1/usr/share/go/doc/articles/wiki/get.bin"
34-rm -f "$1/usr/lib/go/pkg/tool/"*/api
35-rm -rf "$1/usr/lib/go/pkg/bootstrap"
36-rm -rf "$1/usr/lib/go/pkg/obj"
37-
38-# Remove tests.
39-for path in "$1/usr/lib/go/src" "$1/usr/lib/go/misc/cgo"
40-do
41- find "$path" -type f -a -name \*_test.go -depth -exec rm {} +
42- find "$path" -type f -a -name \*.bash -depth -exec rm {} +
43- find "$path" -type f -a -name \*.bat -depth -exec rm {} +
44- find "$path" -type f -a -name \*.rc -depth -exec rm {} +
45-done
46-
47-find . -type d -a -name testdata |
48- while read -r dir; do
49- rm -rf "$dir"
50- done
+0,
-2
1@@ -1,2 +0,0 @@
2-8bfbcfc1a552e949d5562514c2eed8ca65029c3745d92d204d55db87147dc172a9
3-f962ff680628c0791fce6f1df1cb1e43c09cdbeea741e668df6053215edd68d70a
+0,
-1
1@@ -1 +0,0 @@
2-go-bootstrap make
1@@ -1,31 +0,0 @@
2-From 438f1fcaef381fe3950ee7b6bfddc1233d487f73 Mon Sep 17 00:00:00 2001
3-From: hovercats <hovercatswithlasereyes@protonmail.com>
4-Date: Thu, 29 Aug 2024 06:44:15 +0200
5-Subject: [PATCH] src/make.bash: use POSIX sh and remove some bashism
6-
7----
8- src/make.bash | 4 ++--
9- 1 file changed, 2 insertions(+), 2 deletions(-)
10-
11-diff --git a/src/make.bash b/src/make.bash
12-index 814b7e8..b5344b1 100755
13---- a/src/make.bash
14-+++ b/src/make.bash
15-@@ -1,4 +1,4 @@
16--#!/usr/bin/env bash
17-+#!/bin/sh
18- # Copyright 2009 The Go Authors. All rights reserved.
19- # Use of this source code is governed by a BSD-style
20- # license that can be found in the LICENSE file.
21-@@ -164,7 +164,7 @@ bootstrapenv() {
22- }
23-
24- export GOROOT="$(cd .. && pwd)"
25--IFS=$'\n'; for go_exe in $(type -ap go); do
26-+for go_exe in $(command -v go); do
27- if [[ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]]; then
28- goroot_bootstrap=$GOROOT_BOOTSTRAP
29- GOROOT_BOOTSTRAP=""
30---
31-2.45.1
32-
+0,
-2
1@@ -1,2 +0,0 @@
2-https://golang.org/dl/go1.23.0.src.tar.gz
3-patches/0001-src-make.bash-use-POSIX-sh-and-remove-some-bashism.patch
+0,
-1
1@@ -1 +0,0 @@
2-1.23.0 1