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

Suggested environment for static build? #75

Closed
Phantop opened this issue Mar 2, 2022 · 8 comments
Closed

Suggested environment for static build? #75

Phantop opened this issue Mar 2, 2022 · 8 comments

Comments

@Phantop
Copy link

Phantop commented Mar 2, 2022

I'm trying to do a static build of dwarfs so I can run the latest commit on the wip branch on Alpine Linux. This is due to musl libc not having all of the headers needed to build dwarfs and the lack of a jemalloc package in Alpine's repositories. The development packages provided in my distribution of choice (Solus) don't seem to work properly with the static build option. How exactly are the binaries on the releases page compiled?

On a side note, are the commits sitting on the wip branch every going to find their way into a release? I feel like some very useful features, namely cache cleanup, were added in those commits.

@mhx
Copy link
Owner

mhx commented Mar 3, 2022

I'm trying to do a static build of dwarfs so I can run the latest commit on the wip branch on Alpine Linux. This is due to musl libc not having all of the headers needed to build dwarfs and the lack of a jemalloc package in Alpine's repositories. The development packages provided in my distribution of choice (Solus) don't seem to work properly with the static build option. How exactly are the binaries on the releases page compiled?

The release binaries are currently built on a VirtualBox VM running Ubuntu 20.04. Getting static builds to work across different distributions is likely not trivial.

On a side note, are the commits sitting on the wip branch every going to find their way into a release? I feel like some very useful features, namely cache cleanup, were added in those commits.

Yes, eventually. I was actually eager to work on some features before pushing out a new release, but I don't currently find the time. I'll try and merge the parts that are complete from wip and make a new release, but not in the next 2 weeks as I'll be mostly AFK.

@Phantop
Copy link
Author

Phantop commented Mar 3, 2022

The release binaries are currently built on a VirtualBox VM running Ubuntu 20.04. Getting static builds to work across different distributions is likely not trivial.

I tried to compile it myself on an Ubuntu chroot and got the follow errors. Any ideas on what I can do about them?

make[2]: *** No rule to make target '_TMP_LIB_LOC_static_libacl-NOTFOUND', needed by 'dwarfsck'.  Stop.
make[2]: *** Waiting for unfinished jobs....
make[2]: *** No rule to make target '_TMP_LIB_LOC_static_libacl-NOTFOUND', needed by 'mkdwarfs'.  Stop.
make[2]: *** Waiting for unfinished jobs....
make[2]: *** No rule to make target '_TMP_LIB_LOC_static_libacl-NOTFOUND', needed by 'dwarfs'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[ 97%] Building CXX object CMakeFiles/dwarfsck.dir/src/dwarfsck.cpp.o
[ 97%] Building CXX object CMakeFiles/mkdwarfs.dir/src/mkdwarfs.cpp.o
[ 97%] Building CXX object CMakeFiles/dwarfs-bin.dir/src/dwarfs.cpp.o
make[2]: *** No rule to make target '_TMP_LIB_LOC_static_libacl-NOTFOUND', needed by 'dwarfsextract'.  Stop.
make[2]: *** Waiting for unfinished jobs....
make[2]: *** No rule to make target '_TMP_LIB_LOC_static_libacl-NOTFOUND', needed by 'dwarfsbench'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[ 98%] Building CXX object CMakeFiles/dwarfsextract.dir/src/dwarfsextract.cpp.o
[ 98%] Building CXX object CMakeFiles/dwarfsbench.dir/src/dwarfsbench.cpp.o
make[1]: *** [CMakeFiles/Makefile2:519: CMakeFiles/dwarfsbench.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:451: CMakeFiles/dwarfs-bin.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:485: CMakeFiles/dwarfsck.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:612: CMakeFiles/dwarfsextract.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:417: CMakeFiles/mkdwarfs.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

@mhx
Copy link
Owner

mhx commented Mar 4, 2022

Any ideas on what I can do about them?

I don't have access to the VM now (for the next two weeks actually). It looks like it's not finding a statically linkable libacl. I'll get back to you once I can access the VM again.

@mhx
Copy link
Owner

mhx commented Mar 18, 2022

Okay, I've just had a look at the VM and from what I see I had to build/install the following libraries manually as Ubuntu would not have static libraries to link against:

acl-2.2.53
bzip2-1.0.8
libarchive-3.4.0
libxml2-2.9.10+dfsg
nettle-3.5.1+really3.5.1

That being said, static builds are currently broken on both the main and wip branches due to facebook/folly#1623.

@mhx
Copy link
Owner

mhx commented Jun 10, 2022

Just a quick update that I've got static builds working again. I'll try and get a release out as soon as possible.

@mhx mhx closed this as completed in 7b8b25a Jun 10, 2022
@mhx
Copy link
Owner

mhx commented Jun 10, 2022

Please check the docs for setting up a static build environment.

@Phantop
Copy link
Author

Phantop commented Jun 11, 2022

I tried it on a 22.04 chroot and it worked easily with the instructions you gave in the README. Thanks a ton!

@mhx
Copy link
Owner

mhx commented Jun 11, 2022

Awesome! Thanks for testing!

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

2 participants