| ... | ... | @@ -8,7 +8,7 @@ distdir=/var/tmp/dist/[% project %] | 
| 8 | 8 |  mkdir -p /var/tmp/build
 | 
| 9 | 9 |  mkdir -p [% dest_dir _ '/' _ c('filename') %]
 | 
| 10 | 10 |  
 | 
| 11 |  | -[% IF c("var/windows") %]
 | 
|  | 11 | +[% IF c("var/windows") -%]
 | 
| 12 | 12 |    # Setting up fxc2
 | 
| 13 | 13 |    tar -C /var/tmp/dist -xf [% c('input_files_by_name/fxc2') %]
 | 
| 14 | 14 |    export PATH="/var/tmp/dist/fxc2/bin:$PATH"
 | 
| ... | ... | @@ -20,7 +20,7 @@ tar -C /var/tmp/dist -xf [% c('input_files_by_name/nasm') %] | 
| 20 | 20 |  tar -C /var/tmp/dist -xf [% c('input_files_by_name/node') %]
 | 
| 21 | 21 |  export PATH="/var/tmp/dist/rust/bin:/var/tmp/dist/cbindgen:/var/tmp/dist/nasm/bin:/var/tmp/dist/node/bin:$PATH"
 | 
| 22 | 22 |  
 | 
| 23 |  | -[% IF c("var/linux") %]
 | 
|  | 23 | +[% IF c("var/linux") -%]
 | 
| 24 | 24 |    tar -C /var/tmp/dist -xf [% c('input_files_by_name/clang') %]
 | 
| 25 | 25 |    tar -C /var/tmp/dist -xf [% c('input_files_by_name/python') %]
 | 
| 26 | 26 |    export PATH="/var/tmp/dist/python/bin:$PATH"
 | 
| ... | ... | @@ -30,7 +30,7 @@ export PATH="/var/tmp/dist/rust/bin:/var/tmp/dist/cbindgen:/var/tmp/dist/nasm/bi | 
| 30 | 30 |    [% IF ! c("var/asan") -%]
 | 
| 31 | 31 |      export PATH="/var/tmp/dist/clang/bin:$PATH"
 | 
| 32 | 32 |    [% END -%]
 | 
| 33 |  | -  [% IF c("var/linux-i686") %]
 | 
|  | 33 | +  [% IF c("var/linux-i686") -%]
 | 
| 34 | 34 |      # Exporting `PKG_CONFIG_PATH` in the mozconfig file is causing build
 | 
| 35 | 35 |      # breakage in Rust code. It seems that environment variable is not passed
 | 
| 36 | 36 |      # down properly in that case. Thus, we set it here in the build script.
 | 
| ... | ... | @@ -72,7 +72,7 @@ MOZCONFIG_EOF | 
| 72 | 72 |  
 | 
| 73 | 73 |  [% c("var/set_MOZ_BUILD_DATE") %]
 | 
| 74 | 74 |  
 | 
| 75 |  | -[% IF c("var/windows") %]
 | 
|  | 75 | +[% IF c("var/windows") -%]
 | 
| 76 | 76 |    # Make sure widl is not inserting random timestamps, see #21837.
 | 
| 77 | 77 |    export WIDL_TIME_OVERRIDE="0"
 | 
| 78 | 78 |    patch -p1 < $rootdir/nsis-uninstall.patch
 | 
| ... | ... | @@ -80,15 +80,15 @@ MOZCONFIG_EOF | 
| 80 | 80 |    export LDFLAGS="[% c('var/flag_noSEH') %]"
 | 
| 81 | 81 |  [% END -%]
 | 
| 82 | 82 |  
 | 
| 83 |  | -[% IF c("var/namecoin") %]
 | 
|  | 83 | +[% IF c("var/namecoin") -%]
 | 
| 84 | 84 |    patch -p1 < $rootdir/namecoin-etld.patch
 | 
| 85 | 85 |  [% END -%]
 | 
| 86 | 86 |  
 | 
| 87 |  | -[% IF c("var/namecoin") %]
 | 
|  | 87 | +[% IF c("var/namecoin") -%]
 | 
| 88 | 88 |    pushd toolkit/torbutton
 | 
| 89 | 89 |    patch -p1 < $rootdir/namecoin-torbutton.patch
 | 
| 90 | 90 |    popd
 | 
| 91 |  | -[% END %]
 | 
|  | 91 | +[% END -%]
 | 
| 92 | 92 |  
 | 
| 93 | 93 |  [% IF c("var/override_updater_url") -%]
 | 
| 94 | 94 |    sed -i 's|^URL="" c("var/override_updater_url") %]|' build/application.ini.in
 | 
| ... | ... | @@ -166,23 +166,21 @@ export LANG=C.UTF-8 | 
| 166 | 166 |  ./mach configure \
 | 
| 167 | 167 |    --with-distribution-id=org.torproject \
 | 
| 168 | 168 |    --with-base-browser-version=[% c("var/torbrowser_version") %] \
 | 
| 169 |  | -  [% IF c("var/updater_enabled") -%]
 | 
| 170 |  | -        --enable-update-channel=[% c("var/channel") %] \
 | 
| 171 |  | -  [% END %] \
 | 
|  | 169 | +  [% IF c("var/updater_enabled") -%]--enable-update-channel=[% c("var/channel") %][% END %] \
 | 
| 172 | 170 |    [% IF !c("var/base-browser") -%]--with-branding=browser/branding/[% c("var/branding_directory_prefix") %]-[% c("var/channel") %][% END %] \
 | 
| 173 | 171 |    [% IF !c("var/rlbox") -%]--without-wasm-sandboxed-libraries[% END %]
 | 
| 174 | 172 |  
 | 
| 175 | 173 |  ./mach build --verbose
 | 
| 176 |  | -[% IF c("var/has_l10n") %]
 | 
|  | 174 | +[% IF c("var/has_l10n") -%]
 | 
| 177 | 175 |    export MOZ_CHROME_MULTILOCALE="$supported_locales"
 | 
| 178 | 176 |    # No quotes on purpose, see https://firefox-source-docs.mozilla.org/build/buildsystem/locales.html#instructions-for-multi-locale-builds
 | 
| 179 | 177 |    ./mach package-multi-locale --locales en-US $MOZ_CHROME_MULTILOCALE
 | 
| 180 | 178 |    AB_CD=multi ./mach build stage-package
 | 
| 181 |  | -[% ELSE %]
 | 
|  | 179 | +[% ELSE -%]
 | 
| 182 | 180 |    ./mach build stage-package
 | 
| 183 |  | -[% END %]
 | 
|  | 181 | +[% END -%]
 | 
| 184 | 182 |  
 | 
| 185 |  | -[% IF c("var/macos") %]
 | 
|  | 183 | +[% IF c("var/macos") -%]
 | 
| 186 | 184 |    cp -a obj-*/dist/[% c('var/exe_name') %]/* $distdir
 | 
| 187 | 185 |    [% IF c("var/base-browser") -%]
 | 
| 188 | 186 |      mv "$distdir/Firefox.app" "$distdir/[% c('var/Project_Name') %].app"
 | 
| ... | ... | @@ -198,13 +196,17 @@ export LANG=C.UTF-8 | 
| 198 | 196 |      '[% c("var/torbrowser_version") %]' \
 | 
| 199 | 197 |      '[% c("var/copyright_year") %]' \
 | 
| 200 | 198 |      [% IF c("var/mullvad-browser") -%]'Mullvad, Tor Browser and Mozilla Developers'[% ELSE -%]'The Tor Project'[% END %]
 | 
| 201 |  | -[% END %]
 | 
|  | 199 | +[% END -%]
 | 
| 202 | 200 |  
 | 
| 203 |  | -[% IF c("var/linux") %]
 | 
| 204 |  | -  [% IF c("var/linux-x86_64") && !c("var/asan") %]
 | 
|  | 201 | +[% IF c("var/linux") -%]
 | 
|  | 202 | +  [% IF c("var/linux-x86_64") && !c("var/asan") -%]
 | 
| 205 | 203 |      cp obj-*/x86_64-unknown-linux-gnu/release/geckodriver $distdir
 | 
| 206 |  | -  [% END %]
 | 
|  | 204 | +  [% END -%]
 | 
| 207 | 205 |    cp -a obj-*/dist/[% c('var/exe_name') %]/* $distdir/Browser/
 | 
|  | 206 | +  mkdir -p $distdir/Debug
 | 
|  | 207 | +  # Some include files are symlinks, so use -Lr, or the tarball will fail
 | 
|  | 208 | +  # silently. Also, on Linux we populate the debug symbols by stripping later.
 | 
|  | 209 | +  cp -Lr obj-*/dist/include $distdir/Debug/
 | 
| 208 | 210 |    # Remove firefox-bin (we don't use it, see ticket #10126)
 | 
| 209 | 211 |    rm -f "$distdir/Browser/[% c('var/exe_name') %]-bin"
 | 
| 210 | 212 |    # TODO: There goes FIPS-140.. We could upload these somewhere unique and
 | 
| ... | ... | @@ -217,16 +219,21 @@ export LANG=C.UTF-8 | 
| 217 | 219 |  [% INCLUDE 'start-firefox' -%]
 | 
| 218 | 220 |  RBM_TB_EOF
 | 
| 219 | 221 |    chmod 755 "$distdir/Browser/[% c('var/exe_name') %]"
 | 
| 220 |  | -[% END %]
 | 
|  | 222 | +[% END -%]
 | 
| 221 | 223 |  
 | 
| 222 |  | -[% IF c("var/windows") %]
 | 
|  | 224 | +[% IF c("var/windows") -%]
 | 
| 223 | 225 |    cp -a obj-*/dist/[% c('var/exe_name') %]/* $distdir/Browser/
 | 
| 224 |  | -  [% IF c("var/windows-i686") %]
 | 
|  | 226 | +  [% IF c("var/windows-i686") -%]
 | 
| 225 | 227 |      cp -a /var/tmp/dist/fxc2/bin/d3dcompiler_47_32.dll $distdir/Browser/d3dcompiler_47.dll
 | 
| 226 |  | -  [% ELSE %]
 | 
|  | 228 | +  [% ELSE -%]
 | 
| 227 | 229 |      cp -a /var/tmp/dist/fxc2/bin/d3dcompiler_47.dll $distdir/Browser
 | 
| 228 |  | -  [% END %]
 | 
| 229 |  | -[% END %]
 | 
|  | 230 | +  [% END -%]
 | 
|  | 231 | +  mkdir -p $distdir/Debug/Browser
 | 
|  | 232 | +  pushd obj-*
 | 
|  | 233 | +  cp -Lr dist/include $distdir/Debug/
 | 
|  | 234 | +  find . \( -path ./dist -o -path ./_tests \) -prune -o -name '*.pdb' -exec cp -l {} $distdir/Debug/Browser/ \;
 | 
|  | 235 | +  popd
 | 
|  | 236 | +[% END -%]
 | 
| 230 | 237 |  
 | 
| 231 | 238 |  [% IF c("var/updater_enabled") -%]
 | 
| 232 | 239 |    # Make MAR-based update tools available for use during the bundle phase.
 | 
| ... | ... | @@ -240,23 +247,23 @@ RBM_TB_EOF | 
| 240 | 247 |    cp -p tools/update-packaging/*.sh $MARTOOLS/
 | 
| 241 | 248 |    cp -p obj-*/dist/host/bin/mar $MARTOOLS/
 | 
| 242 | 249 |    cp -p obj-*/dist/host/bin/mbsdiff $MARTOOLS/
 | 
| 243 |  | -  [% IF c("var/linux") || c("var/macos") %]
 | 
|  | 250 | +  [% IF c("var/linux") || c("var/macos") -%]
 | 
| 244 | 251 |      cp -p obj-*/dist/bin/signmar $MARTOOLS/
 | 
| 245 | 252 |      cp -p obj-*/dist/bin/certutil $MARTOOLS/
 | 
| 246 | 253 |      cp -p obj-*/dist/bin/pk12util $MARTOOLS/
 | 
| 247 |  | -    [% IF c("var/linux") %]
 | 
|  | 254 | +    [% IF c("var/linux") -%]
 | 
| 248 | 255 |        NSS_LIBS="libfreeblpriv3.so libmozsqlite3.so libnss3.so libnssckbi.so libnssutil3.so libsmime3.so libsoftokn3.so libssl3.so"
 | 
| 249 | 256 |        NSPR_LIBS="libnspr4.so libplc4.so libplds4.so"
 | 
| 250 |  | -    [% ELSE %]
 | 
|  | 257 | +    [% ELSE -%]
 | 
| 251 | 258 |        NSS_LIBS="libfreebl3.dylib libmozglue.dylib libnss3.dylib libnssckbi.dylib libsoftokn3.dylib"
 | 
| 252 | 259 |        # No NSPR_LIBS for macOS
 | 
| 253 | 260 |        NSPR_LIBS=""
 | 
| 254 |  | -    [% END %]
 | 
|  | 261 | +    [% END -%]
 | 
| 255 | 262 |      for LIB in $NSS_LIBS $NSPR_LIBS; do
 | 
| 256 | 263 |        cp -p obj-*/dist/bin/$LIB $MARTOOLS/
 | 
| 257 | 264 |      done
 | 
| 258 |  | -  [% END %]
 | 
| 259 |  | -  [% IF c("var/windows") %]
 | 
|  | 265 | +  [% END -%]
 | 
|  | 266 | +  [% IF c("var/windows") -%]
 | 
| 260 | 267 |      cp -p obj-*/dist/bin/signmar.exe $MARTOOLS/
 | 
| 261 | 268 |      cp -p obj-*/dist/bin/certutil.exe $MARTOOLS/
 | 
| 262 | 269 |      cp -p obj-*/dist/bin/pk12util.exe $MARTOOLS/
 | 
| ... | ... | @@ -264,38 +271,38 @@ RBM_TB_EOF | 
| 264 | 271 |      for LIB in $NSS_LIBS; do
 | 
| 265 | 272 |          cp -p obj-*/dist/bin/$LIB $MARTOOLS/
 | 
| 266 | 273 |      done
 | 
| 267 |  | -  [% END %]
 | 
|  | 274 | +  [% END -%]
 | 
| 268 | 275 |  [% END -%]
 | 
| 269 | 276 |  
 | 
| 270 | 277 |  cd $distdir
 | 
| 271 | 278 |  
 | 
| 272 |  | -[% IF c("var/linux-x86_64") %]
 | 
| 273 |  | -  [% IF !c("var/asan") %]
 | 
|  | 279 | +[% IF c("var/linux") -%]
 | 
|  | 280 | +  [% IF c("var/linux-x86_64") && !c("var/asan") -%]
 | 
| 274 | 281 |      # No need for an unstripped geckodriver
 | 
| 275 | 282 |      strip geckodriver
 | 
| 276 |  | -  [% END %]
 | 
|  | 283 | +  [% END -%]
 | 
| 277 | 284 |    mkdir -p $distdir/Debug/Browser
 | 
| 278 | 285 |    # Strip and generate debuginfo for the firefox binary that we keep, all *.so
 | 
| 279 | 286 |    # files, the plugin-container, and the updater (see ticket #10126)
 | 
| 280 | 287 |    for LIB in Browser/*.so "Browser/[% c('var/exe_name') %].real" Browser/plugin-container [% IF c("var/updater_enabled") -%]Browser/updater[% END %]
 | 
| 281 | 288 |    do
 | 
| 282 |  | -      objcopy --only-keep-debug $LIB Debug/$LIB
 | 
| 283 |  | -      strip $LIB
 | 
| 284 |  | -      objcopy --add-gnu-debuglink=./Debug/$LIB $LIB
 | 
|  | 289 | +    objcopy --only-keep-debug $LIB Debug/$LIB
 | 
|  | 290 | +    strip $LIB
 | 
|  | 291 | +    objcopy --add-gnu-debuglink=./Debug/$LIB $LIB
 | 
| 285 | 292 |    done
 | 
| 286 |  | -[% END %]
 | 
|  | 293 | +[% END -%]
 | 
| 287 | 294 |  
 | 
| 288 | 295 |  # Re-zipping the omni.ja files is not needed to make them reproductible,
 | 
| 289 | 296 |  # however if we don't re-zip them, the files become corrupt when we
 | 
| 290 | 297 |  # update them using 'zip' and firefox will silently fail to load some
 | 
| 291 | 298 |  # parts.
 | 
| 292 |  | -[% IF c("var/windows") || c("var/linux") %]
 | 
|  | 299 | +[% IF c("var/windows") || c("var/linux") -%]
 | 
| 293 | 300 |    [% c("var/rezip", { rezip_file => 'Browser/omni.ja' }) %]
 | 
| 294 | 301 |    [% c("var/rezip", { rezip_file => 'Browser/browser/omni.ja' }) %]
 | 
| 295 |  | -[% ELSIF c("var/macos") %]
 | 
|  | 302 | +[% ELSIF c("var/macos") -%]
 | 
| 296 | 303 |    [% c("var/rezip", { rezip_file => '"' _ c("var/Project_Name") _ '.app/Contents/Resources/omni.ja"' }) %]
 | 
| 297 | 304 |    [% c("var/rezip", { rezip_file => '"' _ c("var/Project_Name") _ '.app/Contents/Resources/browser/omni.ja"' }) %]
 | 
| 298 |  | -[% END %]
 | 
|  | 305 | +[% END -%]
 | 
| 299 | 306 |  
 | 
| 300 | 307 |  [%
 | 
| 301 | 308 |  IF c("var/macos");
 | 
| ... | ... | @@ -305,9 +312,9 @@ ELSE; | 
| 305 | 312 |  END;
 | 
| 306 | 313 |  %]
 | 
| 307 | 314 |  
 | 
| 308 |  | -[% IF c("var/linux") %]
 | 
|  | 315 | +[% IF c("var/linux") -%]
 | 
| 309 | 316 |    /var/tmp/dist/gcc/bin/g++ $rootdir/abicheck.cc -o Browser/abicheck -std=c++17
 | 
| 310 |  | -  [% IF !c("var/torbrowser") %]
 | 
|  | 317 | +  [% IF !c("var/torbrowser") -%]
 | 
| 311 | 318 |      libdest=Browser/libstdc++
 | 
| 312 | 319 |      mkdir -p "$libdest"
 | 
| 313 | 320 |      # FIXME: tor-browser-build#40749
 | 
| ... | ... | @@ -316,32 +323,37 @@ END; | 
| 316 | 323 |        cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libasan.so.* "$libdest"
 | 
| 317 | 324 |        cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libubsan.so.* "$libdest"
 | 
| 318 | 325 |      [% END -%]
 | 
| 319 |  | -  [% END %]
 | 
| 320 |  | -[% END %]
 | 
|  | 326 | +  [% END -%]
 | 
|  | 327 | +[% END -%]
 | 
| 321 | 328 |  
 | 
| 322 | 329 |  [% c('tar', {
 | 
| 323 | 330 |          tar_src => [ browserdir ],
 | 
| 324 | 331 |          tar_args => '-caf ' _ dest_dir _ '/' _ c('filename') _ '/browser.tar.' _ c('compress_tar'),
 | 
| 325 | 332 |      }) %]
 | 
| 326 | 333 |  
 | 
| 327 |  | -[% IF c("var/linux-x86_64") %]
 | 
| 328 |  | -[% c('tar', {
 | 
| 329 |  | -        tar_src => [ 'Debug' ],
 | 
| 330 |  | -        tar_args => '-cJf ' _ dest_dir _ '/' _ c('filename') _ '/browser-debug.tar.xz',
 | 
|  | 334 | +[% IF c("var/linux") -%]
 | 
|  | 335 | +  [% c('tar', {
 | 
|  | 336 | +      tar_src => [ 'Debug' ],
 | 
|  | 337 | +      tar_args => '-cJf ' _ dest_dir _ '/' _ c('filename') _ '/browser-debug.tar.xz',
 | 
| 331 | 338 |      }) %]
 | 
| 332 |  | -  [% IF !c("var/asan") %]
 | 
|  | 339 | +  [% IF c("var/linux-x86_64") && !c("var/asan") -%]
 | 
| 333 | 340 |      [% c('tar', {
 | 
| 334 |  | -            tar_src => [ 'geckodriver' ],
 | 
| 335 |  | -            tar_args => '-cJf ' _ dest_dir _ '/' _ c('filename') _ '/geckodriver-linux64.tar.xz',
 | 
| 336 |  | -        }) %]
 | 
| 337 |  | -  [% END %]
 | 
| 338 |  | -[% END %]
 | 
|  | 341 | +        tar_src => [ 'geckodriver' ],
 | 
|  | 342 | +        tar_args => '-cJf ' _ dest_dir _ '/' _ c('filename') _ '/geckodriver.tar.xz',
 | 
|  | 343 | +      }) %]
 | 
|  | 344 | +  [% END -%]
 | 
|  | 345 | +[% ELSIF c("var/windows") -%]
 | 
|  | 346 | +  [% c('zip', {
 | 
|  | 347 | +      zip_src => [ 'Debug' ],
 | 
|  | 348 | +      zip_args => dest_dir _ '/' _ c('filename') _ '/browser-debug.zip',
 | 
|  | 349 | +    }) %]
 | 
|  | 350 | +[% END -%]
 | 
| 339 | 351 |  
 | 
| 340 | 352 |  [% IF c("var/updater_enabled") -%]
 | 
| 341 | 353 |    [% c('zip', {
 | 
| 342 |  | -          zip_src => [ 'mar-tools' ],
 | 
| 343 |  | -          zip_args => dest_dir _ '/' _ c('filename') _ '/' _ c('var/martools_filename'),
 | 
| 344 |  | -      }) %]
 | 
|  | 354 | +      zip_src => [ 'mar-tools' ],
 | 
|  | 355 | +      zip_args => dest_dir _ '/' _ c('filename') _ '/' _ c('var/martools_filename'),
 | 
|  | 356 | +    }) %]
 | 
| 345 | 357 |  [% END -%]
 | 
| 346 | 358 |  
 | 
| 347 | 359 |  [% IF c("var/build_infos_json") -%]
 |