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

Static aura build #936

Open
ultimatespirit opened this issue Sep 17, 2024 · 1 comment
Open

Static aura build #936

ultimatespirit opened this issue Sep 17, 2024 · 1 comment

Comments

@ultimatespirit
Copy link

ultimatespirit commented Sep 17, 2024

This is more of an AUR request honestly, though it perhaps may just be something that shouldn't be happening. It appears that the rust version of aura cannot survive an update to the pacman libalpm.so libraries, requiring a specific library version and thereby failing if the library got updated by pacman -Syu (as it did from the pacman 7.0 release). For haskell we had the option of using stack-static (which you may recall I brought up for fixing the aura pkgbuild many years ago now :P) to make aura more or less resistant across system updates, so it could at least bootstrap itself back instead of needing to use makepkg manually again.

The user-side fix to that is of course simple, just go to your checked out aura repo and run makepkg accordingly. But, it would also be great if it was feasible to similarly "future-proof" the rust version of aura through static linking, like what users had the option of doing with the haskell version.

Fortunately, it appears that the rust dependencies for aura all work with static linking, tossing RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --target x86_64-unknown-linux-gnu at the build worked fine for getting all deps. However, aura depends upon pacman (and through it libcurl) and both of those sadly do not have static linking by default on arch. And unlike the stack-static case it's probably pretty bad idea for users to go ahead and use pacman-static by default.

While it definitely makes it more unwieldy, so an even larger trade-off, and I haven't tested this out yet, I think what can be done here though is making an aura-static AUR build that adapts the pacman-static PKGBUILD to get a statically linked libcurl and pacman available in the build root, and then builds aura statically.

I ask this here, rather than on the aura AUR page, for two main reasons:

  1. See if the libalpm breakage was actually an unexpected bug, and aura right now is supposed to be able to handle its dynamically linked libraries being updated (and isn't doing that). (EDIT: Forgot to add, I assume this one was the case due to seeing Issue Error libalpm.so.14 cannot open shared object file: No such file or directory #931, but wanted to confirm)
  2. See how feasible static building aura even is, in case cargo managing to get all the way to the final build step in static mode does not imply that the Rust dependencies are actually okay being static. I know some Rust dependencies actually require having alternative options for the static case / differing libraries, and didn't pay too close attention to what libraries aura was using as the build scrolled by.
@fosskers
Copy link
Owner

The first thing to try is to see what effect this feature flag has: https://github.com/archlinux/alpm.rs/blob/master/alpm/Cargo.toml#L25

If libalpm itself can be vendored, then that should be enough.

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

No branches or pull requests

2 participants