rbm.conf 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  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. deb_native_arch: arm64
  67. var:
  68. torbrowser_version: '12.0.1'
  69. torbrowser_build: 'build1'
  70. torbrowser_incremental_from:
  71. - 12.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-ES
  99. - fa
  100. - fr
  101. - ga-IE
  102. - he
  103. - hu
  104. - id
  105. - is
  106. - it
  107. - '[% c("var/locale_ja") %]'
  108. - ka
  109. - ko
  110. - lt
  111. - mk
  112. - ms
  113. - my
  114. - nb-NO
  115. - nl
  116. - pl
  117. - pt-BR
  118. - ro
  119. - ru
  120. - sq
  121. - sv-SE
  122. - th
  123. - tr
  124. - uk
  125. - vi
  126. - zh-CN
  127. - zh-TW
  128. locales_mobile:
  129. - ar
  130. - ca
  131. - cs
  132. - da
  133. - de
  134. - el
  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. - sq
  156. - sv-rSE
  157. - th
  158. - tr
  159. - uk
  160. - vi
  161. - zh-rCN
  162. - zh-rTW
  163. sign_build: '[% ENV.RBM_SIGN_BUILD %]'
  164. sign_build_gpg_opts: '[% ENV.RBM_GPG_OPTS %]'
  165. set_default_env: |
  166. set -e
  167. [% FOREACH env = c('ENV') -%]
  168. export [% env.key %]="[% env.value %]"
  169. [% END -%]
  170. rootdir=$(pwd)
  171. export SHELL=/bin/bash
  172. export HOME=$rootdir
  173. umask 0022
  174. [% IF c("container/global_disable") -%]
  175. rm -Rf /var/tmp/build /var/tmp/dist
  176. [% END -%]
  177. DOCSDIR_project: '[% project %]'
  178. targets:
  179. notarget: linux-x86_64
  180. noint:
  181. debug: 0
  182. release:
  183. var:
  184. release: 1
  185. channel: release
  186. alpha:
  187. var:
  188. alpha: 1
  189. channel: alpha
  190. nightly:
  191. fetch: 1
  192. var:
  193. nightly: 1
  194. channel: nightly
  195. torbrowser_version: |
  196. [%
  197. IF ENV.TORBROWSER_NIGHTLY_VERSION;
  198. GET ENV.TORBROWSER_NIGHTLY_VERSION;
  199. ELSIF c("var/testbuild");
  200. GET "testbuild";
  201. ELSE;
  202. GET c("var_p/nightly_torbrowser_version");
  203. END;
  204. -%]
  205. max_torbrowser_incremental_from: 2
  206. build_infos_json: 1
  207. torbrowser:
  208. var:
  209. tor-browser: 1
  210. project-name: tor-browser
  211. projectname: torbrowser
  212. Project_Name: 'Tor Browser'
  213. ProjectName: TorBrowser
  214. basebrowser:
  215. var:
  216. base-browser: 1
  217. project-name: base-browser
  218. projectname: basebrowser
  219. Project_Name: 'Base Browser'
  220. ProjectName: BaseBrowser
  221. torbrowser-testbuild:
  222. - testbuild
  223. - alpha
  224. - torbrowser
  225. basebrowser-testbuild:
  226. - testbuild
  227. - alpha
  228. - basebrowser
  229. testbuild:
  230. var:
  231. testbuild: 1
  232. # Don't create mar files to save time
  233. build_mar: 0
  234. # Building only one architecture saves a lot of time
  235. android_single_arch: 1
  236. torbrowser-android-armv7:
  237. - android-armv7
  238. - android
  239. - torbrowser
  240. basebrowser-android-armv7:
  241. - android-armv7
  242. - android
  243. - basebrowser
  244. android-armv7:
  245. arch: armv7
  246. var:
  247. android-armv7: 1
  248. osname: android-armv7
  249. toolchain_arch: arm
  250. abi: armeabi-v7a
  251. cross_prefix: armv7a-linux-androideabi
  252. torbrowser-android-x86:
  253. - android-x86
  254. - android
  255. - torbrowser
  256. basebrowser-android-x86:
  257. - android-x86
  258. - android
  259. - basebrowser
  260. android-x86:
  261. arch: x86
  262. var:
  263. android-x86: 1
  264. osname: android-x86
  265. toolchain_arch: x86
  266. abi: x86
  267. cross_prefix: i686-linux-android
  268. torbrowser-android-x86_64:
  269. - android-x86_64
  270. - android
  271. - torbrowser
  272. basebrowser-android-x86_64:
  273. - android-x86_64
  274. - android
  275. - basebrowser
  276. android-x86_64:
  277. arch: x86_64
  278. var:
  279. android-x86_64: 1
  280. osname: android-x86_64
  281. toolchain_arch: x86_64
  282. abi: x86_64
  283. cross_prefix: x86_64-linux-android
  284. torbrowser-android-aarch64:
  285. - android-aarch64
  286. - android
  287. - torbrowser
  288. basebrowser-android-aarch64:
  289. - android-aarch64
  290. - android
  291. - basebrowser
  292. android-aarch64:
  293. arch: aarch64
  294. var:
  295. android-aarch64: 1
  296. osname: android-aarch64
  297. toolchain_arch: arm64
  298. abi: arm64-v8a
  299. cross_prefix: aarch64-linux-android
  300. android:
  301. container:
  302. disable_network:
  303. # Disable network in the script for merging GeckoView .aar files
  304. merge_aars: 1
  305. var:
  306. android: 1
  307. compiler: android-toolchain
  308. android_min_api: '[% GET c("var/android_min_api_" _ c("arch")) %]'
  309. CC: '[% c("var/cross_prefix") %][% c("var/android_min_api") %]-clang'
  310. CXX: '[% c("var/cross_prefix") %][% c("var/android_min_api") %]-clang'
  311. # API 21 is the minimum we currently support on Android
  312. android_min_api_armv7: 21
  313. android_min_api_x86: 21
  314. android_min_api_x86_64: 21
  315. android_min_api_aarch64: 21
  316. container:
  317. suite: bullseye
  318. arch: amd64
  319. deps:
  320. - build-essential
  321. - bison
  322. - python3
  323. - python3-distutils
  324. - python3-venv
  325. - automake
  326. - libtool
  327. - zip
  328. - unzip
  329. - libtinfo5
  330. - libssl-dev
  331. - pkg-config
  332. - zlib1g-dev
  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-arm64:
  371. - linux-arm64
  372. - linux
  373. - torbrowser
  374. basebrowser-linux-arm64:
  375. - linux-arm64
  376. - linux
  377. - basebrowser
  378. torbrowser-linux-armhf:
  379. - linux-armhf
  380. - linux
  381. - torbrowser
  382. basebrowser-linux-armhf:
  383. - linux-armhf
  384. - linux
  385. - basebrowser
  386. torbrowser-linux-arm:
  387. - linux-arm
  388. - linux-cross
  389. - linux
  390. - torbrowser
  391. basebrowser-linux-arm:
  392. - linux-arm
  393. - linux-cross
  394. - linux
  395. - basebrowser
  396. linux-x86_64:
  397. arch: x86_64
  398. var:
  399. linux-x86_64: 1
  400. osname: linux-x86_64
  401. linux-cross: 0
  402. gnu-build-triplet: x86_64-unknown-linux-gnu
  403. gnu-host-triplet: x86_64-unknown-linux-gnu
  404. arch_debian: amd64
  405. # We only support RLBox on the nightly channel and x86_64 for now
  406. rlbox: 0
  407. linux-i686:
  408. arch: i686
  409. var:
  410. linux-i686: 1
  411. osname: linux-i686
  412. linux-cross: 0
  413. gnu-build-triplet: x86_64-unknown-linux-gnu
  414. gnu-host-triplet: i686-unknown-linux-gnu
  415. configure_opt: '--host=i686-linux-gnu CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 [% c("var/configure_opt_project") %]'
  416. arch_debian: i386
  417. linux-arm64:
  418. arch: aarch64
  419. var:
  420. linux-arm64: 1
  421. osname: linux-arm64
  422. linux-cross: 0
  423. gnu-build-triplet: aarch64-unknown-linux-gnu
  424. gnu-host-triplet: aarch64-unknown-linux-gnu
  425. arch_debian: arm64
  426. container:
  427. arch: arm64
  428. # jessie is the first 64-bit arm release...and has a bug
  429. # in glibc which fails firefox build (dlopen: cannot load any more object with static TLS)
  430. # and for whatever reason newer distros no longer work if built on
  431. # stretch either
  432. suite: buster
  433. pre_pkginst: ''
  434. deps:
  435. - pkg-config
  436. - libssl-dev
  437. - build-essential
  438. - python
  439. - bison
  440. - automake
  441. - libtool
  442. - zip
  443. - unzip
  444. - xz-utils
  445. - patch
  446. linux-armhf:
  447. arch: arm
  448. var:
  449. linux-armhf: 1
  450. osname: linux-armhf
  451. linux-cross: 0
  452. gnu-build-triplet: armv7-unknown-linux-gnueabihf
  453. gnu-host-triplet: armv7-unknown-linux-gnueabihf
  454. configure_opt: '--build=[% c("var/gnu-build-triplet") %] --host=[% c("var/gnu-host-triplet") %] [% c("var/configure_opt_project") %]'
  455. arch_debian: armhf
  456. container:
  457. arch: armhf
  458. suite: buster
  459. pre_pkginst: ''
  460. deps:
  461. - pkg-config
  462. - libssl-dev
  463. - build-essential
  464. - python
  465. - bison
  466. #- hardening-wrapper
  467. - automake
  468. - libtool
  469. - zip
  470. - unzip
  471. - xz-utils
  472. - patch
  473. linux-arm:
  474. arch: arm
  475. var:
  476. linux-arm: 1
  477. osname: linux-arm
  478. crosstarget: arm-linux-gnueabihf
  479. arch_debian: armhf
  480. linux-cross:
  481. var:
  482. linux-cross: 1
  483. container:
  484. arch: amd64
  485. configure_opt: '--host=[% c("var/crosstarget") %] [% c("var/configure_opt_project") %]'
  486. linux:
  487. var:
  488. linux: 1
  489. compiler: gcc
  490. configure_opt: '[% c("var/configure_opt_project") %]'
  491. # Only build Namecoin for linux on nightly
  492. namecoin: '[% c("var/nightly") && c("var/tor-browser") %]'
  493. container:
  494. suite: jessie
  495. arch: amd64
  496. pre_pkginst: dpkg --add-architecture i386
  497. deps:
  498. - libc6-dev-i386
  499. - lib32stdc++6
  500. - pkg-config
  501. - libssl-dev
  502. - build-essential
  503. - python
  504. - bison
  505. - hardening-wrapper
  506. - automake
  507. - libtool
  508. - zip
  509. - unzip
  510. - xz-utils
  511. - patch
  512. linux-asan:
  513. var:
  514. asan: 1
  515. # RLBox needs clang to create .wasm files but we use mostly GCC for our
  516. # ASan builds. Thus, the compilation currently breaks with RLBox enabled.
  517. # See: tor-browser-build#40063.
  518. rlbox: 0
  519. torbrowser-windows-i686:
  520. - windows-i686
  521. - windows
  522. - torbrowser
  523. basebrowser-windows-i686:
  524. - windows-i686
  525. - windows
  526. - basebrowser
  527. torbrowser-windows-x86_64:
  528. - windows-x86_64
  529. - windows
  530. - torbrowser
  531. basebrowser-windows-x86_64:
  532. - windows-x86_64
  533. - windows
  534. - basebrowser
  535. windows-x86_64:
  536. arch: x86_64
  537. var:
  538. windows-x86_64: 1
  539. windows-i686: 0
  540. osname: windows-x86_64
  541. gnu-build-triplet: x86_64-unknown-linux-gnu
  542. gnu-host-triplet: x86_64-pc-windows-gnu
  543. windows-i686:
  544. arch: i686
  545. var:
  546. windows-i686: 1
  547. windows-x86_64: 0
  548. osname: windows-i686
  549. gnu-build-triplet: x86_64-unknown-linux-gnu
  550. gnu-host-triplet: i686-pc-windows-gnu
  551. # mingw-w64 does not support SEH on 32bit systems. Be explicit about that.
  552. flag_noSEH: '-Wl,--no-seh'
  553. windows:
  554. var:
  555. windows: 1
  556. container:
  557. suite: bullseye
  558. arch: amd64
  559. configure_opt: '--host=[% c("arch") %]-w64-mingw32 CFLAGS="[% c("var/CFLAGS") %]" LDFLAGS="[% c("var/LDFLAGS") %]" [% c("var/configure_opt_project") %]'
  560. CFLAGS: '-fstack-protector-strong -fno-strict-overflow -Wno-missing-field-initializers -Wformat -Wformat-security [% c("var/flag_mwindows") %]'
  561. LDFLAGS: '-Wl,--no-insert-timestamp [% c("var/flag_noSEH") %] [% c("var/flag_mwindows") %]'
  562. flag_mwindows: '-Wl,--subsystem,windows'
  563. compiler: mingw-w64-clang
  564. deps:
  565. - build-essential
  566. - python3
  567. - python3-distutils
  568. - bison
  569. - automake
  570. - libtool
  571. - zip
  572. - unzip
  573. - libssl-dev
  574. - zlib1g-dev
  575. torbrowser-macos:
  576. - macos-universal
  577. - macos-x86_64
  578. - macos
  579. - torbrowser
  580. torbrowser-macos-x86_64:
  581. - macos-x86_64
  582. - macos
  583. - torbrowser
  584. torbrowser-macos-aarch64:
  585. - macos-aarch64
  586. - macos
  587. - torbrowser
  588. basebrowser-macos:
  589. - macos-universal
  590. - macos-x86_64
  591. - macos
  592. - basebrowser
  593. macos-universal:
  594. var:
  595. macos_universal: 1
  596. macos-aarch64:
  597. arch: aarch64
  598. var:
  599. macos-aarch64: 1
  600. macos-x86_64: 0
  601. osname: macos-aarch64
  602. macos_arch: arm64
  603. build_target: aarch64-apple-darwin
  604. gnu-build-triplet: x86_64-unknown-linux-gnu
  605. gnu-host-triplet: aarch64-apple-darwin
  606. macosx_deployment_target: '11.0'
  607. macos-x86_64:
  608. arch: x86_64
  609. var:
  610. macos-x86_64: 1
  611. osname: macos-x86_64
  612. macos_arch: x86_64
  613. build_target: x86_64-apple-darwin
  614. gnu-build-triplet: x86_64-unknown-linux-gnu
  615. gnu-host-triplet: x86_64-apple-darwin11
  616. macosx_deployment_target: '10.12'
  617. macos:
  618. var:
  619. macos: 1
  620. osname: macos
  621. container:
  622. suite: bullseye
  623. arch: amd64
  624. compiler: 'macosx-toolchain'
  625. 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") %]'
  626. FLAGS: "-target [% c('var/build_target') %] -B $cctoolsdir -isysroot $sysrootdir [% IF c('var/macos-aarch64') %]-mcpu=apple-m1[% END %]"
  627. LDFLAGS: "-Wl,-syslibroot,$sysrootdir -Wl,-dead_strip -Wl,-pie"
  628. locale_ja: ja-JP-mac
  629. rlbox: 0
  630. deps:
  631. - build-essential
  632. - faketime
  633. - python3
  634. - python3-distutils
  635. - automake
  636. - bison
  637. - libtool
  638. - zip
  639. - unzip
  640. - libssl-dev
  641. - zlib1g-dev
  642. faketime_path: /usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1
  643. # The no_build_id target can be useful if you want to quickly display
  644. # a build template or other option but don't want to spend time to
  645. # compute the various build ids
  646. no_build_id:
  647. # The defaut timestamp value will use the commit time of the
  648. # selected commit for the project, which will require cloning the
  649. # git repository if it is not present. When we use the no_build_id
  650. # target to display a script, we usually don't care about such
  651. # details, so we set timestamp to 0 to avoid unnecessary cloning.
  652. timestamp: 0
  653. var:
  654. build_id: 1
  655. no_containers:
  656. container:
  657. global_disable: 1
  658. # allow git tag signed using an expired key.
  659. # https://bugs.torproject.org/19737
  660. gpg_allow_expired_keys: 1
  661. --- |
  662. # This part of the file contains options written in perl
  663. use IO::CaptureOutput qw(capture_exec);
  664. (
  665. var_p => {
  666. nightly_torbrowser_version => sub {
  667. state $version = '';
  668. return $version if $version;
  669. my (undef, undef, undef, $day, $mon, $year) = gmtime;
  670. $version = sprintf("tbb-nightly.%u.%02u.%02u", $year + 1900, $mon + 1, $day);
  671. return $version;
  672. },
  673. nightly_torbrowser_incremental_from => sub {
  674. my ($project, $options) = @_;
  675. my $nightly_dir = project_config($project, 'basedir', $options) . '/nightly';
  676. my $current_version = project_config($project, 'var/torbrowser_version', $options);
  677. use Path::Tiny;
  678. return [] unless -d $nightly_dir;
  679. my @dirs = sort map { $_->basename } path($nightly_dir)->children(qr/^tbb-nightly\./);
  680. my $nb_incr = project_config($project, ['var', 'max_torbrowser_incremental_from'], $options);
  681. my @res;
  682. while ($nb_incr > 0) {
  683. my $dir = pop @dirs;
  684. last unless $dir;
  685. next if $dir eq $current_version;
  686. $nb_incr--;
  687. push @res, $dir;
  688. }
  689. return [@res];
  690. },
  691. },
  692. )