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
f21c99dc
Commit
f21c99dc
authored
Sep 24, 2020
by
akwizgran
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for Linux aarch64.
parent
f50e2541
Pipeline
#4853
passed with stages
in 10 minutes and 45 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
15 deletions
+39
-15
build-obfs4proxy.py
build-obfs4proxy.py
+17
-10
install.sh
install.sh
+1
-1
utils.py
utils.py
+6
-4
versions.json
versions.json
+15
-0
No files found.
build-obfs4proxy.py
View file @
f21c99dc
...
...
@@ -29,12 +29,12 @@ def main():
# Checkout source at specific version
checkout_source_repo
(
versions
)
# Build for various Android versions and create package
build_android
(
versions
)
# Build for 64-bit Linux and create package
# Build for various Linux architectures and create package
build_linux
(
versions
)
# Build for various Android architectures and create package
build_android
(
versions
)
# Package both builds
package_android
(
versions
)
print
()
...
...
@@ -114,18 +114,25 @@ def build_android_arch(versions, env, tool, ndk_arch):
ex
([
'go'
,
'build'
,
'-buildmode=%s'
%
build_mode
,
'-ldflags'
,
'-w -s'
+
extldflags
]
+
GO_FLAGS
+
[
os
.
path
.
join
(
'.'
,
versions
[
'build_path'
])],
env
=
env
,
cwd
=
REPO_DIR
)
zip_files
([
'obfs4proxy'
],
filename
)
zip_files
([
'obfs4proxy'
],
filename
,
versions
)
os
.
remove
(
'obfs4proxy'
)
def
build_linux
(
versions
):
build_linux_arch
(
versions
,
'aarch64'
,
'arm64'
)
build_linux_arch
(
versions
,
'x86_64'
,
'amd64'
)
def
build_linux_arch
(
versions
,
arch
,
goarch
):
env
=
os
.
environ
.
copy
()
env
[
'CGO_ENABLED'
]
=
"0"
env
[
'GOOS'
]
=
"linux"
env
[
'GOARCH'
]
=
goarch
build_path
=
os
.
path
.
join
(
'.'
,
versions
[
'build_path'
])
filename
=
"obfs4proxy_linux-
x86_64.zip"
filename
=
"obfs4proxy_linux-
%s.zip"
%
arch
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'
)
zip_files
([
'obfs4proxy'
],
filename
,
versions
)
os
.
remove
(
'obfs4proxy'
)
...
...
@@ -136,13 +143,13 @@ def package_android(versions):
def
package_linux
(
versions
):
file_list
=
[
'obfs4proxy_linux-x86_64.zip'
]
file_list
=
[
'obfs4proxy_linux-
aarch64.zip'
,
'obfs4proxy_linux-
x86_64.zip'
]
package
(
versions
,
file_list
,
android
=
False
)
def
package
(
versions
,
file_list
,
android
):
zip_file
=
get_final_file_name
(
versions
,
android
)
zip_files
(
file_list
,
zip_file
)
zip_files
(
file_list
,
zip_file
,
versions
)
create_sources_jar
(
versions
)
create_pom_file
(
versions
,
android
)
...
...
@@ -160,7 +167,7 @@ def create_sources_jar(versions):
ex
([
'go'
,
'mod'
,
'vendor'
],
cwd
=
REPO_DIR
)
jar_files
=
[]
for
file
in
glob
(
os
.
path
.
join
(
REPO_DIR
,
'*'
)):
reset_time
(
file
)
reset_time
(
file
,
versions
)
jar_files
.
append
(
os
.
path
.
relpath
(
file
,
REPO_DIR
))
jar_file
=
get_sources_file_name
(
versions
)
jar_path
=
os
.
path
.
abspath
(
jar_file
)
...
...
install.sh
View file @
f21c99dc
...
...
@@ -3,7 +3,7 @@ set -e
set
-x
# use snapshot repos for deterministic package versions
DATE
=
"20
191010
T000000Z"
DATE
=
"20
200922
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
...
...
utils.py
View file @
f21c99dc
...
...
@@ -62,13 +62,15 @@ def get_sha256(filename, block_size=65536):
return
sha256
.
hexdigest
()
def
reset_time
(
file_name
):
check_call
([
'touch'
,
'--no-dereference'
,
'-t'
,
'197001010000.00'
,
file_name
])
def
reset_time
(
filename
,
versions
):
if
'timestamp'
in
versions
:
timestamp
=
versions
[
'timestamp'
]
else
:
timestamp
=
'197001010000.00'
check_call
([
'touch'
,
'--no-dereference'
,
'-t'
,
timestamp
,
filename
])
def
zip_files
(
files
,
zip_name
):
def
zip_files
(
files
,
zip_name
,
versions
):
for
file_name
in
files
:
reset_time
(
file_name
)
reset_time
(
file_name
,
versions
)
# use deterministic permissions to prevent differences in zip files
os
.
chmod
(
file_name
,
0o755
)
sha256hash
=
get_sha256
(
file_name
)
...
...
versions.json
View file @
f21c99dc
{
"obfs4proxy"
:
{
"0.0.11-3"
:
{
"repo_url"
:
"https://git.torproject.org/pluggable-transports/obfs4.git"
,
"revision"
:
"obfs4proxy-0.0.11"
,
"build_path"
:
"obfs4proxy"
,
"go"
:
{
"version"
:
"go1.13.1"
,
"sha256"
:
"81f154e69544b9fa92b1475ff5f11e64270260d46e7e36c34aafc8bc96209358"
},
"ndk"
:
{
"url"
:
"https://dl.google.com/android/repository/android-ndk-r18-linux-x86_64.zip"
,
"revision"
:
"18.0.5002713"
,
"sha256"
:
"c413dd014edc37f822d0dc88fabc05b64232d07d5c6e9345224e47073fdf140b"
},
"timestamp"
:
"201001010000.00"
},
"0.0.11-2"
:
{
"repo_url"
:
"https://git.torproject.org/pluggable-transports/obfs4.git"
,
"revision"
:
"obfs4proxy-0.0.11"
,
...
...
Nico Alt
@nicoalt
mentioned in issue
briar#1854
·
Dec 16, 2020
mentioned in issue
briar#1854
mentioned in issue briar#1854
Toggle commit list
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