facebook / watchman

Watches files and records, or triggers actions, when they change.
https://facebook.github.io/watchman/
MIT License
12.57k stars 987 forks source link

Build FB libraries from Github release instead of git clone #1007

Closed istiak101 closed 1 year ago

istiak101 commented 2 years ago

I am trying to package rpm for watchman. In order to keep the build environment reproducible I had to patch all the dependencies manifests and get them from local sources. Otherwise my build would fail time to time if it fails to download any package.

diff -urN a/build/fbcode_builder/manifests/boost b/build/fbcode_builder/manifests/boost
--- a/build/fbcode_builder/manifests/boost
+++ b/build/fbcode_builder/manifests/boost
@@ -2,7 +2,7 @@
 name = boost

 [download.not(os=windows)]
-url = https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.gz
+url = file:///builddir/build/SOURCES/boost_1_78_0.tar.gz
 sha256 = 94ced8b72956591c4775ae2207a9763d3600b30d9d7446562c552f0a14a63be7

 [download.os=windows]

I did it for all the dependencies except those are git repository of Facebook. Is it possible to use a Github release instead of git cloning Fizz, FBThrift, Wangle, Folly, etc?

 [git]
-repo_url = https://github.com/facebook/folly.git

https://github.com/facebook/folly/releases/download/v2022.02.28.00/folly-v2022.02.28.00.tar.gz https://github.com/facebook/fbthrift/archive/refs/tags/v2020.08.24.00.tar.gz https://github.com/facebookincubator/fizz/releases/download/v2022.02.28.00/fizz-v2022.02.28.00.tar.gz https://github.com/facebook/wangle/releases/download/v2022.02.28.00/wangle-v2022.02.28.00.tar.gz

istiak101 commented 2 years ago

BTW for some reason --allow-system-packages don't work which previously worked on older versions of watchman source. This is increasing my overall build time. I do have all the dependencies installed on mock chroot.

chadaustin commented 2 years ago

I don't think getdeps supports exactly what you want, but it could be implemented. The specific checked out commit hash is pinned in https://github.com/facebook/watchman/tree/cd04a2e47809dcf5731f7f108b807d3e3dba1a48/build/deps/github_hashes, so assuming a perfectly reliable network, the build should have reproducible dependencies.

In theory you could mirror the Git repos and somehow redirect fetches to use the local mirror instead.

Bazukakape commented 1 year ago

BTW, por algum motivo --allow-system-packages não funcionam, o que funcionava anteriormente em versões mais antigas do watchman source. Isso está aumentando meu tempo geral de construção. Eu tenho todas as dependências instaladas no mock chroot.