[tbb-commits] [Git][tpo/applications/tor-browser-build][main] Bug 40829: Standardize naming scheme for browser installer/package artifacts

richard (@richard) git at gitlab.torproject.org
Mon Aug 21 17:20:28 UTC 2023



richard pushed to branch main at The Tor Project / Applications / tor-browser-build


Commits:
9f201283 by Nicolas Vigier at 2023-08-17T23:28:23+00:00
Bug 40829: Standardize naming scheme for browser installer/package artifacts

- - - - -


12 changed files:

- projects/browser/build
- projects/browser/build.android
- projects/browser/config
- projects/firefox/build
- projects/firefox/config
- projects/release/dmg2mar
- projects/release/update_responses_config.yml
- projects/tor-expert-bundle/config
- tools/dmg2mar
- tools/signing/linux-signer-sign-android-apks
- tools/signing/nightly/sign-nightly
- tools/update-responses/update_responses


Changes:

=====================================
projects/browser/build
=====================================
@@ -374,12 +374,12 @@ cd $distdir
   [% END -%]
   [% c('tar', {
         tar_src => [ '$PKG_DIR' ],
-        tar_args => '-cJf $OUTDIR/' _ c("var/project-name") _ '-' _ c("var/mar_osname") _ '-' _ c("var/torbrowser_version") _ '_${PKG_LOCALE}.tar.xz',
+        tar_args => '-cJf $OUTDIR/' _ c("var/project-name") _ '-' _ c("var/osname") _ '-' _ c("var/torbrowser_version") _ '.tar.xz',
     }) %]
 [% ELSIF c("var/macos") %]
   [% c('var/ddmg', {
         dmg_src => '"$PKG_DIR"',
-        dmg_out => '$OUTDIR/' _ c('var/ProjectName') _ '-' _ c("var/torbrowser_version") _ '-' _ c("var/mar_osname") _ '_${PKG_LOCALE}.dmg',
+        dmg_out => '$OUTDIR/' _ c('var/project-name') _ '-' _ c("var/mar_osname") _ '-' _ c("var/torbrowser_version") _ '.dmg',
     }) %]
 [% ELSIF c("var/windows") %]
   find "$PKG_DIR" -exec [% c("touch") %] {} \;
@@ -387,11 +387,11 @@ cd $distdir
   makensis browser-portable.nsi
   # Working around NSIS braindamage
   python3 $rootdir/pe_checksum_fix.py browser-install.exe
-  mv browser-install.exe $OUTDIR/[% c("var/projectname") %]-install[% IF c("var/windows-x86_64") %]-win64[% END %]-[% c("var/torbrowser_version") %]_${PKG_LOCALE}.exe
+  mv browser-install.exe $OUTDIR/[% c("var/project-name") %]-portable-[% c("var/osname") %]-[% c("var/torbrowser_version") %].exe
   [% IF c('var/mullvad-browser') -%]
     makensis browser-system.nsi
     python3 $rootdir/pe_checksum_fix.py browser-install.exe
-    mv browser-install.exe $OUTDIR/[% c("var/projectname") %]-systeminstall[% IF c("var/windows-x86_64") %]-win64[% END %]-[% c("var/torbrowser_version") %]_${PKG_LOCALE}.exe
+    mv browser-install.exe $OUTDIR/[% c("var/project-name") %]-install-[% c("var/osname") %]-[% c("var/torbrowser_version") %].exe
   [% END -%]
   popd
 [% END %]
@@ -402,12 +402,12 @@ SCRIPT_EOF
   cp $rootdir/[% c('input_files_by_name/firefox') %]/mar-tools-*.zip "$OUTDIR"/
 [% END -%]
 [% IF c("var/linux") -%]
-  cp $rootdir/[% c('input_files_by_name/firefox') %]/browser-debug.tar.xz "$OUTDIR/[% c('var/project-name') %]-[% c('var/mar_osname') %]-debug.tar.xz"
+  cp $rootdir/[% c('input_files_by_name/firefox') %]/browser-debug-symbols.tar.xz "$OUTDIR/[% c('var/project-name') %]-debug-symbols-[% c('var/mar_osname') %]-[% c('var/torbrowser_version') %].tar.xz"
   [% IF c("var/linux-x86_64") && !c("var/asan") -%]
-    cp $rootdir/[% c('input_files_by_name/firefox') %]/geckodriver.tar.xz "$OUTDIR/geckodriver-[% c('var/mar_osname') %].tar.xz"
+    cp $rootdir/[% c('input_files_by_name/firefox') %]/geckodriver.tar.xz "$OUTDIR/geckodriver-[% c('var/mar_osname') %]-[% c('var/torbrowser_version') %].tar.xz"
   [% END -%]
 [% ELSIF c("var/windows") -%]
-  cp $rootdir/[% c('input_files_by_name/firefox') %]/browser-debug.zip "$OUTDIR/[% c('var/project-name') %]-[% c('var/mar_osname') %]-debug.zip"
+  cp $rootdir/[% c('input_files_by_name/firefox') %]/browser-debug-symbols.zip "$OUTDIR/[% c('var/project-name') %]-debug-symbols-[% c('var/mar_osname') %]-[% c('var/torbrowser_version') %].zip"
 [% END -%]
 [%IF c("var/tor-browser") -%]
   tor_expert_bundle_src="[% c("input_files_by_name/tor-expert-bundle") %]"


=====================================
projects/browser/build.android
=====================================
@@ -6,7 +6,7 @@ tar -xf $rootdir/[% c('input_files_by_name/firefox-android') %]
 
 assets_dir=assets
 ext_dir=$assets_dir/extensions
-qa_apk=[% dest_dir %]/[% c('filename') %]/[% c("var/project-name") %]-[% c("version") %]-[% c("var/osname") %]-multi-qa.apk
+qa_apk=[% dest_dir %]/[% c('filename') %]/[% c("var/project-name") %]-qa-[% c("var/osname") %]-[% c("version") %].apk
 apk=$rootdir/firefox-android/*-[% c("var/abi") %]-*.apk
 
 # tor-browser-build#40920


=====================================
projects/browser/config
=====================================
@@ -11,6 +11,7 @@ var:
     - libparallel-forkmanager-perl
     - libfile-slurp-perl
     - bzip2
+  mar_osname: '[% c("var/osname") %]'
 
 targets:
   linux:
@@ -20,12 +21,6 @@ targets:
         # builds (bug 29812). We don't need it in x86_64 builds, but we
         # share the container to reduce space used.
         - libc6-i386
-  linux-i686:
-    var:
-      mar_osname: linux32
-  linux-x86_64:
-    var:
-      mar_osname: linux64
   macos:
     var:
       arch_deps:
@@ -37,22 +32,10 @@ targets:
   macos-universal:
     var:
       mar_osname: macos
-  macos-aarch64:
-    var:
-      mar_osname: macos-aarch64
-  macos-x86_64:
-    var:
-      mar_osname: macos-x86_64
   windows:
     var:
       arch_deps:
         - python3-pefile
-  windows-i686:
-    var:
-      mar_osname: win32
-  windows-x86_64:
-    var:
-      mar_osname: win64
   android:
     build: '[% INCLUDE build.android %]'
     var:


=====================================
projects/firefox/build
=====================================
@@ -331,7 +331,7 @@ END;
 [% IF c("var/linux") -%]
   [% c('tar', {
       tar_src => [ 'Debug' ],
-      tar_args => '-cJf ' _ dest_dir _ '/' _ c('filename') _ '/browser-debug.tar.xz',
+      tar_args => '-cJf ' _ dest_dir _ '/' _ c('filename') _ '/browser-debug-symbols.tar.xz',
     }) %]
   [% IF c("var/linux-x86_64") && !c("var/asan") -%]
     [% c('tar', {
@@ -342,14 +342,14 @@ END;
 [% ELSIF c("var/windows") -%]
   [% c('zip', {
       zip_src => [ 'Debug' ],
-      zip_args => dest_dir _ '/' _ c('filename') _ '/browser-debug.zip',
+      zip_args => dest_dir _ '/' _ c('filename') _ '/browser-debug-symbols.zip',
     }) %]
 [% END -%]
 
 [% IF c("var/updater_enabled") -%]
   [% c('zip', {
       zip_src => [ 'mar-tools' ],
-      zip_args => dest_dir _ '/' _ c('filename') _ '/' _ c('var/martools_filename'),
+      zip_args => dest_dir _ '/' _ c('filename') _ '/' _ 'mar-tools-' _ c("var/osname") _ '-' _ c("var/torbrowser_version") _ '.zip',
     }) %]
 [% END -%]
 


=====================================
projects/firefox/config
=====================================
@@ -90,7 +90,6 @@ targets:
 
   linux-x86_64:
     var:
-      martools_filename: mar-tools-linux64.zip
       arch_deps:
         - libgtk2.0-dev
         - libgtk-3-dev
@@ -108,7 +107,6 @@ targets:
 
   linux-i686:
     var:
-      martools_filename: mar-tools-linux32.zip
       sort_deps: 0
       arch_deps:
         - libgtk2.0-dev:i386
@@ -127,7 +125,6 @@ targets:
 
   macos:
     var:
-      martools_filename: 'mar-tools-macos-[% c("var/macos_arch") %].zip'
       nightly_updates_publish_dir: '[% c("var/nightly_updates_publish_dir_prefix") %]nightly-macos'
       arch_deps:
         - python3
@@ -141,14 +138,6 @@ targets:
         - python3-distutils
         - wine
 
-  windows-i686:
-    var:
-      martools_filename: mar-tools-win32.zip
-
-  windows-x86_64:
-    var:
-      martools_filename: mar-tools-win64.zip
-
 input_files:
   - project: container-image
   - name: '[% c("var/compiler") %]'


=====================================
projects/release/dmg2mar
=====================================
@@ -3,6 +3,6 @@
 cd [% shell_quote(path(dest_dir)) %]/[% c("var/signed_status") %]/[%  c("version") %]
 
 export TOR_APPNAME_BUNDLE_OSX='[% c("var/Project_Name") -%]'
-export TOR_APPNAME_DMGFILE='[% c("var/ProjectName") -%]'
+export TOR_APPNAME_DMGFILE='[% c("var/project-name") -%]'
 export TOR_APPNAME_MARFILE='[% c("var/project-name") -%]'
 [% shell_quote(c("basedir")) %]/tools/dmg2mar [% c("var/mar_channel_id") %]


=====================================
projects/release/update_responses_config.yml
=====================================
@@ -2,6 +2,7 @@
 tmp_dir: '[% c("tmp_dir") %]'
 create_downloads_json: 1
 appname_marfile: '[% c("var/project-name") %]'
+appname_bundle: '[% c("var/project-name") %]'
 appname_bundle_android: '[% c("var/project-name") %]'
 appname_bundle_macos: '[% c("var/ProjectName") %]'
 appname_bundle_linux: '[% c("var/project-name") %]'
@@ -20,13 +21,13 @@ download:
     mars_url: 'https://cdn.mullvad.net/browser'
 [% END -%]
 build_targets:
-    linux32: Linux_x86-gcc3
-    linux64: Linux_x86_64-gcc3
-    win32:
+    linux-i686: Linux_x86-gcc3
+    linux-x86_64: Linux_x86_64-gcc3
+    windows-i686:
         - WINNT_x86-gcc3
         - WINNT_x86-gcc3-x86
         - WINNT_x86-gcc3-x64
-    win64: WINNT_x86_64-gcc3-x64
+    windows-x86_64: WINNT_x86_64-gcc3-x64
     macos:
       - Darwin_x86_64-gcc3
       - Darwin_aarch64-gcc3
@@ -59,17 +60,17 @@ versions:
             # macOS v10.12.0
             minSupportedOSVersion: 16.0.0
         # minSupportedOsVersion on Windows corresponds to the operating system version ( https://docs.microsoft.com/en-us/windows/win32/sysinfo/operating-system-version )
-        win32:
+        windows-i686:
             # Windows 7
             minSupportedOSVersion: 6.1
             minSupportedInstructionSet: SSE2
-        win64:
+        windows-x86_64:
             # Windows 7
             minSupportedOSVersion: 6.1
             minSupportedInstructionSet: SSE2
-        linux32:
+        linux-i686:
             minSupportedInstructionSet: SSE2
-        linux64:
+        linux-x86_64:
             minSupportedInstructionSet: SSE2
 mar_compression: xz
 tag: 'tbb-[% c("var/torbrowser_version") %]-[% c("var/torbrowser_build") %]'


=====================================
projects/tor-expert-bundle/config
=====================================
@@ -1,5 +1,5 @@
 # vim: filetype=yaml sw=2
-filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
+filename: '[% project %]-[% c("var/osname") %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
 version: '[% c("var/torbrowser_version") %]'
 
 container:


=====================================
tools/dmg2mar
=====================================
@@ -39,7 +39,7 @@ use Cwd;
 # set the application name in the TOR_APPNAME_BUNDLE_OSX,
 # TOR_APPNAME_DMGFILE and TOR_APPNAME_MARFILE environment variables
 my $appname = $ENV{TOR_APPNAME_BUNDLE_OSX} // 'Tor Browser';
-my $appname_dmg = $ENV{TOR_APPNAME_DMGFILE} // 'TorBrowser';
+my $appname_dmg = $ENV{TOR_APPNAME_DMGFILE} // 'tor-browser';
 my $appname_mar = $ENV{TOR_APPNAME_MARFILE} // 'tor-browser';
 
 sub exit_error {
@@ -53,10 +53,10 @@ sub osname {
     my ($arch) = capture_exec('uname', '-m');
     chomp($osname, $arch);
     if ($osname eq 'Linux' && $arch eq 'x86_64') {
-        return 'linux64';
+        return 'linux-x86_64';
     }
     if ($osname eq 'Linux' && $arch =~ m/^i.86$/) {
-        return 'linux32';
+        return 'linux-i686';
     }
     exit_error 'Unknown OS';
 }
@@ -64,7 +64,8 @@ sub osname {
 my $martools_tmpdir;
 sub extract_martools {
     my $osname = osname;
-    my $marzip = getcwd . "/mar-tools-$osname.zip";
+    my $marzip = glob(getcwd . "/mar-tools-$osname-*.zip");
+    exit_error "Could not find mar-tools zip" unless $marzip;
     $martools_tmpdir = File::Temp->newdir();
     my $old_cwd = getcwd;
     chdir $martools_tmpdir;
@@ -97,7 +98,7 @@ sub get_dmg_files_from_sha256sums {
         my (undef, $filename) = split '  ', $line;
         next unless $filename;
         chomp $filename;
-        next unless $filename =~ m/^$appname_dmg-(.+)-macos_(.+)\.dmg$/;
+        next unless $filename =~ m/^$appname_dmg-(.+)-macos\.dmg$/;
         push @files, { filename => $filename, version => $1, lang => $2 };
     }
     return @files;


=====================================
tools/signing/linux-signer-sign-android-apks
=====================================
@@ -73,8 +73,8 @@ cd ~/"$SIGNING_PROJECTNAME-$tbb_version-apks"
 
 # Sign all packages
 for arch in ${ARCHS}; do
-  qa_apk=${projname}-${tbb_version}-android-${arch}-multi-qa.apk
-  signed_apk=${projname}-${tbb_version}-android-${arch}-multi.apk
+  qa_apk=${projname}-qa-android-${arch}-${tbb_version}.apk
+  signed_apk=${projname}-android-${arch}-${tbb_version}.apk
   sign_apk "$qa_apk" "$signed_apk"
   verify_apk "$signed_apk"
   cp -f "$signed_apk" ~/"$SIGNING_PROJECTNAME-$tbb_version"


=====================================
tools/signing/nightly/sign-nightly
=====================================
@@ -192,11 +192,12 @@ sub fetch_version {
 }
 
 sub setup_martools {
-    my $martools_dir = "$FindBin::Bin/mar-tools-" . get_config('martools_version');
+    my $martools_version = get_config('martools_version');
+    my $martools_dir = "$FindBin::Bin/mar-tools-" . $martools_version;
     if (! -d $martools_dir) {
-        my $file = "mar-tools-linux64.zip";
-        my $url = join('/', get_config('martools_url'),
-                            get_config('martools_version'), $file);
+        my $martools_url = get_config('martools_url');
+        my $file = "mar-tools-linux-x86_64-$martools_version.zip";
+        my $url = "$martools_url/$martools_version/$file";
         my $tmpdir = get_tmpdir();
         exit_error "Error downloading $url"
                 unless getstore($url, "$tmpdir/$file") == 200;


=====================================
tools/update-responses/update_responses
=====================================
@@ -132,19 +132,19 @@ sub get_version_downloads {
     opendir(my $d, $vdir) or exit_error "Error opening directory $vdir";
     foreach my $file (readdir $d) {
         next unless -f "$vdir/$file";
-        my ($os, $lang);
-        if ($file =~ m/^$config->{appname_bundle_macos}-$version-macos_(.+).dmg$/) {
-            ($os, $lang) = ('macos', $1);
-        } elsif ($file =~ m/^$config->{appname_bundle_linux}-(linux32|linux64)-${version}_(.+).tar.xz$/) {
-            ($os, $lang) = ($1, $2);
-        } elsif ($file =~ m/^$config->{appname_bundle_win64}-${version}_(.+).exe$/) {
-            ($os, $lang) = ('win64', $1);
-        } elsif ($file =~ m/^$config->{appname_bundle_win32}-${version}_(.+).exe$/) {
-            ($os, $lang) = ('win32', $1);
+        my $os;
+        if ($file =~ m/^$config->{appname_bundle}-macos-$version.dmg$/) {
+            $os = 'macos';
+        } elsif ($file =~ m/^$config->{appname_bundle}-(linux-i686|linux-x86_64)-${version}.tar.xz$/) {
+            $os = $1;
+        } elsif ($file =~ m/^$config->{appname_bundle}-windows-x86_64-${version}.exe$/) {
+            $os = 'win64';
+        } elsif ($file =~ m/^$config->{appname_bundle}-windows-i686-${version}.exe$/) {
+            $os = 'win32';
         } else {
             next;
         }
-        $downloads->{$os}{$lang} = {
+        $downloads->{$os}{ALL} = {
             binary => "$download_url/$file",
             sig => "$download_url/$file.asc",
         };
@@ -162,15 +162,13 @@ sub get_perplatform_downloads {
     foreach my $file (readdir $d) {
         next unless -f "$vdir/$file";
         my $os;
-        if ($file =~ m/^$config->{appname_bundle_macos}-$version-macos_(.+).dmg$/) {
+        if ($file =~ m/^$config->{appname_bundle}-macos-$version.dmg$/) {
           $os = 'macos';
-        } elsif ($file =~ m/^$config->{appname_bundle_linux}-(linux32|linux64)-${version}_(.+).tar.xz$/) {
-          $os = $1 eq 'linux64' ? 'linux-x86_64' : 'linux-i686';
-        } elsif ($file =~ m/^$config->{appname_bundle_win64}-${version}_(.+).exe$/) {
-          $os = 'windows-x86_64';
-        } elsif ($file =~ m/^$config->{appname_bundle_win32}-${version}_(.+).exe$/) {
-          $os = 'windows-i686';
-        } elsif ($file =~ m/^$config->{appname_bundle_android}-${version}-(android-armv7|android-x86|android-x86_64|android-aarch64)-multi.apk$/) {
+        } elsif ($file =~ m/^$config->{appname_bundle}-(linux-i686|linux-86_64)-${version}.tar.xz$/) {
+          $os = $1;
+        } elsif ($file =~ m/^$config->{appname_bundle}-(windows-i686|windows-86_64)-${version}.exe$/) {
+          $os = $1;
+        } elsif ($file =~ m/^$config->{appname_bundle}-(android-armv7|android-x86|android-x86_64|android-aarch64)-${version}.apk$/) {
           $os = $1;
         } else {
             next;
@@ -475,9 +473,11 @@ sub write_downloads_json {
 
 sub marzip_path {
     my ($config, $version) = @_;
-    for my $osname (qw/linux64 linux32 macos-x86_64 win64 win32/) {
-        my $marzip = version_dir($config, $version) . "/mar-tools-$osname.zip";
-        return $marzip if -f $marzip;
+    for my $osname (qw/linux-x86_64 linux-i686 macos-x86_64 windows-x86_64 windows-i686/) {
+        my $marzip = glob(version_dir($config, $version) . "/mar-tools-$osname-*.zip");
+        if ($marzip && -f $marzip) {
+          return $marzip;
+        }
     }
     exit_error 'Could not find mar-tools';
 }



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/9f201283811ec85c49ca81d27b728411e952a02b

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/9f201283811ec85c49ca81d27b728411e952a02b
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20230821/13d4a888/attachment-0001.htm>


More information about the tbb-commits mailing list