rbm.conf 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. # vim: filetype=yaml sw=2
  2. debug: '[% GET ! ENV.RBM_NO_DEBUG %]'
  3. output_dir: "out/[% project %]"
  4. tmp_dir: '[% c("basedir") %]/tmp'
  5. build_log: '[% GET ENV.RBM_LOGS_DIR ? ENV.RBM_LOGS_DIR : "logs" %]/[% project %][% IF c("var/osname") %]-[% c("var/osname") %][% END %].log'
  6. pkg_type: build
  7. container:
  8. disable_network:
  9. # disable network in the build scripts
  10. build: 1
  11. steps:
  12. src-tarballs:
  13. compress_tar: xz
  14. src-tarballs: |
  15. #!/bin/bash
  16. set -e
  17. mkdir -p '[% dest_dir %]'
  18. mv -vf '[% project %]-[% c("version") %].tar.xz' '[% dest_dir %]/[% c("filename") %]'
  19. list_toolchain_updates:
  20. build_log: '-'
  21. list_toolchain_updates: '[% INCLUDE list_toolchain_updates %]'
  22. cargo_vendor:
  23. output_dir: "out/[% project %]/cargo_vendor"
  24. var:
  25. container:
  26. suite: bullseye
  27. arch: amd64
  28. pre_pkginst: ''
  29. deps:
  30. - patch
  31. - bzip2
  32. cargo_vendor: |
  33. #!/bin/bash
  34. [% c("var/set_default_env") %]
  35. mkdir /var/tmp/dist
  36. # NOTE: since different projects need different rust versions,
  37. # we use the version of cargo produced by the rust project
  38. # build rather than the build container's debian package.
  39. # Thus, any project that wants to run a `cargo_vendor` step
  40. # must be sure to provide the rust project as an `input_file`.
  41. # See, e.g.,`application-services/config.steps.cargo_vendor.input_files`.
  42. tar -C /var/tmp/dist -xf [% c('input_files_by_name/rust') %]
  43. export PATH="/var/tmp/dist/rust/bin:$PATH"
  44. tar -xf [% project %]-[% c('version') %].tar.gz
  45. cd [% project %]-[% c('version') %]
  46. [% c("var/pre_cargo_vendor") %]
  47. cargo vendor vendor [% c("var/cargo_vendor_opts") %]
  48. [% c('tar', {
  49. tar_src => [ 'vendor' ],
  50. tar_args => '-caf ' _ dest_dir _ '/' _ c('filename'),
  51. }) %]
  52. cd [% dest_dir %]
  53. fname="out/[% project %]/cargo_vendor/[% c('filename') %]"
  54. echo
  55. echo "Finished creating $fname"
  56. sha256sum "[% c('filename') %]"
  57. echo "You can upload it with:"
  58. echo " scp -p $fname people.torproject.org:public_html/mirrors/sources"
  59. # buildconf contains build options that the user can change in rbm.local.conf
  60. # When adding a new option to buildconf, a default value should be defined
  61. # in var/build_id, so that changing this option does not affect the build_id.
  62. buildconf:
  63. git_signtag_opt: '-s'
  64. deb_native_arch: arm64
  65. var:
  66. torbrowser_version: '11.5.1'
  67. torbrowser_build: 'build1'
  68. torbrowser_incremental_from:
  69. - 11.5
  70. project_name: tor-browser
  71. multi_lingual: 0
  72. build_mar: 1
  73. # By default, we sort the list of installed packages. This allows sharing
  74. # containers with identical list of packages, even if they are not listed
  75. # in the same order. In the cases where the installation order is
  76. # important, sort_deps should be set to 0.
  77. sort_deps: 1
  78. build_id: '[% sha256(c("var/build_id_txt", { num_procs => 4 })).substr(0, 6) %]'
  79. build_id_txt: |
  80. [% c("version") %]
  81. [% IF c("git_hash") || c("hg_hash"); GET c("abbrev"); END; %]
  82. [% IF c("container/use_container") && ! c("container/global_disable") -%]
  83. [% c("var/container/suite") %]
  84. [% c("var/container/arch") %]
  85. [% END -%]
  86. input_files: [% c("input_files_id") %]
  87. build:
  88. [% SET step = c("step") -%]
  89. [% c(step, { filename => 'f', output_dir => '/out', norec => {} }) %]
  90. locale_ja: ja
  91. locales:
  92. - ar
  93. - ca
  94. - cs
  95. - da
  96. - de
  97. - el
  98. - es-AR
  99. - es-ES
  100. - fa
  101. - fr
  102. - ga-IE
  103. - he
  104. - hu
  105. - id
  106. - is
  107. - it
  108. - '[% c("var/locale_ja") %]'
  109. - ka
  110. - ko
  111. - lt
  112. - mk
  113. - ms
  114. - my
  115. - nb-NO
  116. - nl
  117. - pl
  118. - pt-BR
  119. - ro
  120. - ru
  121. - sv-SE
  122. - th
  123. - tr
  124. - vi
  125. - zh-CN
  126. - zh-TW
  127. locales_mobile:
  128. - ar
  129. - ca
  130. - cs
  131. - da
  132. - de
  133. - el
  134. - es-rAR
  135. - es-rES
  136. - fa
  137. - fr
  138. - ga-rIE
  139. - hu
  140. - in
  141. - is
  142. - it
  143. - iw
  144. - ja
  145. - ka
  146. - ko
  147. - lt
  148. - my
  149. - nb-rNO
  150. - nl
  151. - pl
  152. - pt-rBR
  153. - ro
  154. - ru
  155. - sv-rSE
  156. - th
  157. - tr
  158. - vi
  159. - zh-rCN
  160. - zh-rTW
  161. sign_build: '[% ENV.RBM_SIGN_BUILD %]'
  162. sign_build_gpg_opts: '[% ENV.RBM_GPG_OPTS %]'
  163. set_default_env: |
  164. set -e
  165. [% FOREACH env = c('ENV') -%]
  166. export [% env.key %]="[% env.value %]"
  167. [% END -%]
  168. rootdir=$(pwd)
  169. export SHELL=/bin/bash
  170. export HOME=$rootdir
  171. umask 0022
  172. [% IF c("container/global_disable") -%]
  173. rm -Rf /var/tmp/build /var/tmp/dist
  174. [% END -%]
  175. DOCSDIR_project: '[% project %]'
  176. set_PTDIR_DOCSDIR: |
  177. PTDIR="$distdir/TorBrowser/Tor/PluggableTransports"
  178. DOCSDIR="$distdir/TorBrowser/Docs/[% c("var/DOCSDIR_project") %]"
  179. targets:
  180. notarget: linux-x86_64
  181. noint:
  182. debug: 0
  183. release:
  184. var:
  185. release: 1
  186. channel: release
  187. alpha:
  188. var:
  189. alpha: 1
  190. channel: alpha
  191. nightly:
  192. fetch: 1
  193. var:
  194. nightly: 1
  195. channel: nightly
  196. torbrowser_version: |
  197. [%
  198. IF ENV.TORBROWSER_NIGHTLY_VERSION;
  199. GET ENV.TORBROWSER_NIGHTLY_VERSION;
  200. ELSIF c("var/testbuild");
  201. GET "testbuild";
  202. ELSE;
  203. GET c("var_p/nightly_torbrowser_version");
  204. END;
  205. -%]
  206. # For nightly builds, we support updates for a limited set of locales
  207. mar_locales:
  208. - de
  209. - es-ES
  210. - fr
  211. - ru
  212. max_torbrowser_incremental_from: 2
  213. build_infos_json: 1
  214. torbrowser-testbuild:
  215. - testbuild
  216. - alpha
  217. testbuild:
  218. var:
  219. testbuild: 1
  220. # Don't create mar files to save time
  221. build_mar: 0
  222. # Building only one architecture saves a lot of time
  223. android_single_arch: 1
  224. torbrowser-android-armv7:
  225. - android-armv7
  226. - android
  227. android-armv7:
  228. arch: armv7
  229. var:
  230. android-armv7: 1
  231. osname: android-armv7
  232. toolchain_arch: arm
  233. abi: armeabi-v7a
  234. cross_prefix: armv7a-linux-androideabi
  235. torbrowser-android-x86:
  236. - android-x86
  237. - android
  238. android-x86:
  239. arch: x86
  240. var:
  241. android-x86: 1
  242. osname: android-x86
  243. toolchain_arch: x86
  244. abi: x86
  245. cross_prefix: i686-linux-android
  246. torbrowser-android-x86_64:
  247. - android-x86_64
  248. - android
  249. android-x86_64:
  250. arch: x86_64
  251. var:
  252. android-x86_64: 1
  253. osname: android-x86_64
  254. toolchain_arch: x86_64
  255. abi: x86_64
  256. cross_prefix: x86_64-linux-android
  257. torbrowser-android-aarch64:
  258. - android-aarch64
  259. - android
  260. android-aarch64:
  261. arch: aarch64
  262. var:
  263. android-aarch64: 1
  264. osname: android-aarch64
  265. toolchain_arch: arm64
  266. abi: arm64-v8a
  267. cross_prefix: aarch64-linux-android
  268. android:
  269. container:
  270. disable_network:
  271. # Disable network in the script for merging GeckoView .aar files
  272. merge_aars: 1
  273. var:
  274. android: 1
  275. compiler: android-toolchain
  276. android_min_api: '[% GET c("var/android_min_api_" _ c("arch")) %]'
  277. CC: '[% c("var/cross_prefix") %][% c("var/android_min_api") %]-clang'
  278. CXX: '[% c("var/cross_prefix") %][% c("var/android_min_api") %]-clang'
  279. # API 21 is the minimum we currently support on Android
  280. android_min_api_armv7: 21
  281. android_min_api_x86: 21
  282. android_min_api_x86_64: 21
  283. android_min_api_aarch64: 21
  284. container:
  285. suite: bullseye
  286. arch: amd64
  287. deps:
  288. - build-essential
  289. - python3
  290. - python3-distutils
  291. - automake
  292. - libtool
  293. - zip
  294. - unzip
  295. - libtinfo5
  296. configure_opt: '--host=[% c("var/cross_prefix") %] CC=[% c("var/CC") %] [% c("var/configure_opt_project") %]'
  297. pre_pkginst: |
  298. SNAPSHOT_VERSION=20191201T212855Z
  299. OPENJDK_URL=https://snapshot.debian.org/archive/debian/$SNAPSHOT_VERSION/pool/main/o/openjdk-8
  300. JDK_VERSION=8u232-b09-1~deb9u1_amd64
  301. apt-get install -y -q wget ca-certificates-java
  302. wget $OPENJDK_URL/openjdk-8-jdk-headless_$JDK_VERSION.deb
  303. wget $OPENJDK_URL/openjdk-8-jre-headless_$JDK_VERSION.deb
  304. echo 92b4f8fb77d793a86e0b03b3b0750592b40a26a5d75956d10dd984a7b3aad4c9 openjdk-8-jdk-headless_$JDK_VERSION.deb | sha256sum -c
  305. echo 84bf52b6cce20ead08b0d5b9fd9b81b4aa3da385ca951b313fe11d5cb1aa4d17 openjdk-8-jre-headless_$JDK_VERSION.deb | sha256sum -c
  306. apt-get install -y -q ./openjdk-8-jre-headless_$JDK_VERSION.deb ./openjdk-8-jdk-headless_$JDK_VERSION.deb
  307. torbrowser-linux-x86_64:
  308. - linux-x86_64
  309. - linux
  310. torbrowser-linux-x86_64-asan:
  311. - linux-asan
  312. - linux-x86_64
  313. - linux
  314. torbrowser-linux-i686:
  315. - linux-i686
  316. - linux
  317. torbrowser-linux-arm64:
  318. - linux-arm64
  319. - linux
  320. torbrowser-linux-armhf:
  321. - linux-armhf
  322. - linux
  323. torbrowser-linux-arm:
  324. - linux-arm
  325. - linux-cross
  326. - linux
  327. linux-x86_64:
  328. arch: x86_64
  329. var:
  330. linux-x86_64: 1
  331. osname: linux-x86_64
  332. linux-cross: 0
  333. gnu-build-triplet: x86_64-unknown-linux-gnu
  334. gnu-host-triplet: x86_64-unknown-linux-gnu
  335. arch_debian: amd64
  336. # We only support RLBox on the nightly channel and x86_64 for now
  337. rlbox: 0
  338. linux-i686:
  339. arch: i686
  340. var:
  341. linux-i686: 1
  342. osname: linux-i686
  343. linux-cross: 0
  344. gnu-build-triplet: x86_64-unknown-linux-gnu
  345. gnu-host-triplet: i686-unknown-linux-gnu
  346. configure_opt: '--host=i686-linux-gnu CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 [% c("var/configure_opt_project") %]'
  347. arch_debian: i386
  348. linux-arm64:
  349. arch: aarch64
  350. var:
  351. linux-arm64: 1
  352. osname: linux-arm64
  353. linux-cross: 0
  354. gnu-build-triplet: aarch64-unknown-linux-gnu
  355. gnu-host-triplet: aarch64-unknown-linux-gnu
  356. container:
  357. arch: arm64
  358. # jessie is the first 64-bit arm release...and has a bug
  359. # in glibc which fails firefox build (dlopen: cannot load any more object with static TLS)
  360. suite: stretch
  361. pre_pkginst: ''
  362. deps:
  363. - build-essential
  364. - python
  365. - bison
  366. - automake
  367. - libtool
  368. - zip
  369. - unzip
  370. linux-armhf:
  371. arch: arm
  372. var:
  373. linux-armhf: 1
  374. osname: linux-armhf
  375. linux-cross: 0
  376. gnu-build-triplet: armv7-unknown-linux-gnueabihf
  377. gnu-host-triplet: armv7-unknown-linux-gnueabihf
  378. configure_opt: '--build=[% c("var/gnu-build-triplet") %] --host=[% c("var/gnu-host-triplet") %] [% c("var/configure_opt_project") %]'
  379. container:
  380. arch: armhf
  381. pre_pkginst: ''
  382. deps:
  383. - build-essential
  384. - python
  385. - bison
  386. - hardening-wrapper
  387. - automake
  388. - libtool
  389. - zip
  390. - unzip
  391. linux-arm:
  392. arch: arm
  393. var:
  394. linux-arm: 1
  395. osname: linux-arm
  396. crosstarget: arm-linux-gnueabihf
  397. arch_debian: armhf
  398. linux-cross:
  399. var:
  400. linux-cross: 1
  401. container:
  402. arch: amd64
  403. configure_opt: '--host=[% c("var/crosstarget") %] [% c("var/configure_opt_project") %]'
  404. linux:
  405. var:
  406. linux: 1
  407. compiler: gcc
  408. configure_opt: '[% c("var/configure_opt_project") %]'
  409. # Only build Namecoin for linux on nightly
  410. namecoin: '[% c("var/nightly") %]'
  411. container:
  412. suite: jessie
  413. arch: amd64
  414. pre_pkginst: dpkg --add-architecture i386
  415. deps:
  416. - libc6-dev-i386
  417. - lib32stdc++6
  418. - build-essential
  419. - python
  420. - bison
  421. - hardening-wrapper
  422. - automake
  423. - libtool
  424. - zip
  425. - unzip
  426. linux-asan:
  427. var:
  428. asan: 1
  429. # RLBox needs clang to create .wasm files but we use mostly GCC for our
  430. # ASan builds. Thus, the compilation currently breaks with RLBox enabled.
  431. # See: tor-browser-build#40063.
  432. rlbox: 0
  433. torbrowser-windows-i686:
  434. - windows-i686
  435. - windows
  436. torbrowser-windows-x86_64:
  437. - windows-x86_64
  438. - windows
  439. windows-x86_64:
  440. arch: x86_64
  441. var:
  442. windows-x86_64: 1
  443. windows-i686: 0
  444. osname: windows-x86_64
  445. gnu-build-triplet: x86_64-unknown-linux-gnu
  446. gnu-host-triplet: x86_64-pc-windows-gnu
  447. # HEASLR is 64 bit only (see bug 12968)
  448. flag_HEASLR: '-Wl,--high-entropy-va'
  449. windows-i686:
  450. arch: i686
  451. var:
  452. windows-i686: 1
  453. windows-x86_64: 0
  454. osname: windows-i686
  455. gnu-build-triplet: x86_64-unknown-linux-gnu
  456. gnu-host-triplet: i686-pc-windows-gnu
  457. # mingw-w64 does not support SEH on 32bit systems. Be explicit about that.
  458. flag_noSEH: '-Wl,--no-seh'
  459. windows:
  460. var:
  461. windows: 1
  462. container:
  463. suite: bullseye
  464. arch: amd64
  465. configure_opt: '--host=[% c("arch") %]-w64-mingw32 CFLAGS="[% c("var/CFLAGS") %]" LDFLAGS="[% c("var/LDFLAGS") %]" [% c("var/configure_opt_project") %]'
  466. CFLAGS: '-fstack-protector-strong -fno-strict-overflow -Wno-missing-field-initializers -Wformat -Wformat-security [% c("var/flag_mwindows") %]'
  467. LDFLAGS: '-Wl,--dynamicbase -Wl,--nxcompat -Wl,--enable-reloc-section -Wl,--no-insert-timestamp -lssp -L$gcclibs [% c("var/flag_HEASLR") %] [% c("var/flag_noSEH") %] [% c("var/flag_mwindows") %]'
  468. flag_mwindows: '-mwindows'
  469. compiler: mingw-w64
  470. deps:
  471. - build-essential
  472. - python3
  473. - python3-distutils
  474. - bison
  475. - automake
  476. - libtool
  477. - zip
  478. - unzip
  479. torbrowser-osx-x86_64:
  480. - osx-x86_64
  481. osx-x86_64:
  482. arch: x86_64
  483. var:
  484. osx: 1
  485. osname: osx-x86_64
  486. gnu-build-triplet: x86_64-unknown-linux-gnu
  487. gnu-host-triplet: x86_64-apple-darwin11
  488. container:
  489. suite: bullseye
  490. arch: amd64
  491. compiler: 'macosx-toolchain'
  492. configure_opt: '--host=x86_64-apple-darwin CC="x86_64-apple-darwin-clang [% c("var/FLAGS") %]" CXX="x86_64-apple-darwin-clang++ [% c("var/FLAGS") %]" [% c("var/configure_opt_project") %]'
  493. FLAGS: "-target x86_64-apple-darwin -B $cctoolsdir -isysroot $sysrootdir"
  494. LDFLAGS: "-Wl,-syslibroot,$sysrootdir -Wl,-dead_strip -Wl,-pie"
  495. macosx_deployment_target: '10.12'
  496. locale_ja: ja-JP-mac
  497. rlbox: 0
  498. deps:
  499. - build-essential
  500. - python3
  501. - python3-distutils
  502. - automake
  503. - libtool
  504. - zip
  505. - unzip
  506. faketime_path: /usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1
  507. set_PTDIR_DOCSDIR: |
  508. PTDIR="$distdir/Contents/MacOS/Tor/PluggableTransports"
  509. DOCSDIR="$distdir/Contents/Resources/TorBrowser/Docs/[% c("var/DOCSDIR_project") %]"
  510. # The no_build_id target can be useful if you want to quickly display
  511. # a build template or other option but don't want to spend time to
  512. # compute the various build ids
  513. no_build_id:
  514. # The defaut timestamp value will use the commit time of the
  515. # selected commit for the project, which will require cloning the
  516. # git repository if it is not present. When we use the no_build_id
  517. # target to display a script, we usually don't care about such
  518. # details, so we set timestamp to 0 to avoid unnecessary cloning.
  519. timestamp: 0
  520. var:
  521. build_id: 1
  522. no_containers:
  523. container:
  524. global_disable: 1
  525. # allow git tag signed using an expired key.
  526. # https://bugs.torproject.org/19737
  527. gpg_allow_expired_keys: 1
  528. --- |
  529. # This part of the file contains options written in perl
  530. use IO::CaptureOutput qw(capture_exec);
  531. (
  532. var_p => {
  533. nightly_torbrowser_version => sub {
  534. state $version = '';
  535. return $version if $version;
  536. my (undef, undef, undef, $day, $mon, $year) = gmtime;
  537. $version = sprintf("tbb-nightly.%u.%02u.%02u", $year + 1900, $mon + 1, $day);
  538. return $version;
  539. },
  540. nightly_torbrowser_incremental_from => sub {
  541. my ($project, $options) = @_;
  542. my $nightly_dir = project_config($project, 'basedir', $options) . '/nightly';
  543. my $current_version = project_config($project, 'var/torbrowser_version', $options);
  544. use Path::Tiny;
  545. return [] unless -d $nightly_dir;
  546. my @dirs = sort map { $_->basename } path($nightly_dir)->children(qr/^tbb-nightly\./);
  547. my $nb_incr = project_config($project, ['var', 'max_torbrowser_incremental_from'], $options);
  548. my @res;
  549. while ($nb_incr > 0) {
  550. my $dir = pop @dirs;
  551. last unless $dir;
  552. next if $dir eq $current_version;
  553. $nb_incr--;
  554. push @res, $dir;
  555. }
  556. return [@res];
  557. },
  558. },
  559. )