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
f2e94ff9
Commit
f2e94ff9
authored
Mar 02, 2017
by
Péter Szilágyi
Committed by
GitHub
Mar 02, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3727 from karalabe/travis-mips
travis: support building mips32 and mips64 too
parents
213b8f9a
f972691e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
23 deletions
+78
-23
.travis.yml
.travis.yml
+26
-0
Makefile
Makefile
+22
-12
ci.go
build/ci.go
+30
-11
No files found.
.travis.yml
View file @
f2e94ff9
...
...
@@ -66,6 +66,32 @@ matrix:
# - CC=aarch64-linux-gnu-gcc go run build/ci.go install -arch arm64
# - go run build/ci.go archive -arch arm64 -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
# This builder does the Linux Azure MIPS xgo uploads
-
os
:
linux
dist
:
trusty
sudo
:
required
services
:
-
docker
go
:
1.8
env
:
-
azure-linux-mips
script
:
-
go run build/ci.go xgo --alltools -- --targets=linux/mips --ldflags '-extldflags "-static"' -v
-
for bin in build/bin/*-linux-mips; do mv -f "${bin}" "${bin/-linux-mips/}"; done
-
go run build/ci.go archive -arch mips -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
-
go run build/ci.go xgo --alltools -- --targets=linux/mipsle --ldflags '-extldflags "-static"' -v
-
for bin in build/bin/*-linux-mipsle; do mv -f "${bin}" "${bin/-linux-mipsle/}"; done
-
go run build/ci.go archive -arch mipsle -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
-
go run build/ci.go xgo --alltools -- --targets=linux/mips64 --ldflags '-extldflags "-static"' -v
-
for bin in build/bin/*-linux-mips64; do mv -f "${bin}" "${bin/-linux-mips64/}"; done
-
go run build/ci.go archive -arch mips64 -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
-
go run build/ci.go xgo --alltools -- --targets=linux/mips64le --ldflags '-extldflags "-static"' -v
-
for bin in build/bin/*-linux-mips64le; do mv -f "${bin}" "${bin/-linux-mips64le/}"; done
-
go run build/ci.go archive -arch mips64le -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
# This builder is a temporary fallback for building ARM64 while Go 1.8 is fixed
-
os
:
linux
dist
:
trusty
...
...
Makefile
View file @
f2e94ff9
...
...
@@ -51,12 +51,12 @@ geth-linux: geth-linux-386 geth-linux-amd64 geth-linux-arm geth-linux-mips64 get
@
ls
-ld
$(GOBIN)
/geth-linux-
*
geth-linux-386
:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--
dest
=
$(GOBIN)
--
targets
=
linux/386
-v
./cmd/geth
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--targets
=
linux/386
-v
./cmd/geth
@
echo
"Linux 386 cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-linux-
*
|
grep
386
geth-linux-amd64
:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--
dest
=
$(GOBIN)
--
targets
=
linux/amd64
-v
./cmd/geth
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--targets
=
linux/amd64
-v
./cmd/geth
@
echo
"Linux amd64 cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-linux-
*
|
grep
amd64
...
...
@@ -65,32 +65,42 @@ geth-linux-arm: geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-ar
@
ls
-ld
$(GOBIN)
/geth-linux-
*
|
grep
arm
geth-linux-arm-5
:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--
dest
=
$(GOBIN)
--
targets
=
linux/arm-5
-v
./cmd/geth
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--targets
=
linux/arm-5
-v
./cmd/geth
@
echo
"Linux ARMv5 cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-linux-
*
|
grep
arm-5
geth-linux-arm-6
:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--
dest
=
$(GOBIN)
--
targets
=
linux/arm-6
-v
./cmd/geth
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--targets
=
linux/arm-6
-v
./cmd/geth
@
echo
"Linux ARMv6 cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-linux-
*
|
grep
arm-6
geth-linux-arm-7
:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--
dest
=
$(GOBIN)
--
targets
=
linux/arm-7
-v
./cmd/geth
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--targets
=
linux/arm-7
-v
./cmd/geth
@
echo
"Linux ARMv7 cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-linux-
*
|
grep
arm-7
geth-linux-arm64
:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--
dest
=
$(GOBIN)
--
targets
=
linux/arm64
-v
./cmd/geth
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--targets
=
linux/arm64
-v
./cmd/geth
@
echo
"Linux ARM64 cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-linux-
*
|
grep
arm64
geth-linux-mips
:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--targets
=
linux/mips
--ldflags
'-extldflags "-static"'
-v
./cmd/geth
@
echo
"Linux MIPS cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-linux-
*
|
grep
mips
geth-linux-mipsle
:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--targets
=
linux/mipsle
--ldflags
'-extldflags "-static"'
-v
./cmd/geth
@
echo
"Linux MIPSle cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-linux-
*
|
grep
mipsle
geth-linux-mips64
:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--
dest
=
$(GOBIN)
--targets
=
linux/mips64
-v
./cmd/geth
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--
targets
=
linux/mips64
--ldflags
'-extldflags "-static"'
-v
./cmd/geth
@
echo
"Linux MIPS64 cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-linux-
*
|
grep
mips64
geth-linux-mips64le
:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--
dest
=
$(GOBIN)
--targets
=
linux/mips64le
-v
./cmd/geth
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--
targets
=
linux/mips64le
--ldflags
'-extldflags "-static"'
-v
./cmd/geth
@
echo
"Linux MIPS64le cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-linux-
*
|
grep
mips64le
...
...
@@ -99,12 +109,12 @@ geth-darwin: geth-darwin-386 geth-darwin-amd64
@
ls
-ld
$(GOBIN)
/geth-darwin-
*
geth-darwin-386
:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--
dest
=
$(GOBIN)
--
targets
=
darwin/386
-v
./cmd/geth
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--targets
=
darwin/386
-v
./cmd/geth
@
echo
"Darwin 386 cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-darwin-
*
|
grep
386
geth-darwin-amd64
:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--
dest
=
$(GOBIN)
--
targets
=
darwin/amd64
-v
./cmd/geth
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--targets
=
darwin/amd64
-v
./cmd/geth
@
echo
"Darwin amd64 cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-darwin-
*
|
grep
amd64
...
...
@@ -113,11 +123,11 @@ geth-windows: geth-windows-386 geth-windows-amd64
@
ls
-ld
$(GOBIN)
/geth-windows-
*
geth-windows-386
:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--
dest
=
$(GOBIN)
--
targets
=
windows/386
-v
./cmd/geth
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--targets
=
windows/386
-v
./cmd/geth
@
echo
"Windows 386 cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-windows-
*
|
grep
386
geth-windows-amd64
:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--
dest
=
$(GOBIN)
--
targets
=
windows/amd64
-v
./cmd/geth
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--targets
=
windows/amd64
-v
./cmd/geth
@
echo
"Windows amd64 cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-windows-
*
|
grep
amd64
build/ci.go
View file @
f2e94ff9
...
...
@@ -23,15 +23,15 @@ Usage: go run ci.go <command> <command flags/arguments>
Available commands are:
install [
-arch architecture
] [ packages... ] -- builds packages and executables
test [ -coverage ] [ -vet ] [ -misspell ] [ packages... ] -- runs the tests
archive [
-arch architecture
] [ -type zip|tar ] [ -signer key-envvar ] [ -upload dest ] -- archives build artefacts
importkeys -- imports signing keys from env
debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package
nsis -- creates a Windows NSIS installer
aar [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an Android archive
xcode [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an iOS XCode framework
xgo [
options ]
-- cross builds according to options
install [
-arch architecture
] [ packages... ] -- builds packages and executables
test [ -coverage ] [ -vet ] [ -misspell ] [ packages... ]
-- runs the tests
archive [
-arch architecture
] [ -type zip|tar ] [ -signer key-envvar ] [ -upload dest ] -- archives build artefacts
importkeys
-- imports signing keys from env
debsrc [ -signer key-id ] [ -upload dest ]
-- creates a debian source package
nsis
-- creates a Windows NSIS installer
aar [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ]
-- creates an Android archive
xcode [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ]
-- creates an iOS XCode framework
xgo [
-alltools ] [ options ]
-- cross builds according to options
For all commands, -n prevents execution of external programs (dry run mode).
...
...
@@ -917,6 +917,9 @@ func newPodMetadata(env build.Environment, archive string) podMetadata {
// Cross compilation
func
doXgo
(
cmdline
[]
string
)
{
var
(
alltools
=
flag
.
Bool
(
"alltools"
,
false
,
`Flag whether we're building all known tools, or only on in particular`
)
)
flag
.
CommandLine
.
Parse
(
cmdline
)
env
:=
build
.
Env
()
...
...
@@ -924,8 +927,24 @@ func doXgo(cmdline []string) {
gogetxgo
:=
goTool
(
"get"
,
"github.com/karalabe/xgo"
)
build
.
MustRun
(
gogetxgo
)
// Execute the actual cross compilation
xgo
:=
xgoTool
(
append
(
buildFlags
(
env
),
flag
.
Args
()
...
))
// If all tools building is requested, build everything the builder wants
args
:=
append
(
buildFlags
(
env
),
flag
.
Args
()
...
)
args
=
append
(
args
,
[]
string
{
"--dest"
,
GOBIN
}
...
)
if
*
alltools
{
for
_
,
res
:=
range
allToolsArchiveFiles
{
if
strings
.
HasPrefix
(
res
,
GOBIN
)
{
// Binary tool found, cross build it explicitly
args
=
append
(
args
,
"./"
+
filepath
.
Join
(
"cmd"
,
filepath
.
Base
(
res
)))
xgo
:=
xgoTool
(
args
)
build
.
MustRun
(
xgo
)
args
=
args
[
:
len
(
args
)
-
1
]
}
}
return
}
// Otherwise xxecute the explicit cross compilation
xgo
:=
xgoTool
(
args
)
build
.
MustRun
(
xgo
)
}
...
...
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