Skip to content
Snippets Groups Projects
Commit a5a8b94d authored by akwizgran's avatar akwizgran
Browse files

Keep obfs4 repo directory the same as before for reproducibility.

parent 398151bf
No related branches found
No related tags found
1 merge request!10Add support for building snowflake
Pipeline #12594 passed
......@@ -36,9 +36,9 @@ def main():
package_windows(tool, versions)
def get_repo_dir(tool):
def get_repo_dir(versions):
# This needs to be always the same path, otherwise it breaks reproducibility
return '/tmp/%s' % tool
return '/tmp/%s' % versions['repo_dir']
def install_go(tool, tool_version, versions):
......@@ -56,7 +56,7 @@ def install_android_ndk(tool, tool_version):
def checkout_source_repo(tool, versions):
repo_dir = get_repo_dir(tool)
repo_dir = get_repo_dir(versions)
if os.path.isdir(repo_dir):
# get latest commits and tags from remote
check_call(['git', 'fetch', 'origin'], cwd=repo_dir)
......@@ -113,7 +113,7 @@ def build_android_arch(tool, versions, env, clang_arch, ndk_arch):
output_file = os.path.abspath(os.path.join(os.path.curdir, tool))
go_flags = ['-asmflags', '-trimpath', '-o', output_file]
repo_dir = get_repo_dir(tool)
repo_dir = get_repo_dir(versions)
ex(['go', 'build', '-buildmode=%s' % build_mode, '-ldflags', '-w -s' + extldflags] + go_flags +
[os.path.join('.', versions['build_path'])], env=env, cwd=repo_dir)
......@@ -142,7 +142,7 @@ def build_desktop_arch(tool, versions, goos, arch, goarch, goarm=None):
print("Building %s" % filename)
output_file = os.path.abspath(os.path.join(os.path.curdir, tool))
go_flags = ['-asmflags', '-trimpath', '-o', output_file]
repo_dir = get_repo_dir(tool)
repo_dir = get_repo_dir(versions)
ex(['go', 'build', '-ldflags', '-w -s'] + go_flags + [build_path], env=env, cwd=repo_dir)
zip_files([tool], filename, versions)
os.remove(tool)
......@@ -186,7 +186,7 @@ def package(tool, versions, file_list, platform):
def create_sources_jar(tool, versions, platform):
repo_dir = get_repo_dir(tool)
repo_dir = get_repo_dir(versions)
# clean all untracked files and directories (-d) from repo
check_call(['git', 'clean', '-dffx'], cwd=repo_dir)
# vendorize dependencies
......
......@@ -4,6 +4,7 @@
"repo_url": "https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/obfs4.git",
"revision": "ed46c23917b55c4b274d6986daeaf6bec7963115",
"build_path": "obfs4proxy",
"repo_dir": "obfs4",
"go": {
"version": "go1.16",
"sha256": "7688063d55656105898f323d90a79a39c378d86fe89ae192eb3b7fc46347c95a"
......@@ -19,6 +20,7 @@
"repo_url": "https://git.torproject.org/pluggable-transports/obfs4.git",
"revision": "336a71d6e4cfd2d33e9c57797828007ad74975e9",
"build_path": "obfs4proxy",
"repo_dir": "obfs4",
"go": {
"version": "go1.16",
"sha256": "7688063d55656105898f323d90a79a39c378d86fe89ae192eb3b7fc46347c95a"
......@@ -34,6 +36,7 @@
"repo_url": "https://git.torproject.org/pluggable-transports/obfs4.git",
"revision": "a564bc3840bc788605e1a8155f4b95ce0d70c6db",
"build_path": "obfs4proxy",
"repo_dir": "obfs4",
"go": {
"version": "go1.16",
"sha256": "7688063d55656105898f323d90a79a39c378d86fe89ae192eb3b7fc46347c95a"
......@@ -49,6 +52,7 @@
"repo_url": "https://git.torproject.org/pluggable-transports/obfs4.git",
"revision": "40245c4a",
"build_path": "obfs4proxy",
"repo_dir": "obfs4",
"go": {
"version": "go1.13.1",
"sha256": "81f154e69544b9fa92b1475ff5f11e64270260d46e7e36c34aafc8bc96209358"
......@@ -64,6 +68,7 @@
"repo_url": "https://git.torproject.org/pluggable-transports/obfs4.git",
"revision": "obfs4proxy-0.0.11",
"build_path": "obfs4proxy",
"repo_dir": "obfs4",
"go": {
"version": "go1.13.1",
"sha256": "81f154e69544b9fa92b1475ff5f11e64270260d46e7e36c34aafc8bc96209358"
......@@ -79,6 +84,7 @@
"repo_url": "https://git.torproject.org/pluggable-transports/obfs4.git",
"revision": "obfs4proxy-0.0.11",
"build_path": "obfs4proxy",
"repo_dir": "obfs4",
"go": {
"version": "go1.13.1",
"sha256": "81f154e69544b9fa92b1475ff5f11e64270260d46e7e36c34aafc8bc96209358"
......@@ -93,6 +99,7 @@
"repo_url": "https://git.torproject.org/pluggable-transports/obfs4.git",
"revision": "obfs4proxy-0.0.9",
"build_path": "obfs4proxy",
"repo_dir": "obfs4",
"go": {
"version": "go1.11.5",
"sha256": "bc1ef02bb1668835db1390a2e478dcbccb5dd16911691af9d75184bbe5aa943e"
......@@ -109,6 +116,7 @@
"repo_url": "https://git.torproject.org/pluggable-transports/snowflake.git",
"revision": "36f03dfd4483922b3e7400dedc71df9cf2f30b6b",
"build_path": "client",
"repo_dir": "snowflake",
"go": {
"version": "go1.16",
"sha256": "7688063d55656105898f323d90a79a39c378d86fe89ae192eb3b7fc46347c95a"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment