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

Missing libresvg.a for musl - Compilation Blocker for usql on Alpine or Nix builds #1

Open
JuryA opened this issue Dec 8, 2024 · 4 comments

Comments

@JuryA
Copy link

JuryA commented Dec 8, 2024

The static library libresvg.a is missing for the musl libc environment, causing significant build issues for projects that depend on resvg, such as usql. Additionally, this issue disrupts Nix builds, as noted in xo/usql#494

Problem Description:

  • The dependency on libresvg.a is incompatible with musl, resulting in failed builds in musl-based environments (e.g., Alpine Linux).
  • This issue also affects Nix builds, as outlined in the referenced issue. The combination of these problems creates significant obstacles for compiling dependent projects across various environments.

Steps to Reproduce:

  1. Use a musl-based environment (e.g., Alpine Linux).
  2. Attempt to compile a project that depends on resvg, such as usql.
  3. Observe the failure caused by the absence of libresvg.a.
  4. Alternatively, attempt to build usql using Nix and encounter the same issue (see Build breaks on arm64, armv7, i386: undefined reference to `resvg_parse_tree_from_data' usql#494).

Expected Behavior:

  • The build process should successfully compile the project by including a musl-compatible version of libresvg.a.
  • Nix builds should proceed without errors stemming from the missing dependency.

Actual Behavior:

  • Compilation fails with errors indicating the absence of libresvg.a in musl environments.
  • Nix builds are similarly disrupted, further exacerbating the issue.

Proposed Solution:

  • Provide a precompiled musl-compatible version of libresvg.a.
  • Ensure compatibility with Nix builds, potentially by bundling the required static library or generating it dynamically during the build process.

Environment:

  • OS: musl-based (e.g., Alpine Linux)
  • Build Tool: Nix
  • Project: usql
  • Dependency: resvg

This enhancement is critical to restoring build compatibility in musl environments and with Nix. Resolving this issue will unblock a broader range of use cases and enable smoother integration with dependent projects.

@kenshaw
Copy link
Member

kenshaw commented Dec 8, 2024

@JuryA I can appreciate the issue/concern, and understand the problem. Specifically, what "dependent projects", other than usql does this affect?

@JuryA
Copy link
Author

JuryA commented Dec 8, 2024

I’m not entirely sure I understand the question. It’s unclear how this affects other projects; its primary impact seems to be on usql, likely due to the way it has been implemented.

@kenshaw
Copy link
Member

kenshaw commented Dec 9, 2024

@JuryA I was asking because I was curious if, somehow, there were other users of this package.

I'm not really sure how this can be easily fixed. If this is something you're able to fix, I'd welcome a PR, as I just don't have the ability to support every platform out there -- be it FreeBSD, Nix, Alpine Linux, or something else. If you even had a pointer on doing this, I'd appreciate it (especially if it was something trivial/easy to do, because then I could get it done, and not have to spend a lot of time researching things), but as it is, this would require me to install/configure VMs for FreeBSD, etc. which I'm not able to do "soon."

With usql I intend to eventually have a build tag that completely disables the terminal graphics, and the use of this package, but I can't really provide an ETA on when that work might be done. I'll prioritize that, to the best of my abilities, but please understand the limited time and bandwidth I'm able to dedicate to this.

@kenshaw
Copy link
Member

kenshaw commented Dec 9, 2024

I have cut a new usql release that removes all dependencies for resvg, by removing the \chart command. Please note that this is temporary until the \chart command is in better shape. I'll publish the release as soon as it's done building.

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