Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with static link libs during the build from source #1273

Open
mkenchugonde opened this issue Feb 16, 2025 · 1 comment
Open

Issue with static link libs during the build from source #1273

mkenchugonde opened this issue Feb 16, 2025 · 1 comment

Comments

@mkenchugonde
Copy link

Details about the machine

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.5 LTS"

I am trying to build the watchman from source and it is successful with below files.

+ find built -ls
137309098      0 drwxrwxr-x   4 ubuntu   ubuntu         28 Feb 16 09:29 built
268848602      0 drwxrwxr-x   2 ubuntu   ubuntu         68 Feb 16 10:49 built/lib
268848603   1268 -rw-r--r--   1 ubuntu   ubuntu    1296864 Feb 16 10:49 built/lib/libglog.so.0
268848604    512 -rwxr-xr-x   1 ubuntu   ubuntu     522360 Feb 16 10:49 built/lib/libunwind.so.8
268848618    756 -rwxr-xr-x   1 ubuntu   ubuntu     774096 Feb 16 10:49 built/lib/liblzma.so.5
403124736      0 drwxrwxr-x   2 ubuntu   ubuntu         41 Feb 16 10:49 built/bin
403124748  15844 -rwxr-xr-x   1 ubuntu   ubuntu   16224064 Feb 16 10:49 built/bin/watchmanctl
403124749 344032 -rwxr-xr-x   1 ubuntu   ubuntu   352286304 Feb 16 10:49 built/bin/watchman

However, whenever I try to build a deb package, it fails on the below step during the /lib directory deletion.

# This is an implicit assertion that the `lib` directory is empty.
# We statically link dependencies for packaging purposes.
rmdir "$BUILT/lib"

As per the comments, it is expected to not have any files inside the lib/ directory but the ./autogen.sh command is generating three lib files as mentioned above. I am not very good at building the packages and want to understand what will fix this. FYI, I tried sudo apt-get install libgoogle-glog-dev libunwind-dev liblzma-dev and it didn't help.

@mkenchugonde
Copy link
Author

Instead of rmdir "$BUILT/lib", adding these below lines helped to fix the build and create a deb file successfully.

cp "$BUILT/lib/libglog.so.0" "$PREFIX/lib/"
cp "$BUILT/lib/liblzma.so.5" "$PREFIX/lib/"
cp "$BUILT/lib/libunwind.so.8" "$PREFIX/lib/"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant