Genivia / ugrep

NEW ugrep 6.5: a more powerful, ultra fast, user-friendly, compatible grep. Includes a TUI, Google-like Boolean search with AND/OR/NOT, fuzzy search, hexdumps, searches (nested) archives (zip, 7z, tar, pax, cpio), compressed files (gz, Z, bz2, lzma, xz, lz4, zstd, brotli), pdfs, docs, and more
https://ugrep.com
BSD 3-Clause "New" or "Revised" License
2.56k stars 109 forks source link

Allow static building with `./build.sh --enable-static` #398

Closed fasterit closed 2 months ago

fasterit commented 2 months ago

Closes #373

Please run autoreconf -iv to update the autotools files in the repo from the updated configure.ac and commit that, too. Debian has 2.72 only in experimental and running an update on the 2.71 in stable / testing / unstable is just creating a lot of noise.

genivia-inc commented 2 months ago

Thanks for contributing!

I know the -static flag, but I'm unsure how to one can do #373 to locally install/add ugrep for a host OS without running into issues or crashes such as x86 32 bit OS versus x64 64 bit OS versus arm7 etc. There is some flexibility for x64, since ugrep x64 performs a CPU check to only use AVX2/512BW when available. It defaults to SSE2. I suppose various executables have to be hosted somewhere and picked in an install script based on a host CPU check?

fasterit commented 2 months ago

I would just build amd64 and arm64 variants of the executables, e.g. as part of your makemake.sh release process. Put them in bin/linux_amd64/ and bin/linux_arm64/ and people can just wget them as they can with the Windows versions right now.

This satisfies #373 and should be a reasonable help for people wanting to try out new versions not packaged for their distribution yet. Otherwise apt install or dnf install are the ways to go. Free updates, care from the distro maintainers etc. included that way.

Building for niche CPU architectures is not worth it from your (upstream) perspective. This is what distros do and the user base for ugrep on some MIPS router is likely too limited to be constantly worth your maintenance time. The apt install works on these architectures just the same. That's the magic of the better Linux distributions.

Best, DLange (Debian Developer)

genivia-inc commented 2 months ago

I would just build amd64 and arm64 variants of the executables, e.g. as part of your makemake.sh release process. Put them in bin/linux_amd64/ and bin/linux_arm64/ and people can just wget them as they can with the Windows versions right now.

Makes sense. I'll look into building a statically-linked x64/amd64 version on Debian and cross compile a statically-linked AAarch64/arm64 version.

It would be nice if this can be (semi-) automated e.g. in a container from GitHub actions. Perhaps there is a way.