morgan pushed to branch maint-13.5 at The Tor Project / Applications / tor-browser-build
Commits:
-
01306970
by Nicolas Vigier at 2025-02-10T17:37:34+01:00
-
ed149149
by Nicolas Vigier at 2025-02-10T17:50:53+01:00
-
8626181d
by Nicolas Vigier at 2025-02-10T17:51:32+01:00
-
6867368f
by Nicolas Vigier at 2025-02-10T17:51:43+01:00
8 changed files:
- projects/mar-tools/config
- tools/dmg2mar
- + tools/mar
- + tools/setup-martools
- tools/signing/machines-setup/setup-signing-machine
- tools/signing/machines-setup/upload-tbb-to-signing-machine
- + tools/signmar
- tools/update-responses/update_responses
Changes:
| 1 | 1 | # vim: filetype=yaml sw=2
|
| 2 | 2 | #
|
| 3 | 3 | # Used by tools/signing/machines-setup/upload-tbb-to-signing-machine
|
| 4 | -# to fetch mar-tools for signing machine setup
|
|
| 4 | +# to fetch mar-tools for signing machine setup, and by tools/setup-martools
|
|
| 5 | +# to allow running `mar` as `tools/mar`.
|
|
| 5 | 6 | #
|
| 6 | -version: 12.0.4
|
|
| 7 | -filename: 'mar-tools-linux64.zip'
|
|
| 7 | +version: 14.0.4
|
|
| 8 | +filename: 'mar-tools.zip'
|
|
| 8 | 9 | container:
|
| 9 | 10 | use_container: 0
|
| 10 | 11 | gpg_keyring: torbrowser.gpg
|
| 11 | 12 | tag_gpg_id: 1
|
| 12 | 13 | input_files:
|
| 13 | - - URL: 'https://archive.torproject.org/tor-package-archive/torbrowser/[% c("version") %]/mar-tools-linux64.zip'
|
|
| 14 | - sha256sum: 726ec4192de61a9342b3262c7ac722cbd59eaba07879be9589c65599d2d69584
|
|
| 14 | + - URL: 'https://archive.torproject.org/tor-package-archive/torbrowser/[% c("version") %]/mar-tools-linux-x86_64-[% c("version") %].zip'
|
|
| 15 | + sha256sum: 414254d2471c7f0bcc25de955dbbe716c416d0b80e7688dc2dd48ac6e7fdbf0a
|
|
| 15 | 16 | |
| 16 | 17 | steps:
|
| 17 | 18 | fetch_martools:
|
| 18 | 19 | fetch_martools: |
|
| 19 | 20 | #!/bin/bash
|
| 20 | - echo ok |
|
| 21 | + mkdir -p '[% dest_dir %]'
|
|
| 22 | + cp -f mar-tools-linux-x86_64-[% c("version") %].zip '[% dest_dir %]/mar-tools.zip' |
| ... | ... | @@ -34,6 +34,7 @@ use File::Slurp; |
| 34 | 34 | use File::Find;
|
| 35 | 35 | use Parallel::ForkManager;
|
| 36 | 36 | use Cwd;
|
| 37 | +use FindBin;
|
|
| 37 | 38 | |
| 38 | 39 | # If the application is not TorBrowser (for instance, TorMessenger)
|
| 39 | 40 | # set the application name in the TOR_APPNAME_BUNDLE_OSX,
|
| ... | ... | @@ -70,25 +71,18 @@ sub osname { |
| 70 | 71 | exit_error 'Unknown OS';
|
| 71 | 72 | }
|
| 72 | 73 | |
| 73 | -my $martools_tmpdir;
|
|
| 74 | -sub extract_martools {
|
|
| 75 | - my $osname = osname;
|
|
| 76 | - my $marzip = glob(getcwd . "/mar-tools-$osname-*.zip");
|
|
| 77 | - exit_error "Could not find mar-tools zip" unless $marzip;
|
|
| 78 | - $martools_tmpdir = File::Temp->newdir();
|
|
| 79 | - my $old_cwd = getcwd;
|
|
| 80 | - chdir $martools_tmpdir;
|
|
| 81 | - my (undef, undef, $success) = capture_exec('unzip', $marzip);
|
|
| 82 | - chdir $old_cwd;
|
|
| 83 | - exit_error "Error extracting $marzip" unless $success;
|
|
| 84 | - $ENV{PATH} = "$martools_tmpdir/mar-tools:$ENV{PATH}";
|
|
| 85 | - if ($ENV{LD_LIBRARY_PATH}) {
|
|
| 86 | - $ENV{LD_LIBRARY_PATH} .= ":$martools_tmpdir/mar-tools";
|
|
| 87 | - } else {
|
|
| 88 | - $ENV{LD_LIBRARY_PATH} = "$martools_tmpdir/mar-tools";
|
|
| 89 | - }
|
|
| 90 | - $ENV{MAR} = "$martools_tmpdir/mar-tools/mar";
|
|
| 91 | - $ENV{MSBDIFF} = "$martools_tmpdir/mar-tools/mbsdiff";
|
|
| 74 | +sub setup_martools {
|
|
| 75 | + my ($out, $err, $exit) = capture {
|
|
| 76 | + system("$FindBin::Bin/setup-martools");
|
|
| 77 | + };
|
|
| 78 | + exit_error "Error setting up mar-tools: $err" if $exit;
|
|
| 79 | + my $martoolsdir = "$FindBin::Bin/local/mar-tools";
|
|
| 80 | + if ($ENV{LD_LIBRARY_PATH}) {
|
|
| 81 | + $ENV{LD_LIBRARY_PATH} = "$ENV{LD_LIBRARY_PATH}:$martoolsdir";
|
|
| 82 | + } else {
|
|
| 83 | + $ENV{LD_LIBRARY_PATH} = "$martoolsdir/mar-tools";
|
|
| 84 | + }
|
|
| 85 | + $ENV{PATH} = "$martoolsdir:$ENV{PATH}";
|
|
| 92 | 86 | }
|
| 93 | 87 | |
| 94 | 88 | sub get_nbprocs {
|
| ... | ... | @@ -192,6 +186,6 @@ $ENV{LC_ALL} = 'C'; |
| 192 | 186 | exit_error "Please specify the mar channel id" unless @ARGV == 1;
|
| 193 | 187 | my $mar_channel_id = $ARGV[0];
|
| 194 | 188 | |
| 195 | -extract_martools;
|
|
| 189 | +setup_martools;
|
|
| 196 | 190 | convert_files $mar_channel_id;
|
| 197 | 191 | remove_incremental_mars; |
| 1 | +#!/bin/bash
|
|
| 2 | +set -e
|
|
| 3 | + |
|
| 4 | +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
| 5 | +cmdname=$(basename -- "${BASH_SOURCE[0]}")
|
|
| 6 | +setupmt=$("$script_dir/setup-martools")
|
|
| 7 | +eval "$setupmt"
|
|
| 8 | +exec "$MARTOOLSDIR/$cmdname" "$@" |
| 1 | +#!/bin/bash
|
|
| 2 | +set -e
|
|
| 3 | + |
|
| 4 | +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
| 5 | + |
|
| 6 | +localdir="$script_dir/local"
|
|
| 7 | +test $# -eq 1 && localdir="$1"
|
|
| 8 | + |
|
| 9 | +cd "$script_dir/.."
|
|
| 10 | + |
|
| 11 | +function download_extract_martools {
|
|
| 12 | + make submodule-update > /dev/null
|
|
| 13 | + martools_version=$(./rbm/rbm showconf --step fetch_martools mar-tools version)
|
|
| 14 | + if test -h "$localdir/mar-tools"; then
|
|
| 15 | + test "$(readlink $localdir/mar-tools)" = "mar-tools-$martools_version" && return 0
|
|
| 16 | + rm -f "$localdir/mar-tools"
|
|
| 17 | + fi
|
|
| 18 | + if test -d "$localdir/mar-tools"; then
|
|
| 19 | + echo "Error: $localdir/mar-tools already exists and is not a symlink"
|
|
| 20 | + exit 1
|
|
| 21 | + fi
|
|
| 22 | + echo "Setting up mar-tools"
|
|
| 23 | + mkdir -p "$localdir"
|
|
| 24 | + cd "$localdir"
|
|
| 25 | + if ! test -d "mar-tools-$martools_version"; then
|
|
| 26 | + cd "$script_dir/.."
|
|
| 27 | + ./rbm/rbm build --step fetch_martools mar-tools
|
|
| 28 | + martools_zip="$(pwd)/out/mar-tools/mar-tools.zip"
|
|
| 29 | + cd "$localdir"
|
|
| 30 | + test -f "$martools_zip"
|
|
| 31 | + unzip -jd "mar-tools-$martools_version" "$martools_zip"
|
|
| 32 | + fi
|
|
| 33 | + ln -sf "mar-tools-$martools_version" mar-tools
|
|
| 34 | + echo "mar-tools have been set up in $localdir/mar-tools"
|
|
| 35 | +}
|
|
| 36 | + |
|
| 37 | +function print_martools_vars {
|
|
| 38 | + mardir="$localdir/mar-tools"
|
|
| 39 | + if test -z "$LD_LIBRARY_PATH"; then
|
|
| 40 | + echo "export LD_LIBRARY_PATH=$mardir"
|
|
| 41 | + else
|
|
| 42 | + echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$mardir"
|
|
| 43 | + fi
|
|
| 44 | + echo "export MARTOOLSDIR=$mardir"
|
|
| 45 | + echo "export MAR=$mardir/mar"
|
|
| 46 | +}
|
|
| 47 | + |
|
| 48 | +download_extract_martools >&2
|
|
| 49 | +print_martools_vars |
| ... | ... | @@ -137,7 +137,7 @@ fi |
| 137 | 137 | # install mar-tools
|
| 138 | 138 | if ! test -d /home/signing-mar/mar-tools; then
|
| 139 | 139 | tmpdir=$(mktemp -d)
|
| 140 | - unzip -d "$tmpdir" /signing/mar-tools-linux64.zip
|
|
| 140 | + unzip -d "$tmpdir" /signing/mar-tools.zip
|
|
| 141 | 141 | chown -R signing-mar:signing-mar "$tmpdir/mar-tools"
|
| 142 | 142 | chmod go+rX "$tmpdir/mar-tools"/*
|
| 143 | 143 | mv "$tmpdir/mar-tools" /home/signing-mar/mar-tools
|
| ... | ... | @@ -25,7 +25,7 @@ git archive --prefix=rbm/ --output="$tmpdir/rbm.tar" HEAD . |
| 25 | 25 | echo "Created rbm.tar"
|
| 26 | 26 | cd ..
|
| 27 | 27 | |
| 28 | -martools_filename=mar-tools-linux64.zip
|
|
| 28 | +martools_filename=mar-tools.zip
|
|
| 29 | 29 | if ! test -f "./out/mar-tools/$martools_filename"; then
|
| 30 | 30 | ./rbm/rbm build --step fetch_martools mar-tools
|
| 31 | 31 | echo "Downloaded $martools_filename"
|
| 1 | +mar |
|
| \ No newline at end of file |
| ... | ... | @@ -33,8 +33,6 @@ my %htdocsfiles; |
| 33 | 33 | my $releases_dir = $config->{releases_dir};
|
| 34 | 34 | $releases_dir = "$FindBin::Bin/$releases_dir" unless $releases_dir =~ m/^\//;
|
| 35 | 35 | my @check_errors;
|
| 36 | -my $initPATH = $ENV{PATH};
|
|
| 37 | -my $initLD_LIBRARY_PATH = $ENV{LD_LIBRARY_PATH};
|
|
| 38 | 36 | |
| 39 | 37 | sub exit_error {
|
| 40 | 38 | print STDERR "Error: ", $_[0], "\n";
|
| ... | ... | @@ -63,6 +61,20 @@ sub get_nbprocs { |
| 63 | 61 | return 4;
|
| 64 | 62 | }
|
| 65 | 63 | |
| 64 | +sub setup_martools {
|
|
| 65 | + my ($out, $err, $exit) = capture {
|
|
| 66 | + system("$FindBin::Bin/../setup-martools");
|
|
| 67 | + };
|
|
| 68 | + exit_error "Error setting up mar-tools: $err" if $exit;
|
|
| 69 | + my $martoolsdir = "$FindBin::Bin/../local/mar-tools";
|
|
| 70 | + if ($ENV{LD_LIBRARY_PATH}) {
|
|
| 71 | + $ENV{LD_LIBRARY_PATH} = "$ENV{LD_LIBRARY_PATH}:$martoolsdir";
|
|
| 72 | + } else {
|
|
| 73 | + $ENV{LD_LIBRARY_PATH} = "$martoolsdir/mar-tools";
|
|
| 74 | + }
|
|
| 75 | + $ENV{PATH} = "$martoolsdir:$ENV{PATH}";
|
|
| 76 | +}
|
|
| 77 | + |
|
| 66 | 78 | sub write_htdocs {
|
| 67 | 79 | my ($channel, $file, $content) = @_;
|
| 68 | 80 | mkdir $htdocsdir unless -d $htdocsdir;
|
| ... | ... | @@ -320,7 +332,7 @@ sub channel_to_version { |
| 320 | 332 | sub get_buildinfos {
|
| 321 | 333 | my ($config, $version) = @_;
|
| 322 | 334 | return if exists $config->{versions}{$version}{buildID};
|
| 323 | - extract_martools($config, $version);
|
|
| 335 | + setup_martools;
|
|
| 324 | 336 | my $files = $config->{versions}{$version}{files};
|
| 325 | 337 | foreach my $os (keys %$files) {
|
| 326 | 338 | foreach my $lang (keys %{$files->{$os}}) {
|
| ... | ... | @@ -474,37 +486,6 @@ sub write_downloads_json { |
| 474 | 486 | }
|
| 475 | 487 | }
|
| 476 | 488 | |
| 477 | -sub marzip_path {
|
|
| 478 | - my ($config, $version) = @_;
|
|
| 479 | - for my $osname (qw/linux-x86_64 linux-i686 macos-x86_64 windows-x86_64 windows-i686/) {
|
|
| 480 | - my $marzip = glob(version_dir($config, $version) . "/mar-tools-$osname-*.zip");
|
|
| 481 | - if ($marzip && -f $marzip) {
|
|
| 482 | - return $marzip;
|
|
| 483 | - }
|
|
| 484 | - }
|
|
| 485 | - exit_error 'Could not find mar-tools';
|
|
| 486 | -}
|
|
| 487 | - |
|
| 488 | -my $martools_tmpdir;
|
|
| 489 | -sub extract_martools {
|
|
| 490 | - my ($config, $version) = @_;
|
|
| 491 | - my $marzip = marzip_path($config, $version);
|
|
| 492 | - $martools_tmpdir = get_tmpdir($config);
|
|
| 493 | - my $old_cwd = getcwd;
|
|
| 494 | - chdir $martools_tmpdir;
|
|
| 495 | - my (undef, undef, $exit) = capture {
|
|
| 496 | - system('unzip', $marzip);
|
|
| 497 | - };
|
|
| 498 | - chdir $old_cwd;
|
|
| 499 | - exit_error "Error extracting $marzip" if $exit;
|
|
| 500 | - $ENV{PATH} = "$martools_tmpdir/mar-tools:$initPATH";
|
|
| 501 | - if ($initLD_LIBRARY_PATH) {
|
|
| 502 | - $ENV{LD_LIBRARY_PATH} = "$initLD_LIBRARY_PATH:$martools_tmpdir/mar-tools";
|
|
| 503 | - } else {
|
|
| 504 | - $ENV{LD_LIBRARY_PATH} = "$martools_tmpdir/mar-tools";
|
|
| 505 | - }
|
|
| 506 | -}
|
|
| 507 | - |
|
| 508 | 489 | sub log_step {
|
| 509 | 490 | my ($url, $step, $status, $details) = @_;
|
| 510 | 491 | state $u;
|
| ... | ... | @@ -673,9 +654,9 @@ my %actions = ( |
| 673 | 654 | },
|
| 674 | 655 | gen_incrementals => sub {
|
| 675 | 656 | my ($config) = @_;
|
| 657 | + setup_martools;
|
|
| 676 | 658 | foreach my $channel (@ARGV) {
|
| 677 | 659 | my ($version) = channel_to_version($config, $channel);
|
| 678 | - extract_martools($config, $version);
|
|
| 679 | 660 | get_version_files($config, $version);
|
| 680 | 661 | create_incremental_mars_for_version($config, $version, $channel);
|
| 681 | 662 | }
|