Open linaran opened 1 year ago
Hi @linaran
I think that's somewhat expected. Ubuntu 22 has all of the system deps required to statically build Watchman, so lib/ should be empty.
I just did a build myself:
Process deps under /tmp/fbcode_builder_getdeps-ZhomeZvagrantZwatchmanZbuildZfbcode_builder/installed/watchman/usr/local
Consider bin/watchman
Munging built/bin/watchman
Consider bin/watchmanctl
Munging built/bin/watchmanctl
+ find built -ls
506 1 drwxr-xr-x 1 vagrant vagrant 128 Jan 18 23:42 built
508 1 drwxr-xr-x 1 vagrant vagrant 96 Jan 18 23:42 built/bin
510 7294 -rwxr-xr-x 1 vagrant vagrant 7468328 Jan 18 23:42 built/bin/watchmanctl
509 289258 -rwxr-xr-x 1 vagrant vagrant 296199936 Jan 18 23:42 built/bin/watchman
507 1 drwxr-xr-x 1 vagrant vagrant 64 Jan 18 23:42 built/lib
vagrant@watchman-ubuntu-22:~/watchman$ ldd built/bin/watchman
linux-vdso.so.1 (0x00007ffe7edfd000)
libglog.so.0 => /lib/x86_64-linux-gnu/libglog.so.0 (0x00007f7e54d3d000)
libpcre2-8.so.0 => /lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007f7e54ca6000)
libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3 (0x00007f7e54864000)
libboost_context.so.1.74.0 => /lib/x86_64-linux-gnu/libboost_context.so.1.74.0 (0x00007f7e5485f000)
libgflags.so.2.2 => /lib/x86_64-linux-gnu/libgflags.so.2.2 (0x00007f7e54836000)
libdouble-conversion.so.3 => /lib/x86_64-linux-gnu/libdouble-conversion.so.3 (0x00007f7e5481f000)
libevent-2.1.so.7 => /lib/x86_64-linux-gnu/libevent-2.1.so.7 (0x00007f7e547cb000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f7e547af000)
libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f7e5479c000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f7e54771000)
liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x00007f7e54751000)
libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007f7e54680000)
libsnappy.so.1 => /lib/x86_64-linux-gnu/libsnappy.so.1 (0x00007f7e54676000)
libunwind.so.8 => /lib/x86_64-linux-gnu/libunwind.so.8 (0x00007f7e5465b000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f7e54431000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7e5434a000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7e5432a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7e54100000)
/lib64/ld-linux-x86-64.so.2 (0x00007f7e556d5000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7e540fb000)
vagrant@watchman-ubuntu-22:~/watchman$ ls -lA built/lib/
total 0
vagrant@watchman-ubuntu-22:~/watchman$
Maybe the issue is that you need your follow-on Docker images to also have the Watchman system dependencies installed? The ones you get from install-system-packages.sh
Hi @chadaustin thanks for the answer, it provided some clarity on the matter.
Apparently install-system-packages.sh
installs the needed dynamic libs. Do we know whether it supports the arm64
architecture (I don't have an M1 on hand right now)? If it does I'll just copy the libs from the ldd
output.
I tried deleting the install-system-packages.sh
step, thinking the autogen
would be forced to build everything from source but this didn't work. but it didn't work. There wasn't a clear error it just indicated it didn't have permission to fetch something.
Oh, I'm interested to hear which URL failed to fetch if you ran autogen.sh without install-system-packages.sh. That should work.
Regarding M1: Are you running Ubuntu 22 on Linux ARM? Or trying to do the same process on macOS?
Hi @chadaustin sorry for not replying earlier. I had to put the watchman build aside to take care of some daily tasks.
The following is outlining the last ~100 lines of output I get from running autogen.sh
without install-system-packages.sh
:
...
#8 508.5 Extract /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/downloads/bz2-bzip2-1.0.8.tar.gz -> /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/extracted/bz2-bzip2-1.0.8.tar.gz
#8 508.5 Building bz2...
#8 508.5 copying to /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/bz2-WmudzWXERQh8i3puKIB9pJA4sjRY3Dj2zgUFfj-vS1g/lib from /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/extracted/bz2-bzip2-1.0.8.tar.gz/bzip2-1.0.8/lib*.so.*
#8 508.5 Assessing autoconf...
#8 508.5 Download with http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz -> /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/downloads/autoconf-autoconf-2.69.tar.gz ...
#8 508.5 .. 8192 of 1927468 [Complete in 1.846614 seconds]
#8 508.5 ---
#8 508.5 + CMAKE_PREFIX_PATH=\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/bz2-WmudzWXERQh8i3puKIB9pJA4sjRY3Dj2zgUFfj-vS1g:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/pcre2-TyI6qoqG5E2gGa6OE29Tqajnw57IhN0vQ56iI7RdYZE:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/snappy-h_KzpVegtt6XsV6pj1CNolhUaK0iVoV7wzqkfBLFzMI:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/lz4-xd6mJ7QYPzpCF_bWp_W_gpRm3PjG5lfZXIKC0AqxwiM:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/libevent-TTGX3yvMj7tM_-irPHIdCPWVARuMkvUQcMqMQ4lihBA:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/double-conversion-1idNPtu83WURnTLTtUHo2RkGR7D86dF1W_aS62q92RE:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/zstd-RO3K7AZWFQmlsbcdcKPKe9stL6wGs6Zq0ANIybzoKcI:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/python-six-nhebplBMTRGDttYNGl9K4FXlggVx4YBg_CmocKNVUb0:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/googletest-Z_jguW5au5_syD_mneGMGi5WiJpHELVtPxpO3NstjpE:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/fmt-w0W1wfYPegX3AKIwrQYz-ctOqTrMxtAXeW7TUEBEMuc:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/glog-qh25aMVDYjzMupdcBKXY5BljYQAfFC7FCt_bJ6MZ4fo:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/gflags-w5RQqABXSPr0RmiJ_BAgHMZJuqXh3aY8LAu6oK8iyd4:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/cpptoml-ReJ593INBtGfPwdMOwwgmFFoMMlxcuG3y6VBstHq3T8:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/ninja-waavEb_WVz_G5pJOMfZzKfuIejkYsQfmLWa_mYI7LiA:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/boost-jS_cOpB0gk-vV49rg7RzGdmK8mRH8AnWHEqWKR52ZqE:\
#8 508.5 + CPPFLAGS=-I/tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/bz2-WmudzWXERQh8i3puKIB9pJA4sjRY3Dj2zgUFfj-vS1g/include \
#8 508.5 + GETDEPS_BUILD_DIR=/tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/build \
#8 508.5 + GETDEPS_INSTALL_DIR=/tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed \
#8 508.5 + LDFLAGS=-L/tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/bz2-WmudzWXERQh8i3puKIB9pJA4sjRY3Dj2zgUFfj-vS1g/lib \
#8 508.5 + LD_LIBRARY_PATH=\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/bz2-WmudzWXERQh8i3puKIB9pJA4sjRY3Dj2zgUFfj-vS1g/lib:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/pcre2-TyI6qoqG5E2gGa6OE29Tqajnw57IhN0vQ56iI7RdYZE/lib:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/snappy-h_KzpVegtt6XsV6pj1CNolhUaK0iVoV7wzqkfBLFzMI/lib:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/lz4-xd6mJ7QYPzpCF_bWp_W_gpRm3PjG5lfZXIKC0AqxwiM/lib:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/libevent-TTGX3yvMj7tM_-irPHIdCPWVARuMkvUQcMqMQ4lihBA/lib:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/double-conversion-1idNPtu83WURnTLTtUHo2RkGR7D86dF1W_aS62q92RE/lib:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/zstd-RO3K7AZWFQmlsbcdcKPKe9stL6wGs6Zq0ANIybzoKcI/lib:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/python-six-nhebplBMTRGDttYNGl9K4FXlggVx4YBg_CmocKNVUb0/lib:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/googletest-Z_jguW5au5_syD_mneGMGi5WiJpHELVtPxpO3NstjpE/lib:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/fmt-w0W1wfYPegX3AKIwrQYz-ctOqTrMxtAXeW7TUEBEMuc/lib:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/glog-qh25aMVDYjzMupdcBKXY5BljYQAfFC7FCt_bJ6MZ4fo/lib:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/gflags-w5RQqABXSPr0RmiJ_BAgHMZJuqXh3aY8LAu6oK8iyd4/lib:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/cpptoml-ReJ593INBtGfPwdMOwwgmFFoMMlxcuG3y6VBstHq3T8/lib:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/boost-jS_cOpB0gk-vV49rg7RzGdmK8mRH8AnWHEqWKR52ZqE/lib:\
#8 508.5 + PATH=\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/bz2-WmudzWXERQh8i3puKIB9pJA4sjRY3Dj2zgUFfj-vS1g/bin:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/pcre2-TyI6qoqG5E2gGa6OE29Tqajnw57IhN0vQ56iI7RdYZE/bin:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/lz4-xd6mJ7QYPzpCF_bWp_W_gpRm3PjG5lfZXIKC0AqxwiM/bin:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/libevent-TTGX3yvMj7tM_-irPHIdCPWVARuMkvUQcMqMQ4lihBA/bin:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/zstd-RO3K7AZWFQmlsbcdcKPKe9stL6wGs6Zq0ANIybzoKcI/bin:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/gflags-w5RQqABXSPr0RmiJ_BAgHMZJuqXh3aY8LAu6oK8iyd4/bin:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/ninja-waavEb_WVz_G5pJOMfZzKfuIejkYsQfmLWa_mYI7LiA/bin:\
#8 508.5 + /usr/local/cargo/bin:\
#8 508.5 + /usr/local/sbin:\
#8 508.5 + /usr/local/bin:\
#8 508.5 + /usr/sbin:\
#8 508.5 + /usr/bin:\
#8 508.5 + /sbin:\
#8 508.5 + /bin:\
#8 508.5 + PKG_CONFIG_PATH=\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/pcre2-TyI6qoqG5E2gGa6OE29Tqajnw57IhN0vQ56iI7RdYZE/lib/pkgconfig:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/lz4-xd6mJ7QYPzpCF_bWp_W_gpRm3PjG5lfZXIKC0AqxwiM/lib/pkgconfig:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/libevent-TTGX3yvMj7tM_-irPHIdCPWVARuMkvUQcMqMQ4lihBA/lib/pkgconfig:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/zstd-RO3K7AZWFQmlsbcdcKPKe9stL6wGs6Zq0ANIybzoKcI/lib/pkgconfig:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/googletest-Z_jguW5au5_syD_mneGMGi5WiJpHELVtPxpO3NstjpE/lib/pkgconfig:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/fmt-w0W1wfYPegX3AKIwrQYz-ctOqTrMxtAXeW7TUEBEMuc/lib/pkgconfig:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/glog-qh25aMVDYjzMupdcBKXY5BljYQAfFC7FCt_bJ6MZ4fo/lib/pkgconfig:\
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/gflags-w5RQqABXSPr0RmiJ_BAgHMZJuqXh3aY8LAu6oK8iyd4/lib/pkgconfig:\
#8 508.5 + PYTHONPATH=/tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/python-six-nhebplBMTRGDttYNGl9K4FXlggVx4YBg_CmocKNVUb0/lib/fb-py-libs/python-six \
#8 508.5 + SSL_CERT_DIR=/etc/ssl/certs \
#8 508.5 + cd /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/build/autoconf-7vHkLZZ00NJmsd6SR6HEChHbVArZAx2Rp07DUsnjtIM && \
#8 508.5 + /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/extracted/autoconf-autoconf-2.69.tar.gz/autoconf-2.69/configure \
#8 508.5 + --prefix=/tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/installed/autoconf-7vHkLZZ00NJmsd6SR6HEChHbVArZAx2Rp07DUsnjtIM
#8 508.5 checking for a BSD-compatible install... /usr/bin/install -c
#8 508.5 checking whether build environment is sane... yes
#8 508.5 checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
#8 508.5 checking for gawk... no
#8 508.5 checking for mawk... mawk
#8 508.5 checking whether make sets $(MAKE)... yes
#8 508.5 checking build system type... x86_64-unknown-linux-gnu
#8 508.5 checking host system type... x86_64-unknown-linux-gnu
#8 508.5 configure: autobuild project... GNU Autoconf
#8 508.5 configure: autobuild revision... 2.69
#8 508.5 configure: autobuild hostname... buildkitsandbox
#8 508.5 configure: autobuild timestamp... 20230126T114225Z
#8 508.5 checking whether /bin/sh -n is known to work... no
#8 508.5 checking for characters that cannot appear in file names... none
#8 508.5 checking whether directories can have trailing spaces... yes
#8 508.5 checking for expr... /usr/bin/expr
#8 508.5 checking for GNU M4 that supports accurate traces... configure: error: no acceptable m4 could be found in $PATH.
#8 508.5 GNU M4 1.4.6 or later is required; 1.4.16 or newer is recommended.
#8 508.5 GNU M4 1.4.15 uses a buggy replacement strstr on some systems.
#8 508.5 Glibc 2.9 - 2.12 and GNU M4 1.4.11 - 1.4.15 have another strstr bug.
#8 508.5 Date: Thu, 26 Jan 2023 11:42:22 GMT
#8 508.5 Server: Apache/2.4.29 (Trisquel_GNU/Linux)
#8 508.5 Last-Modified: Wed, 25 Apr 2012 03:17:16 GMT
#8 508.5 ETag: "1d692c-4be784eedf4ad"
#8 508.5 Accept-Ranges: bytes
#8 508.5 Content-Length: 1927468
#8 508.5 Content-Security-Policy: default-src 'self'; img-src 'self' https://static.fsf.org https://static.gnu.org https://gnu.org http://static.fsf.org http://static.gnu.org http://gnu.org; object-src 'none'; frame-ancestors 'none'; child-src 'self' https://static.gnu.org http://static.fsf.org http://static.gnu.org http://gnu.org;
#8 508.5 X-Frame-Options: DENY
#8 508.5 X-Content-Type-Options: nosniff
#8 508.5 Connection: close
#8 508.5 Content-Type: application/x-gzip
#8 508.5
#8 508.5
#8 508.5 Extract /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/downloads/autoconf-autoconf-2.69.tar.gz -> /tmp/fbcode_builder_getdeps-ZwatchmanZbuildZfbcode_builder-root/extracted/autoconf-autoconf-2.69.tar.gz
#8 508.5 Building autoconf...
------
executor failed running [/bin/sh -c ./autogen.sh]: exit code: 1
I don't see a clear error here aside from those last few lines indicating that fetch to some resource was denied i.e. #8 508.5 X-Frame-Options: DENY
. Note that the build consistently fails with this output and I made sure to have enough space for docker to finish the build without issues.
I tried running autogen.sh
without install-system-packages.sh
to maybe force the build to compile and add libs to the libs folder.
Regarding your question, I'm running Ubuntu 22 in docker on intel macOS. That said the goal is to find a process that would work on ARM64 macOS as well.
EDIT: X-Frame-Options: DENY
is a response telling the client that the result can't be used in a frame
etc. It doesn't necessarily indicate a failed fetch (my bad). That said, I can't tell how the build failed in the end.
I've also spent the previous day attempting to compile Watchman under the macOS ARM arch without much luck. I too need to support both a mix of x86 and ARM computers that are running our apps. I too haven't managed to have any luck trying to compile from source and followed a similar pattern to the suggested methods (using autogen.sh to fetch the needed files) but keeping running into various issues, the latest being:
2604.0 c++: fatal error: Killed signal terminated program cc1plus
Has anyone else had more success?
As a workaround to this, I've marked the container that runs watchman
to be run as AMD64 using the platform
directive in docker-compose. Ideally, native ARM support for watchman would be welcome
Hi, I'm trying to build watchman from source (trying to support both x64 and arm64 architectures) using the following dockerfile:
After building (the build finishes without errors) the dockerfile I enter the container to see the results. I see the
watchman
directory with the following content:I look into the
built
folder to see the following:I find it strange that the
built/lib
folder is empty. I assumed, after building from the source that I would just follow theprebuilt binary
steps to install watchman:Thinking the binary was fully statically built, I tried proceeding without the
lib
folder. This failed withwatchman
asking for one such library. Looking at what the prebuilt binaries offer, thelib
should contain the following:I was unable to find these libs, either in the
built/lib
folder or in the container.For more context, my goal is to use the results of this build in another container i.e. I'm building my final docker image through multiple stages and this is just the
watchman
stage. I need to know where thebin
andlib
are to copy them to the next stage.Thank you for your answers.
P.S. I tried the same steps with the same result relying on the rust official image which uses
debian:bullseye
.