rbm.conf 16 KB

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