chshersh / tool-sync

🧰 Download pre-built binaries of all your favourite tools with a single command
https://crates.io/crates/tool-sync
Mozilla Public License 2.0
69 stars 16 forks source link

[#87] Use statically linked binaries for linux #95

Closed chshersh closed 1 year ago

chshersh commented 1 year ago

Resolves #87

chshersh commented 1 year ago

I checked that the binary is indeed statically linked:

~/Downloads/tool-x86_64-unknown-linux-musl$ ldd tool 
    statically linked

~/Downloads/tool-x86_64-unknown-linux-gnu$ ldd tool
    linux-vdso.so.1 (0x00007fffb8469000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd588bfe000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd588bdb000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd588a8c000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd588a86000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd588894000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fd588f4e000)
chshersh commented 1 year ago

The release with assets is here:

I'll keep it for now (in case anyone wants to test it) but I'll delete it before making an actual v0.2.0 release (so don't really on it!)

MitchellBerend commented 1 year ago

This looks like a good change but why do we need to keep the dynamically linked one?

chshersh commented 1 year ago

This looks like a good change but why do we need to keep the dynamically linked one?

It's a bit awkward situation due to mutual dependency. tool-sync is hardcoded in the DB with the dynamically linked asset:

https://github.com/chshersh/tool-sync/blob/65b53bdbb51fcbe59d5c57a2b5bd1d9181ea6fcf/src/sync/db.rs#L86-L96

And it's used in tests:

https://github.com/chshersh/tool-sync/blob/65b53bdbb51fcbe59d5c57a2b5bd1d9181ea6fcf/.github/workflows/ci.yml#L100

Unfortunately, GitHub API doesn't return draft releases as latest. So I can only update the test and hard-coded tool-sync info only if there's a release with musl assets.

So the easiest solution would be to just keep both of them and remove the dynamically linked asset for the v0.3.0 version after the v0.2.0 release goes live.