Commit 144d70db authored by Cecylia Bocovich's avatar Cecylia Bocovich 💬 Committed by Richard Pospesel
Browse files

Bug 41361: Reproducible conjure builds

Add a conjure project and go dependencies to reproducibly build the
conjure client on all platforms.
parent 56ade2cf
Loading
Loading
Loading
Loading
+17 −0
Changes for projects/bsbuffer/config: 17 added lines, 0 removed lines.
Original line number Diff line number Diff line
# vim: filetype=yaml sw=2
version: '[% c("abbrev") %]'
git_url: https://github.com/sergeyfrolov/bsbuffer
git_hash: 94e85abb850729a5f54f383e8175e62931d04748
filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
container:
  use_container: 1

build: '[% c("projects/go/var/build_go_lib") %]'

var:
  go_lib: github.com/sergeyfrolov/bsbuffer

input_files:
  - project: container-image
  - name: go
    project: go

projects/conjure/build

0 → 100644
+38 −0
Changes for projects/conjure/build: 38 added lines, 0 removed lines.
Original line number Diff line number Diff line
#!/bin/bash
[% c("var/set_default_env") -%]
[% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %]
distdir=/var/tmp/dist/[% project %]
mkdir -p $distdir

[% IF c("var/android") -%]
  [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
  # We need to explicitly set CGO_ENABLED with Go 1.13.x as the Android build
  # breaks otherwise.
  export CGO_ENABLED=1
[% END -%]

tar -C /var/tmp/dist -xf [% c('input_files_by_name/goptlib') %]
tar -C /var/tmp/dist -xf [% c('input_files_by_name/snowflake-lib') %]
tar -C /var/tmp/dist -xf [% c('input_files_by_name/gotapdance') %]

mkdir -p /var/tmp/build
tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
cd /var/tmp/build/[% project %]-[% c('version') %]

mkdir -p "$GOPATH/src/gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/conjure.git"

# Fix gopath location of versioned dependencies
ln -sf "$GOPATH/src/git.torproject.org/pluggable-transports/snowflake.git" "$GOPATH/src/git.torproject.org/pluggable-transports/snowflake.git/v2"

cd client
go build -ldflags '-s'
cp -a client[% IF c("var/windows") %].exe[% END %] $distdir/conjure-client[% IF c("var/windows") %].exe[% END %]

cd ..
cp -a README.md $distdir/README.CONJURE.md

cd $distdir
[% c('tar', {
        tar_src => [ '.' ],
        tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
    }) %]
+21 −0
Changes for projects/conjure/config: 21 added lines, 0 removed lines.
Original line number Diff line number Diff line
# vim: filetype=yaml sw=2
version: '[% c("abbrev") %]'
git_url: https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/conjure.git
git_hash: b7d485734c3ab09ef3da818abb4b39ec27ef3a73
filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
container:
  use_container: 1

input_files:
  - project: container-image
  - name: go
    project: go
  - name: goptlib
    project: goptlib
  - name: gotapdance
    project: gotapdance
  - name: snowflake-lib
    project: snowflake-lib
  - name: '[% c("var/compiler") %]'
    project: '[% c("var/compiler") %]'
    enable: '[% c("var/android") %]'

projects/go-cmp/config

0 → 100644
+23 −0
Changes for projects/go-cmp/config: 23 added lines, 0 removed lines.
Original line number Diff line number Diff line
# vim: filetype=yaml sw=2
version: '[% c("abbrev") %]'
git_url: https://github.com/google/go-cmp
git_hash: 8fa37b4dd109f12e42b131e485268768f18bcbf8 #v0.5.5
filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
container:
  use_container: 1

build: '[% c("projects/go/var/build_go_lib") %]'

var:
  go_lib: github.com/google/go-cmp
  go_lib_deps:
    - goxxerrors
  build_go_lib_pre: |
    cd "cmp"

input_files:
  - project: container-image
  - name: go
    project: go
  - name: goxxerrors
    project: goxxerrors
+23 −0
Changes for projects/goprotobuf/config: 23 added lines, 0 removed lines.
Original line number Diff line number Diff line
# vim: filetype=yaml sw=2
version: '[% c("abbrev") %]'
git_url: https://github.com/golang/protobuf
git_hash: ae97035608a719c7a1c1c41bed0ae0744bdb0c6f #v1.5.2
filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
container:
  use_container: 1

build: '[% c("projects/go/var/build_go_lib") %]'

var:
  go_lib: github.com/golang/protobuf
  go_lib_install:
    - github.com/golang/protobuf/proto
  go_lib_deps:
    - protobuf

input_files:
  - project: container-image
  - name: go
    project: go
  - name: protobuf
    project: protobuf
Loading