Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • briar/go-reproducer
1 result
Show changes
Commits on Source (5)
...@@ -11,4 +11,5 @@ ...@@ -11,4 +11,5 @@
/snowflake*.zip /snowflake*.zip
/snowflake*.pom /snowflake*.pom
/snowflake*.jar /snowflake*.jar
/reference /reference
\ No newline at end of file /output
...@@ -21,27 +21,14 @@ build: ...@@ -21,27 +21,14 @@ build:
- docker build -t ${TEST_IMAGE} . - docker build -t ${TEST_IMAGE} .
- docker push $TEST_IMAGE - docker push $TEST_IMAGE
test_obfs4proxy: test_lyrebird:
stage: test stage: test
script: script:
- docker run -v `pwd`/output:/opt/go-reproducer/output ${TEST_IMAGE} /bin/bash -c "./build-binary.py obfs4proxy && ./verify-binary.py obfs4proxy" - docker run -v `pwd`/output:/opt/go-reproducer/output ${TEST_IMAGE} /bin/bash -c "./build-binary.py lyrebird && ./verify-binary.py lyrebird"
allow_failure: true allow_failure: true
artifacts: artifacts:
paths: paths:
- output/obfs4proxy - output/lyrebird
expire_in: 1 week
when: always
except:
- tags
test_snowflake:
stage: test
script:
- docker run -v `pwd`/output:/opt/go-reproducer/output ${TEST_IMAGE} /bin/bash -c "./build-binary.py snowflake && ./verify-binary.py snowflake"
allow_failure: true
artifacts:
paths:
- output/snowflake
expire_in: 1 week expire_in: 1 week
when: always when: always
except: except:
...@@ -50,12 +37,10 @@ test_snowflake: ...@@ -50,12 +37,10 @@ test_snowflake:
test_tag: test_tag:
stage: test stage: test
script: script:
- docker run -v `pwd`/output:/opt/go-reproducer/output ${TEST_IMAGE} /bin/bash -c "./verify-binary.py obfs4proxy ${CI_COMMIT_REF_NAME}" - docker run -v `pwd`/output:/opt/go-reproducer/output ${TEST_IMAGE} /bin/bash -c "./verify-binary.py lyrebird ${CI_COMMIT_REF_NAME}"
- docker run -v `pwd`/output:/opt/go-reproducer/output ${TEST_IMAGE} /bin/bash -c "./verify-binary.py snowflake ${CI_COMMIT_REF_NAME}"
artifacts: artifacts:
paths: paths:
- output/obfs4proxy - output/lyrebird
- output/snowflake
expire_in: 1 week expire_in: 1 week
when: always when: always
only: only:
......
...@@ -5,7 +5,8 @@ from subprocess import check_call ...@@ -5,7 +5,8 @@ from subprocess import check_call
from utils import get_build_versions, ex, get_sha256, zip_files, get_final_file_path, \ from utils import get_build_versions, ex, get_sha256, zip_files, get_final_file_path, \
get_sources_file_path, get_pom_file_path, reset_time, get_version_number, check_go_version, \ get_sources_file_path, get_pom_file_path, reset_time, get_version_number, check_go_version, \
get_version_and_tool, get_output_dir, get_platform_output_dir, GO_PATH, GO_ROOT, NDK_DIR get_version_and_tool, get_output_dir, get_platform_output_dir, get_ld_flags, \
GO_PATH, GO_ROOT, NDK_DIR
def main(): def main():
...@@ -122,8 +123,14 @@ def build_android_arch(tool, versions, env, clang_arch, ndk_arch, abi): ...@@ -122,8 +123,14 @@ def build_android_arch(tool, versions, env, clang_arch, ndk_arch, abi):
output_file = os.path.abspath(os.path.join(os.path.curdir, tool)) output_file = os.path.abspath(os.path.join(os.path.curdir, tool))
go_flags = ['-asmflags', '-trimpath', '-o', output_file] go_flags = ['-asmflags', '-trimpath', '-o', output_file]
base_ld_flags = '-w -s -extldflags=-pie'
config_ld_flags = get_ld_flags(versions)
if config_ld_flags:
ld_flags = ['-ldflags', "%s %s" % (base_ld_flags, config_ld_flags)]
else:
ld_flags = ['-ldflags', base_ld_flags]
repo_dir = get_repo_dir(versions) repo_dir = get_repo_dir(versions)
ex(['go', 'build', '-buildmode=pie', '-ldflags', '-w -s -extldflags=-pie'] + go_flags + ex(['go', 'build', '-buildmode=pie'] + ld_flags + go_flags +
[os.path.join('.', versions['build_path'])], env=env, cwd=repo_dir) [os.path.join('.', versions['build_path'])], env=env, cwd=repo_dir)
shutil.copy(output_file, tool_path) shutil.copy(output_file, tool_path)
...@@ -165,8 +172,14 @@ def build_desktop_arch(tool, versions, platform, arch, goarch, goarm=None, outpu ...@@ -165,8 +172,14 @@ def build_desktop_arch(tool, versions, platform, arch, goarch, goarm=None, outpu
output_file = os.path.abspath(os.path.join(os.path.curdir, tool)) output_file = os.path.abspath(os.path.join(os.path.curdir, tool))
go_flags = ['-asmflags', '-trimpath', '-o', output_file] go_flags = ['-asmflags', '-trimpath', '-o', output_file]
base_ld_flags = '-w -s'
config_ld_flags = get_ld_flags(versions)
if config_ld_flags:
ld_flags = ['-ldflags', "%s %s" % (base_ld_flags, config_ld_flags)]
else:
ld_flags = ['-ldflags', base_ld_flags]
repo_dir = get_repo_dir(versions) repo_dir = get_repo_dir(versions)
ex(['go', 'build', '-ldflags', '-w -s'] + go_flags + [build_path], env=env, cwd=repo_dir) ex(['go', 'build'] + ld_flags + go_flags + [build_path], env=env, cwd=repo_dir)
shutil.copy(output_file, tool_path) shutil.copy(output_file, tool_path)
......
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.briarproject</groupId>
<artifactId>lyrebird-android</artifactId>
<name>lyrebird-android</name>
<version>VERSION</version>
<url>https://torproject.org</url>
<description>Repo for building lyrebird for Android.</description>
<licenses>
<license>
<name>BSD-3-clause</name>
<url>https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird/-/blob/main/LICENSE</url>
</license>
</licenses>
<developers>
<developer>
<id>yawning</id>
<name>Yawning Angel</name>
<email>yawning at schwanenlied dot me</email>
</developer>
<developer>
<id>torproject</id>
<name>Tor Project</name>
<email>frontdesk@rt.torproject.org</email>
</developer>
</developers>
<scm>
<connection>scm:https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird.git</connection>
<developerConnection>scm:git@gitlab.torproject.org:tpo/anti-censorship/pluggable-transports/lyrebird.git</developerConnection>
<url>scm:https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird.git</url>
</scm>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.briarproject</groupId>
<artifactId>lyrebird-linux</artifactId>
<name>lyrebird-linux</name>
<version>VERSION</version>
<url>https://torproject.org</url>
<description>Repo for building lyrebird for Linux.</description>
<licenses>
<license>
<name>BSD-3-clause</name>
<url>https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird/-/blob/main/LICENSE</url>
</license>
</licenses>
<developers>
<developer>
<id>yawning</id>
<name>Yawning Angel</name>
<email>yawning at schwanenlied dot me</email>
</developer>
<developer>
<id>torproject</id>
<name>Tor Project</name>
<email>frontdesk@rt.torproject.org</email>
</developer>
</developers>
<scm>
<connection>scm:https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird.git</connection>
<developerConnection>scm:git@gitlab.torproject.org:tpo/anti-censorship/pluggable-transports/lyrebird.git</developerConnection>
<url>scm:https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird.git</url>
</scm>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.briarproject</groupId>
<artifactId>lyrebird-macos</artifactId>
<name>lyrebird-macos</name>
<version>VERSION</version>
<url>https://torproject.org</url>
<description>Repo for building lyrebird for macOS.</description>
<licenses>
<license>
<name>BSD-3-clause</name>
<url>https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird/-/blob/main/LICENSE</url>
</license>
</licenses>
<developers>
<developer>
<id>yawning</id>
<name>Yawning Angel</name>
<email>yawning at schwanenlied dot me</email>
</developer>
<developer>
<id>torproject</id>
<name>Tor Project</name>
<email>frontdesk@rt.torproject.org</email>
</developer>
</developers>
<scm>
<connection>scm:https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird.git</connection>
<developerConnection>scm:git@gitlab.torproject.org:tpo/anti-censorship/pluggable-transports/lyrebird.git</developerConnection>
<url>scm:https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird.git</url>
</scm>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.briarproject</groupId>
<artifactId>lyrebird-windows</artifactId>
<name>lyrebird-windows</name>
<version>VERSION</version>
<url>https://torproject.org</url>
<description>Repo for building lyrebird for Windows.</description>
<licenses>
<license>
<name>BSD-3-clause</name>
<url>https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird/-/blob/main/LICENSE</url>
</license>
</licenses>
<developers>
<developer>
<id>yawning</id>
<name>Yawning Angel</name>
<email>yawning at schwanenlied dot me</email>
</developer>
<developer>
<id>torproject</id>
<name>Tor Project</name>
<email>frontdesk@rt.torproject.org</email>
</developer>
</developers>
<scm>
<connection>scm:https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird.git</connection>
<developerConnection>scm:git@gitlab.torproject.org:tpo/anti-censorship/pluggable-transports/lyrebird.git</developerConnection>
<url>scm:https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird.git</url>
</scm>
</project>
...@@ -31,6 +31,8 @@ def get_build_versions(tool, tag): ...@@ -31,6 +31,8 @@ def get_build_versions(tool, tag):
versions[tool][tag]['tag'] = tag versions[tool][tag]['tag'] = tag
return tag, versions[tool][tag] return tag, versions[tool][tag]
def get_ld_flags(versions):
return versions['ld_flags'] if 'ld_flags' in versions else ''
def check_go_version(versions): def check_go_version(versions):
# Check if proper Go version is installed (trailing space, because 'go1.10' in 'go1.10.1') # Check if proper Go version is installed (trailing space, because 'go1.10' in 'go1.10.1')
......
{ {
"lyrebird": {
"0.5.0-2": {
"repo_url": "https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird.git",
"revision": "297ae51866f56146f0523bcf2fd84e0b6ee8a88a",
"ld_flags": "-X main.lyrebirdVersion=0.5.0",
"build_path": "cmd/lyrebird",
"repo_dir": "lyrebird",
"go": {
"version": "go1.21.13",
"sha256": "71fb31606a1de48d129d591e8717a63e0c5565ffba09a24ea9f899a13214c34d"
},
"ndk": {
"url": "https://dl.google.com/android/repository/android-ndk-r23c-linux.zip",
"revision": "23.2.8568313",
"sha256": "6ce94604b77d28113ecd588d425363624a5228d9662450c48d2e4053f8039242"
},
"timestamp": "201001010000.00"
}
},
"obfs4proxy": { "obfs4proxy": {
"0.0.14-tor2": { "0.0.14-tor2": {
"repo_url": "https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/obfs4.git", "repo_url": "https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/obfs4.git",
...@@ -177,4 +196,4 @@ ...@@ -177,4 +196,4 @@
"timestamp": "201001010000.00" "timestamp": "201001010000.00"
} }
} }
} }
\ No newline at end of file