Commit db81f989 authored by akwizgran's avatar akwizgran
Browse files

Merge branch 'add-linux-aarch64' into 'master'

Add linux aarch64 and dev version with cert pinning fix

Closes briar#1934

See merge request !5
parents f50e2541 b4dcd323
Pipeline #5764 passed with stages
in 11 minutes and 22 seconds
......@@ -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)
......
......@@ -3,7 +3,7 @@ set -e
set -x
# use snapshot repos for deterministic package versions
DATE="20191010T000000Z"
DATE="20210216T000000Z"
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
......
......@@ -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)
......
{
"obfs4proxy": {
"0.0.12-dev-40245c4a": {
"repo_url": "https://git.torproject.org/pluggable-transports/obfs4.git",
"revision": "40245c4a",
"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-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",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment