leptos-rs / cargo-leptos

Build tool for Leptos (Rust)
MIT License
315 stars 88 forks source link

Fixed musl binary download for cargo-generate #166

Closed rdbo closed 10 months ago

rdbo commented 10 months ago

Added detection for Linux targets that use the musl libc on the download of the cargo-generate binary. The current main branch does not do any detection for it, only for SASS. With this pull request, I managed to get cargo-leptos and leptos itself fully working on Alpine Linux.

aperepel commented 10 months ago

Leaving a note here to review when #168 is merged, as I did extensive refactoring of the commands there.

rdbo commented 10 months ago

Leaving a note here to review when #168 is merged, as I did extensive refactoring of the commands there.

I could make another PR when yours get merged. Since I use a Linux with musl, I could also test mine and your changes right away.

aperepel commented 10 months ago

Hey @rdbo , the #168 has been merged. Feel free to update this PR, the changes will go into the https://github.com/leptos-rs/cargo-leptos/blob/3320ec6f029482cf292853edec64fb582341385d/src/ext/exe.rs#L496 function impls.

I don't have a musl-based linux readily accessible at the moment, but looking over the changes, was wondering - should this logic be applied to other commands, too? Would appreciate if you could check if it applies to other command binaries and update. Thanks!

rdbo commented 10 months ago

There already is a check for SASS for musl, but not for cargo-generate. As for the other binaries, they seem to be statically compiled, since they are very big. I will double check though. Working on the PR.

rdbo commented 10 months ago

@aperepel rebased from your changes and added the proper cargo-generate binary download for musl. Everything is fine, I got the leptos-rs/start template to work :+1: As for the other binaries, they are statically linked, so they're the same on glibc and musl.