Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
2166c860
Unverified
Commit
2166c860
authored
Feb 20, 2023
by
Péter Szilágyi
Committed by
GitHub
Feb 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: ship bootstrapper Go along with builder for PPA (#26731)
parent
1db978ca
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
8 deletions
+45
-8
checksums.txt
build/checksums.txt
+3
-0
ci.go
build/ci.go
+37
-8
deb.rules
build/deb/ethereum/deb.rules
+5
-0
No files found.
build/checksums.txt
View file @
2166c860
...
@@ -41,3 +41,6 @@ c4f58b7e227b9fd41f0e9310dc83f4a4e7d026598e2f6e95b78761081a6d9bd2 golangci-lint-
...
@@ -41,3 +41,6 @@ c4f58b7e227b9fd41f0e9310dc83f4a4e7d026598e2f6e95b78761081a6d9bd2 golangci-lint-
eb57f9bcb56646f2e3d6ccaf02ec227815fb05077b2e0b1bf9e755805acdc2b9 golangci-lint-1.51.1-windows-arm64.zip
eb57f9bcb56646f2e3d6ccaf02ec227815fb05077b2e0b1bf9e755805acdc2b9 golangci-lint-1.51.1-windows-arm64.zip
bce02f7232723cb727755ee11f168a700a00896a25d37f87c4b173bce55596b4 golangci-lint-1.51.1-windows-armv6.zip
bce02f7232723cb727755ee11f168a700a00896a25d37f87c4b173bce55596b4 golangci-lint-1.51.1-windows-armv6.zip
cf6403f84707ce8c98664736772271bc8874f2e760c2fd0f00cf3e85963507e9 golangci-lint-1.51.1-windows-armv7.zip
cf6403f84707ce8c98664736772271bc8874f2e760c2fd0f00cf3e85963507e9 golangci-lint-1.51.1-windows-armv7.zip
# This is the builder on PPA that will build Go itself (inception-y), don't modify!
9419cc70dc5a2523f29a77053cafff658ed21ef3561d9b6b020280ebceab28b9 go1.19.src.tar.gz
build/ci.go
View file @
2166c860
...
@@ -136,10 +136,18 @@ var (
...
@@ -136,10 +136,18 @@ var (
"golang-go"
:
"/usr/lib/go"
,
"golang-go"
:
"/usr/lib/go"
,
}
}
// This is the version of
g
o that will be downloaded by
// This is the version of
G
o that will be downloaded by
//
//
// go run ci.go install -dlgo
// go run ci.go install -dlgo
dlgoVersion
=
"1.20.1"
dlgoVersion
=
"1.20.1"
// This is the version of Go that will be used to bootstrap the PPA builder.
//
// This version is fine to be old and full of security holes, we just use it
// to build the latest Go. Don't change it. If it ever becomes infufficient,
// we need to switch over to a recursive builder to jumpt across supported
// versions.
gobootVersion
=
"1.19"
)
)
var
GOBIN
,
_
=
filepath
.
Abs
(
filepath
.
Join
(
"build"
,
"bin"
))
var
GOBIN
,
_
=
filepath
.
Abs
(
filepath
.
Join
(
"build"
,
"bin"
))
...
@@ -655,10 +663,11 @@ func doDebianSource(cmdline []string) {
...
@@ -655,10 +663,11 @@ func doDebianSource(cmdline []string) {
gpg
.
Stdin
=
bytes
.
NewReader
(
key
)
gpg
.
Stdin
=
bytes
.
NewReader
(
key
)
build
.
MustRun
(
gpg
)
build
.
MustRun
(
gpg
)
}
}
// Download and verify the Go source packages.
// Download and verify the Go source package.
var
(
gobundle
:=
downloadGoSources
(
*
cachedir
)
gobootbundle
=
downloadGoBootstrapSources
(
*
cachedir
)
gobundle
=
downloadGoSources
(
*
cachedir
)
)
// Download all the dependencies needed to build the sources and run the ci script
// Download all the dependencies needed to build the sources and run the ci script
srcdepfetch
:=
tc
.
Go
(
"mod"
,
"download"
)
srcdepfetch
:=
tc
.
Go
(
"mod"
,
"download"
)
srcdepfetch
.
Env
=
append
(
srcdepfetch
.
Env
,
"GOPATH="
+
filepath
.
Join
(
*
workdir
,
"modgopath"
))
srcdepfetch
.
Env
=
append
(
srcdepfetch
.
Env
,
"GOPATH="
+
filepath
.
Join
(
*
workdir
,
"modgopath"
))
...
@@ -675,12 +684,19 @@ func doDebianSource(cmdline []string) {
...
@@ -675,12 +684,19 @@ func doDebianSource(cmdline []string) {
meta
:=
newDebMetadata
(
distro
,
goboot
,
*
signer
,
env
,
now
,
pkg
.
Name
,
pkg
.
Version
,
pkg
.
Executables
)
meta
:=
newDebMetadata
(
distro
,
goboot
,
*
signer
,
env
,
now
,
pkg
.
Name
,
pkg
.
Version
,
pkg
.
Executables
)
pkgdir
:=
stageDebianSource
(
*
workdir
,
meta
)
pkgdir
:=
stageDebianSource
(
*
workdir
,
meta
)
// Add Go source code
// Add bootstrapper Go source code
if
err
:=
build
.
ExtractArchive
(
gobootbundle
,
pkgdir
);
err
!=
nil
{
log
.
Fatalf
(
"Failed to extract bootstrapper Go sources: %v"
,
err
)
}
if
err
:=
os
.
Rename
(
filepath
.
Join
(
pkgdir
,
"go"
),
filepath
.
Join
(
pkgdir
,
".goboot"
));
err
!=
nil
{
log
.
Fatalf
(
"Failed to rename bootstrapper Go source folder: %v"
,
err
)
}
// Add builder Go source code
if
err
:=
build
.
ExtractArchive
(
gobundle
,
pkgdir
);
err
!=
nil
{
if
err
:=
build
.
ExtractArchive
(
gobundle
,
pkgdir
);
err
!=
nil
{
log
.
Fatalf
(
"Failed to extract Go sources: %v"
,
err
)
log
.
Fatalf
(
"Failed to extract
builder
Go sources: %v"
,
err
)
}
}
if
err
:=
os
.
Rename
(
filepath
.
Join
(
pkgdir
,
"go"
),
filepath
.
Join
(
pkgdir
,
".go"
));
err
!=
nil
{
if
err
:=
os
.
Rename
(
filepath
.
Join
(
pkgdir
,
"go"
),
filepath
.
Join
(
pkgdir
,
".go"
));
err
!=
nil
{
log
.
Fatalf
(
"Failed to rename Go source folder: %v"
,
err
)
log
.
Fatalf
(
"Failed to rename
builder
Go source folder: %v"
,
err
)
}
}
// Add all dependency modules in compressed form
// Add all dependency modules in compressed form
os
.
MkdirAll
(
filepath
.
Join
(
pkgdir
,
".mod"
,
"cache"
),
0755
)
os
.
MkdirAll
(
filepath
.
Join
(
pkgdir
,
".mod"
,
"cache"
),
0755
)
...
@@ -709,6 +725,19 @@ func doDebianSource(cmdline []string) {
...
@@ -709,6 +725,19 @@ func doDebianSource(cmdline []string) {
}
}
}
}
// downloadGoBootstrapSources downloads the Go source tarball that will be used
// to bootstrap the builder Go.
func
downloadGoBootstrapSources
(
cachedir
string
)
string
{
csdb
:=
build
.
MustLoadChecksums
(
"build/checksums.txt"
)
file
:=
fmt
.
Sprintf
(
"go%s.src.tar.gz"
,
gobootVersion
)
url
:=
"https://dl.google.com/go/"
+
file
dst
:=
filepath
.
Join
(
cachedir
,
file
)
if
err
:=
csdb
.
DownloadFile
(
url
,
dst
);
err
!=
nil
{
log
.
Fatal
(
err
)
}
return
dst
}
// downloadGoSources downloads the Go source tarball.
// downloadGoSources downloads the Go source tarball.
func
downloadGoSources
(
cachedir
string
)
string
{
func
downloadGoSources
(
cachedir
string
)
string
{
csdb
:=
build
.
MustLoadChecksums
(
"build/checksums.txt"
)
csdb
:=
build
.
MustLoadChecksums
(
"build/checksums.txt"
)
...
...
build/deb/ethereum/deb.rules
View file @
2166c860
...
@@ -16,6 +16,11 @@ override_dh_auto_build:
...
@@ -16,6 +16,11 @@ override_dh_auto_build:
# We can't download a fresh Go within Launchpad, so we're shipping and building
# We can't download a fresh Go within Launchpad, so we're shipping and building
# one on the fly. However, we can't build it inside the go-ethereum folder as
# one on the fly. However, we can't build it inside the go-ethereum folder as
# bootstrapping clashes with go modules, so build in a sibling folder.
# bootstrapping clashes with go modules, so build in a sibling folder.
#
# We're also shipping the bootstrapper as of Go 1.20 as it had minimum version
# requirements opposed to older versions of Go.
(
mv
.goboot ../
&&
cd
../.goboot/src
&&
./make.bash
)
(
cd
../.goboot/bin
&&
export
GOROOT_BOOTSTRAP
=
`
pwd
`
)
(
mv
.go ../
&&
cd
../.go/src
&&
./make.bash
)
(
mv
.go ../
&&
cd
../.go/src
&&
./make.bash
)
# We can't download external go modules within Launchpad, so we're shipping the
# We can't download external go modules within Launchpad, so we're shipping the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment