Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-reproducer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
briar
go-reproducer
Commits
f50e2541
Commit
f50e2541
authored
Oct 14, 2019
by
akwizgran
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'remove-non-pie-builds' into 'master'
Remove non-pie versions from build See merge request
!4
parents
eb2acc67
b4567893
Pipeline
#3760
passed with stages
in 10 minutes and 3 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
30 deletions
+23
-30
build-obfs4proxy.py
build-obfs4proxy.py
+16
-21
install.sh
install.sh
+2
-2
utils.py
utils.py
+2
-4
versions.json
versions.json
+3
-3
No files found.
build-obfs4proxy.py
View file @
f50e2541
...
...
@@ -3,7 +3,7 @@ import os
from
glob
import
glob
from
subprocess
import
check_call
from
utils
import
get_build_versions
,
ex
,
get_sha256
,
fail
,
zip_files
,
get_final_file_name
,
\
from
utils
import
get_build_versions
,
ex
,
get_sha256
,
zip_files
,
get_final_file_name
,
\
get_sources_file_name
,
get_pom_file_name
,
reset_time
,
get_obfs4_version
,
check_go_version
,
\
get_version
,
GO_PATH
,
GO_ROOT
,
NDK_DIR
...
...
@@ -78,32 +78,23 @@ def build_android(versions):
env
=
os
.
environ
.
copy
()
env
[
'GOARCH'
]
=
"arm"
env
[
'GOARM'
]
=
"7"
build_android_arch
(
versions
,
env
,
"arm-linux-androideabi"
,
ndk_arch
=
"arm"
,
pie
=
False
)
env
=
os
.
environ
.
copy
()
env
[
'GOARCH'
]
=
"arm"
env
[
'GOARM'
]
=
"7"
build_android_arch
(
versions
,
env
,
"arm-linux-androideabi"
,
ndk_arch
=
"arm"
,
pie
=
True
)
build_android_arch
(
versions
,
env
,
"arm-linux-androideabi"
,
ndk_arch
=
"arm"
)
env
=
os
.
environ
.
copy
()
env
[
'GOARCH'
]
=
"arm64"
env
[
'GOARM'
]
=
"7"
build_android_arch
(
versions
,
env
,
"aarch64-linux-android"
,
ndk_arch
=
"arm64"
,
pie
=
True
)
build_android_arch
(
versions
,
env
,
"aarch64-linux-android"
,
ndk_arch
=
"arm64"
)
env
=
os
.
environ
.
copy
()
env
[
'GOARCH'
]
=
"386"
build_android_arch
(
versions
,
env
,
"i686-linux-android"
,
ndk_arch
=
"x86"
,
pie
=
False
)
env
=
os
.
environ
.
copy
()
env
[
'GOARCH'
]
=
"386"
build_android_arch
(
versions
,
env
,
"i686-linux-android"
,
ndk_arch
=
"x86"
,
pie
=
True
)
build_android_arch
(
versions
,
env
,
"i686-linux-android"
,
ndk_arch
=
"x86"
)
env
=
os
.
environ
.
copy
()
env
[
'GOARCH'
]
=
"amd64"
build_android_arch
(
versions
,
env
,
"x86_64-linux-android"
,
ndk_arch
=
"x86_64"
,
pie
=
True
)
build_android_arch
(
versions
,
env
,
"x86_64-linux-android"
,
ndk_arch
=
"x86_64"
)
def
build_android_arch
(
versions
,
env
,
tool
,
ndk_arch
,
pie
):
def
build_android_arch
(
versions
,
env
,
tool
,
ndk_arch
):
toolchain
=
os
.
path
.
join
(
"toolchain"
,
ndk_arch
)
if
not
os
.
path
.
isdir
(
toolchain
):
toolchain_maker
=
os
.
path
.
join
(
NDK_DIR
,
"build"
,
"tools"
,
"make-standalone-toolchain.sh"
)
...
...
@@ -114,14 +105,16 @@ def build_android_arch(versions, env, tool, ndk_arch, pie):
env
[
'CGO_CFLAGS'
]
=
"-O2"
# removes -g
env
[
'GOOS'
]
=
"android"
build_mode
=
"pie"
if
pie
else
"exe"
extldflags
=
" -extldflags=-pie"
if
pie
else
""
build_mode
=
"pie"
extldflags
=
" -extldflags=-pie"
filename
=
"obfs4proxy_%s_pie.zip"
%
ndk_arch
print
(
"Building %s"
%
filename
)
ex
([
'go'
,
'build'
,
'-buildmode=%s'
%
build_mode
,
'-ldflags'
,
'-w -s'
+
extldflags
]
+
GO_FLAGS
+
[
os
.
path
.
join
(
'.'
,
versions
[
'build_path'
])],
env
=
env
,
cwd
=
REPO_DIR
)
pie_suffix
=
'_pie'
if
pie
else
''
zip_files
([
'obfs4proxy'
],
'obfs4proxy_%s%s.zip'
%
(
ndk_arch
,
pie_suffix
))
zip_files
([
'obfs4proxy'
],
filename
)
os
.
remove
(
'obfs4proxy'
)
...
...
@@ -129,14 +122,16 @@ def build_linux(versions):
env
=
os
.
environ
.
copy
()
env
[
'CGO_ENABLED'
]
=
"0"
build_path
=
os
.
path
.
join
(
'.'
,
versions
[
'build_path'
])
filename
=
"obfs4proxy_linux-x86_64.zip"
print
(
"Building %s"
%
filename
)
ex
([
'go'
,
'build'
,
'-ldflags'
,
'-w -s'
]
+
GO_FLAGS
+
[
build_path
],
env
=
env
,
cwd
=
REPO_DIR
)
zip_files
([
'obfs4proxy'
],
'obfs4proxy_linux-x86_64.zip'
)
os
.
remove
(
'obfs4proxy'
)
def
package_android
(
versions
):
file_list
=
[
'obfs4proxy_arm
.zip'
,
'obfs4proxy_arm
_pie.zip'
,
'obfs4proxy_arm64_pie.zip'
,
'obfs4proxy_x86
.zip'
,
'obfs4proxy_x86
_pie.zip'
,
'obfs4proxy_x86_64_pie.zip'
]
file_list
=
[
'obfs4proxy_arm_pie.zip'
,
'obfs4proxy_arm64_pie.zip'
,
'obfs4proxy_x86_pie.zip'
,
'obfs4proxy_x86_64_pie.zip'
]
package
(
versions
,
file_list
,
android
=
True
)
...
...
install.sh
View file @
f50e2541
...
...
@@ -3,7 +3,7 @@ set -e
set
-x
# use snapshot repos for deterministic package versions
DATE
=
"201910
04
T000000Z"
DATE
=
"201910
10
T000000Z"
cat
<<
EOF
> /etc/apt/sources.list
deb http://snapshot.debian.org/archive/debian/
${
DATE
}
/ buster main
deb http://snapshot.debian.org/archive/debian-security/
${
DATE
}
/ buster/updates main
...
...
@@ -16,7 +16,7 @@ then
fi
# update package sources
apt-get update
--allow-releaseinfo-change
apt-get update
apt-get
-y
upgrade
# do not install documentation to keep image small
...
...
utils.py
View file @
f50e2541
...
...
@@ -34,6 +34,7 @@ def get_build_versions(tool, tag):
if
tag
is
None
:
# take top-most version
tag
=
next
(
iter
(
versions
[
tool
]))
versions
[
tool
][
tag
][
'tag'
]
=
tag
return
tag
,
versions
[
tool
][
tag
]
...
...
@@ -76,10 +77,7 @@ def zip_files(files, zip_name):
def
get_obfs4_version
(
versions
):
version
=
versions
[
'revision'
]
if
'-'
in
version
:
return
version
.
split
(
'-'
)[
1
]
return
version
return
versions
[
'tag'
]
def
get_file_suffix
(
versions
,
android
=
False
):
...
...
versions.json
View file @
f50e2541
{
"obfs4proxy"
:
{
"0.0.11"
:
{
"0.0.11
-2
"
:
{
"repo_url"
:
"https://git.torproject.org/pluggable-transports/obfs4.git"
,
"revision"
:
"obfs4proxy-0.0.11"
,
"build_path"
:
"obfs4proxy"
,
"go"
:
{
"version"
:
"go1.1
1.5
"
,
"sha256"
:
"
bc1ef02bb1668835db1390a2e478dcbccb5dd16911691af9d75184bbe5aa943e
"
"version"
:
"go1.1
3.1
"
,
"sha256"
:
"
81f154e69544b9fa92b1475ff5f11e64270260d46e7e36c34aafc8bc96209358
"
},
"ndk"
:
{
"url"
:
"https://dl.google.com/android/repository/android-ndk-r18-linux-x86_64.zip"
,
...
...
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