rbm.conf 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685
  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. - bzip2
  31. - ca-certificates
  32. - patch
  33. - xz-utils
  34. cargo_vendor: |
  35. #!/bin/bash
  36. [% c("var/set_default_env") %]
  37. mkdir /var/tmp/dist
  38. # NOTE: since different projects need different rust versions,
  39. # we use the version of cargo produced by the rust project
  40. # build rather than the build container's debian package.
  41. # Thus, any project that wants to run a `cargo_vendor` step
  42. # must be sure to provide the rust project as an `input_file`.
  43. # See, e.g.,`application-services/config.steps.cargo_vendor.input_files`.
  44. tar -C /var/tmp/dist -xf [% c('input_files_by_name/rust') %]
  45. export PATH="/var/tmp/dist/rust/bin:$PATH"
  46. tar -xf [% project %]-[% c('version') %].tar.gz
  47. cd [% project %]-[% c('version') %]
  48. [% c("var/pre_cargo_vendor") %]
  49. cargo vendor vendor [% c("var/cargo_vendor_opts") %]
  50. [% c('tar', {
  51. tar_src => [ 'vendor' ],
  52. tar_args => '-caf ' _ dest_dir _ '/' _ c('filename'),
  53. }) %]
  54. cd [% dest_dir %]
  55. fname="out/[% project %]/cargo_vendor/[% c('filename') %]"
  56. echo
  57. echo "Finished creating $fname"
  58. sha256sum "[% c('filename') %]"
  59. echo "You can upload it with:"
  60. echo " scp -p $fname people.torproject.org:public_html/mirrors/sources"
  61. # buildconf contains build options that the user can change in rbm.local.conf
  62. # When adding a new option to buildconf, a default value should be defined
  63. # in var/build_id, so that changing this option does not affect the build_id.
  64. buildconf:
  65. git_signtag_opt: '-s'
  66. var:
  67. torbrowser_version: '12.5a3'
  68. torbrowser_build: 'build1'
  69. torbrowser_incremental_from:
  70. - 12.5a2
  71. updater_enabled: 1
  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. exe_name: firefox
  91. locale_ja: ja
  92. locales:
  93. - ar
  94. - ca
  95. - cs
  96. - da
  97. - de
  98. - el
  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. - sq
  122. - sv-SE
  123. - th
  124. - tr
  125. - uk
  126. - vi
  127. - zh-CN
  128. - zh-TW
  129. locales_mobile:
  130. - ar
  131. - ca
  132. - cs
  133. - da
  134. - de
  135. - el
  136. - es-rES
  137. - fa
  138. - fr
  139. - ga-rIE
  140. - hu
  141. - in
  142. - is
  143. - it
  144. - iw
  145. - ja
  146. - ka
  147. - ko
  148. - lt
  149. - my
  150. - nb-rNO
  151. - nl
  152. - pl
  153. - pt-rBR
  154. - ro
  155. - ru
  156. - sq
  157. - sv-rSE
  158. - th
  159. - tr
  160. - uk
  161. - vi
  162. - zh-rCN
  163. - zh-rTW
  164. rlbox: 0
  165. sign_build: '[% ENV.RBM_SIGN_BUILD %]'
  166. sign_build_gpg_opts: '[% ENV.RBM_GPG_OPTS %]'
  167. set_default_env: |
  168. set -e
  169. [% FOREACH env = c('ENV') -%]
  170. export [% env.key %]="[% env.value %]"
  171. [% END -%]
  172. rootdir=$(pwd)
  173. export SHELL=/bin/bash
  174. export HOME=$rootdir
  175. umask 0022
  176. [% IF c("container/global_disable") -%]
  177. rm -Rf /var/tmp/build /var/tmp/dist
  178. [% END -%]
  179. DOCSDIR_project: '[% project %]'
  180. targets:
  181. notarget: linux-x86_64
  182. noint:
  183. debug: 0
  184. release:
  185. var:
  186. release: 1
  187. channel: release
  188. alpha:
  189. var:
  190. alpha: 1
  191. channel: alpha
  192. nightly:
  193. fetch: 1
  194. var:
  195. nightly: 1
  196. channel: nightly
  197. torbrowser_version: |
  198. [%
  199. IF ENV.TORBROWSER_NIGHTLY_VERSION;
  200. GET ENV.TORBROWSER_NIGHTLY_VERSION;
  201. ELSIF c("var/testbuild");
  202. GET "testbuild";
  203. ELSE;
  204. GET c("var_p/nightly_torbrowser_version");
  205. END;
  206. -%]
  207. max_torbrowser_incremental_from: 2
  208. build_infos_json: 1
  209. torbrowser:
  210. var:
  211. tor-browser: 1
  212. project-name: tor-browser
  213. projectname: torbrowser
  214. Project_Name: 'Tor Browser'
  215. ProjectName: TorBrowser
  216. basebrowser:
  217. var:
  218. base-browser: 1
  219. project-name: base-browser
  220. projectname: basebrowser
  221. Project_Name: 'Base Browser'
  222. ProjectName: BaseBrowser
  223. updater_enabled: 0
  224. privacybrowser:
  225. var:
  226. privacy-browser: 1
  227. project-name: privacy-browser
  228. projectname: privacybrowser
  229. Project_Name: 'Privacy Browser'
  230. ProjectName: PrivacyBrowser
  231. exe_name: privacybrowser
  232. updater_enabled: 0
  233. locales: []
  234. torbrowser-testbuild:
  235. - testbuild
  236. - alpha
  237. - torbrowser
  238. basebrowser-testbuild:
  239. - testbuild
  240. - alpha
  241. - basebrowser
  242. privacybrowser-testbuild:
  243. - testbuild
  244. - alpha
  245. - privacybrowser
  246. testbuild:
  247. var:
  248. testbuild: 1
  249. # Don't create mar files to save time
  250. build_mar: 0
  251. # Building only one architecture saves a lot of time
  252. android_single_arch: 1
  253. torbrowser-android-armv7:
  254. - android-armv7
  255. - android
  256. - torbrowser
  257. basebrowser-android-armv7:
  258. - android-armv7
  259. - android
  260. - basebrowser
  261. android-armv7:
  262. arch: armv7
  263. var:
  264. android-armv7: 1
  265. osname: android-armv7
  266. toolchain_arch: arm
  267. abi: armeabi-v7a
  268. cross_prefix: armv7a-linux-androideabi
  269. torbrowser-android-x86:
  270. - android-x86
  271. - android
  272. - torbrowser
  273. basebrowser-android-x86:
  274. - android-x86
  275. - android
  276. - basebrowser
  277. android-x86:
  278. arch: x86
  279. var:
  280. android-x86: 1
  281. osname: android-x86
  282. toolchain_arch: x86
  283. abi: x86
  284. cross_prefix: i686-linux-android
  285. torbrowser-android-x86_64:
  286. - android-x86_64
  287. - android
  288. - torbrowser
  289. basebrowser-android-x86_64:
  290. - android-x86_64
  291. - android
  292. - basebrowser
  293. android-x86_64:
  294. arch: x86_64
  295. var:
  296. android-x86_64: 1
  297. osname: android-x86_64
  298. toolchain_arch: x86_64
  299. abi: x86_64
  300. cross_prefix: x86_64-linux-android
  301. torbrowser-android-aarch64:
  302. - android-aarch64
  303. - android
  304. - torbrowser
  305. basebrowser-android-aarch64:
  306. - android-aarch64
  307. - android
  308. - basebrowser
  309. android-aarch64:
  310. arch: aarch64
  311. var:
  312. android-aarch64: 1
  313. osname: android-aarch64
  314. toolchain_arch: arm64
  315. abi: arm64-v8a
  316. cross_prefix: aarch64-linux-android
  317. android:
  318. container:
  319. disable_network:
  320. # Disable network in the script for merging GeckoView .aar files
  321. merge_aars: 1
  322. var:
  323. android: 1
  324. compiler: android-toolchain
  325. android_min_api: '[% GET c("var/android_min_api_" _ c("arch")) %]'
  326. CC: '[% c("var/cross_prefix") %][% c("var/android_min_api") %]-clang'
  327. CXX: '[% c("var/cross_prefix") %][% c("var/android_min_api") %]-clang'
  328. # API 21 is the minimum we currently support on Android
  329. android_min_api_armv7: 21
  330. android_min_api_x86: 21
  331. android_min_api_x86_64: 21
  332. android_min_api_aarch64: 21
  333. container:
  334. suite: bullseye
  335. arch: amd64
  336. deps:
  337. - build-essential
  338. - bison
  339. - python3
  340. - python3-distutils
  341. - python3-venv
  342. - automake
  343. - libtool
  344. - zip
  345. - unzip
  346. - libtinfo5
  347. - libssl-dev
  348. - pkg-config
  349. - zlib1g-dev
  350. configure_opt: '--host=[% c("var/cross_prefix") %] CC=[% c("var/CC") %] [% c("var/configure_opt_project") %]'
  351. pre_pkginst: |
  352. SNAPSHOT_VERSION=20191201T212855Z
  353. OPENJDK_URL=https://snapshot.debian.org/archive/debian/$SNAPSHOT_VERSION/pool/main/o/openjdk-8
  354. JDK_VERSION=8u232-b09-1~deb9u1_amd64
  355. apt-get install -y -q wget ca-certificates-java
  356. wget $OPENJDK_URL/openjdk-8-jdk-headless_$JDK_VERSION.deb
  357. wget $OPENJDK_URL/openjdk-8-jre-headless_$JDK_VERSION.deb
  358. echo 92b4f8fb77d793a86e0b03b3b0750592b40a26a5d75956d10dd984a7b3aad4c9 openjdk-8-jdk-headless_$JDK_VERSION.deb | sha256sum -c
  359. echo 84bf52b6cce20ead08b0d5b9fd9b81b4aa3da385ca951b313fe11d5cb1aa4d17 openjdk-8-jre-headless_$JDK_VERSION.deb | sha256sum -c
  360. apt-get install -y -q ./openjdk-8-jre-headless_$JDK_VERSION.deb ./openjdk-8-jdk-headless_$JDK_VERSION.deb
  361. torbrowser-linux-x86_64:
  362. - linux-x86_64
  363. - linux
  364. - torbrowser
  365. basebrowser-linux-x86_64:
  366. - linux-x86_64
  367. - linux
  368. - basebrowser
  369. privacybrowser-linux-x86_64:
  370. - linux-x86_64
  371. - linux
  372. - privacybrowser
  373. torbrowser-linux-x86_64-asan:
  374. - linux-asan
  375. - linux-x86_64
  376. - linux
  377. - torbrowser
  378. basebrowser-linux-x86_64-asan:
  379. - linux-asan
  380. - linux-x86_64
  381. - linux
  382. - basebrowser
  383. privacybrowser-linux-x86_64-asan:
  384. - linux-asan
  385. - linux-x86_64
  386. - linux
  387. - privacybrowser
  388. torbrowser-linux-i686:
  389. - linux-i686
  390. - linux
  391. - torbrowser
  392. basebrowser-linux-i686:
  393. - linux-i686
  394. - linux
  395. - basebrowser
  396. torbrowser-linux-arm:
  397. - linux-arm
  398. - linux-cross
  399. - linux
  400. - torbrowser
  401. basebrowser-linux-arm:
  402. - linux-arm
  403. - linux-cross
  404. - linux
  405. - basebrowser
  406. linux-x86_64:
  407. arch: x86_64
  408. var:
  409. linux-x86_64: 1
  410. osname: linux-x86_64
  411. linux-cross: 0
  412. arch_debian: amd64
  413. linux-i686:
  414. arch: i686
  415. var:
  416. linux-i686: 1
  417. osname: linux-i686
  418. linux-cross: 0
  419. configure_opt: '--host=i686-linux-gnu CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 [% c("var/configure_opt_project") %]'
  420. arch_debian: i386
  421. linux-arm:
  422. arch: arm
  423. var:
  424. linux-arm: 1
  425. osname: linux-arm
  426. crosstarget: arm-linux-gnueabihf
  427. arch_debian: armhf
  428. linux-cross:
  429. var:
  430. linux-cross: 1
  431. container:
  432. suite: jessie
  433. arch: amd64
  434. configure_opt: '--host=[% c("var/crosstarget") %] [% c("var/configure_opt_project") %]'
  435. linux:
  436. var:
  437. linux: 1
  438. compiler: gcc
  439. configure_opt: '[% c("var/configure_opt_project") %]'
  440. # Only build Namecoin for linux on nightly
  441. namecoin: '[% c("var/nightly") && c("var/tor-browser") %]'
  442. container:
  443. suite: jessie
  444. arch: amd64
  445. pre_pkginst: dpkg --add-architecture i386
  446. deps:
  447. - libc6-dev-i386
  448. - lib32stdc++6
  449. - pkg-config
  450. - libssl-dev
  451. - build-essential
  452. - python
  453. - bison
  454. - hardening-wrapper
  455. - automake
  456. - libtool
  457. - zip
  458. - unzip
  459. - xz-utils
  460. - patch
  461. linux-asan:
  462. var:
  463. asan: 1
  464. # RLBox needs clang to create .wasm files but we use mostly GCC for our
  465. # ASan builds. Thus, the compilation currently breaks with RLBox enabled.
  466. # See: tor-browser-build#40063.
  467. rlbox: 0
  468. torbrowser-windows-i686:
  469. - windows-i686
  470. - windows
  471. - torbrowser
  472. basebrowser-windows-i686:
  473. - windows-i686
  474. - windows
  475. - basebrowser
  476. torbrowser-windows-x86_64:
  477. - windows-x86_64
  478. - windows
  479. - torbrowser
  480. basebrowser-windows-x86_64:
  481. - windows-x86_64
  482. - windows
  483. - basebrowser
  484. privacybrowser-windows-x86_64:
  485. - windows-x86_64
  486. - windows
  487. - privacybrowser
  488. windows-x86_64:
  489. arch: x86_64
  490. var:
  491. windows-x86_64: 1
  492. windows-i686: 0
  493. osname: windows-x86_64
  494. windows-i686:
  495. arch: i686
  496. var:
  497. windows-i686: 1
  498. windows-x86_64: 0
  499. osname: windows-i686
  500. # mingw-w64 does not support SEH on 32bit systems. Be explicit about that.
  501. flag_noSEH: '-Wl,--no-seh'
  502. windows:
  503. var:
  504. windows: 1
  505. container:
  506. suite: bullseye
  507. arch: amd64
  508. configure_opt: '--host=[% c("arch") %]-w64-mingw32 CFLAGS="[% c("var/CFLAGS") %]" LDFLAGS="[% c("var/LDFLAGS") %]" [% c("var/configure_opt_project") %]'
  509. CFLAGS: '-fstack-protector-strong -fno-strict-overflow -Wno-missing-field-initializers -Wformat -Wformat-security [% c("var/flag_mwindows") %]'
  510. LDFLAGS: '-Wl,--no-insert-timestamp [% c("var/flag_noSEH") %] [% c("var/flag_mwindows") %]'
  511. flag_mwindows: '-Wl,--subsystem,windows'
  512. compiler: mingw-w64-clang
  513. deps:
  514. - build-essential
  515. - python3
  516. - python3-distutils
  517. - bison
  518. - automake
  519. - libtool
  520. - zip
  521. - unzip
  522. - libssl-dev
  523. - zlib1g-dev
  524. torbrowser-macos:
  525. - macos-universal
  526. - macos-x86_64
  527. - macos
  528. - torbrowser
  529. torbrowser-macos-x86_64:
  530. - macos-x86_64
  531. - macos
  532. - torbrowser
  533. torbrowser-macos-aarch64:
  534. - macos-aarch64
  535. - macos
  536. - torbrowser
  537. basebrowser-macos:
  538. - macos-universal
  539. - macos-x86_64
  540. - macos
  541. - basebrowser
  542. basebrowser-macos-x86_64:
  543. - macos-x86_64
  544. - macos
  545. - basebrowser
  546. basebrowser-macos-aarch64:
  547. - macos-aarch64
  548. - macos
  549. - basebrowser
  550. privacybrowser-macos:
  551. - macos-universal
  552. - macos-x86_64
  553. - macos
  554. - privacybrowser
  555. privacybrowser-macos-x86_64:
  556. - macos-x86_64
  557. - macos
  558. - privacybrowser
  559. privacybrowser-macos-aarch64:
  560. - macos-aarch64
  561. - macos
  562. - privacybrowser
  563. macos-universal:
  564. var:
  565. macos_universal: 1
  566. macos-aarch64:
  567. arch: aarch64
  568. var:
  569. macos-aarch64: 1
  570. macos-x86_64: 0
  571. osname: macos-aarch64
  572. macos_arch: arm64
  573. build_target: aarch64-apple-darwin
  574. macosx_deployment_target: '11.0'
  575. macos-x86_64:
  576. arch: x86_64
  577. var:
  578. macos-x86_64: 1
  579. osname: macos-x86_64
  580. macos_arch: x86_64
  581. build_target: x86_64-apple-darwin
  582. macosx_deployment_target: '10.12'
  583. macos:
  584. var:
  585. macos: 1
  586. osname: macos
  587. container:
  588. suite: bullseye
  589. arch: amd64
  590. compiler: 'macosx-toolchain'
  591. configure_opt: '--host=[% c("var/build_target") %] CC="[% c("var/build_target") %]-clang [% c("var/FLAGS") %]" CXX="[% c("var/build_target") %]-clang++ [% c("var/FLAGS") %]" [% c("var/configure_opt_project") %]'
  592. FLAGS: "-target [% c('var/build_target') %] -B $cctoolsdir -isysroot $sysrootdir [% IF c('var/macos-aarch64') %]-mcpu=apple-m1[% END %]"
  593. LDFLAGS: "-Wl,-syslibroot,$sysrootdir -Wl,-dead_strip -Wl,-pie"
  594. locale_ja: ja-JP-mac
  595. deps:
  596. - build-essential
  597. - faketime
  598. - python3
  599. - python3-distutils
  600. - automake
  601. - bison
  602. - libtool
  603. - zip
  604. - unzip
  605. - libssl-dev
  606. - zlib1g-dev
  607. faketime_path: /usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1
  608. # The no_build_id target can be useful if you want to quickly display
  609. # a build template or other option but don't want to spend time to
  610. # compute the various build ids
  611. no_build_id:
  612. # The defaut timestamp value will use the commit time of the
  613. # selected commit for the project, which will require cloning the
  614. # git repository if it is not present. When we use the no_build_id
  615. # target to display a script, we usually don't care about such
  616. # details, so we set timestamp to 0 to avoid unnecessary cloning.
  617. timestamp: 0
  618. var:
  619. build_id: 1
  620. no_containers:
  621. container:
  622. global_disable: 1
  623. # allow git tag signed using an expired key.
  624. # https://bugs.torproject.org/19737
  625. gpg_allow_expired_keys: 1
  626. --- |
  627. # This part of the file contains options written in perl
  628. use IO::CaptureOutput qw(capture_exec);
  629. (
  630. var_p => {
  631. nightly_torbrowser_version => sub {
  632. state $version = '';
  633. return $version if $version;
  634. my (undef, undef, undef, $day, $mon, $year) = gmtime;
  635. $version = sprintf("tbb-nightly.%u.%02u.%02u", $year + 1900, $mon + 1, $day);
  636. return $version;
  637. },
  638. nightly_torbrowser_incremental_from => sub {
  639. my ($project, $options) = @_;
  640. my $nightly_dir = project_config($project, 'basedir', $options) . '/' .
  641. project_config($project, 'var/projectname', $options) . '/nightly';
  642. my $current_version = project_config($project, 'var/torbrowser_version', $options);
  643. use Path::Tiny;
  644. return [] unless -d $nightly_dir;
  645. my @dirs = sort map { $_->basename } path($nightly_dir)->children(qr/^tbb-nightly\./);
  646. my $nb_incr = project_config($project, ['var', 'max_torbrowser_incremental_from'], $options);
  647. my @res;
  648. while ($nb_incr > 0) {
  649. my $dir = pop @dirs;
  650. last unless $dir;
  651. next if $dir eq $current_version;
  652. $nb_incr--;
  653. push @res, $dir;
  654. }
  655. return [@res];
  656. },
  657. },
  658. )