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

feat: add musl linux build targets #759

Merged
merged 4 commits into from
Mar 3, 2024
Merged

Conversation

uznog
Copy link
Contributor

@uznog uznog commented Mar 1, 2024

Hopefully resolves #723 - adds two targets to the release matrix of Actions Workflow.

I also changed conditional for adding targets via rustup target add to happen for every target - mainly for consistency, but also because fromJson clause becomes more and more lengthy. I'm also open for discussion whether this step should actually happen at all, I haven't seen it in other Rust repos.

Cheers!

@sxyazi
Copy link
Owner

sxyazi commented Mar 2, 2024

Hi, thanks for the PR! I got this error when testing it:

  running: "musl-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "/home/runner/work/yazi-test-musl/yazi-test-musl/target/x86_64-unknown-linux-musl/release/build/onig_sys-7f6e2cee5be0aba3/out" "-I" "oniguruma/src" "-DHAVE_UNISTD_H=1" "-DHAVE_SYS_TYPES_H=1" "-DHAVE_SYS_TIME_H=1" "-o" "/home/runner/work/yazi-test-musl/yazi-test-musl/target/x86_64-unknown-linux-musl/release/build/onig_sys-7f6e2cee5be0aba3/out/oniguruma/src/regexec.o" "-c" "oniguruma/src/regexec.c"

  --- stderr


  error occurred: Failed to find tool. Is `musl-gcc` installed?


warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 101.

And the test repo here https://github.com/yazi-rs/yazi-test-musl/actions/runs/8119836215/job/22196249096

@uznog
Copy link
Contributor Author

uznog commented Mar 2, 2024

Still can't make aarch64 musl linux build as we're dealing with some linker errors:

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)
error: could not compile `yazi-fm` (bin "yazi") due to 1 previous error

I've isolated just musl targets on a separate branch to test things out (shoulda done it initially I guess, sorry! :D): https://github.com/uznog/yazi/actions/runs/8123545617/job/22204066982

I installed musl-tools, which makes x86_64 build work, but adding musl-dev doesn't make a difference. Tinkered with CC / RUSTFLAGS env variables with no luck as well and I'm kinda out of ideas, but I'm no Rust pro so I might be overthinking, any tips are welcome. GNU gcc for aarch64 should be able to compile it as of #rust-lang/stacker#80 (comment)

@sxyazi
Copy link
Owner

sxyazi commented Mar 3, 2024

No worries! I will play around with the other options and see if I can get this fixed.

@sxyazi sxyazi changed the title Added musl linux build targets feat: add musl linux build targets Mar 3, 2024
@sxyazi sxyazi merged commit cc54205 into sxyazi:main Mar 3, 2024
5 checks passed
asim215 pushed a commit to asim215/yazi that referenced this pull request Mar 5, 2024
asim215 added a commit to asim215/yazi that referenced this pull request Mar 5, 2024
* ci: add cachix workflow (sxyazi#740)

* feat: add hovered as `$0` for shell and opener (sxyazi#738)

* feat: flavor (sxyazi#753)

* feat: add a new `[notify]` section to the `theme.toml` to configure the `notify` component's style (sxyazi#749)

* feat: switch to inline images protocol for VSCode, Tabby, and Hyper

* feat: add `prepend_rules` and `append_rules` for `[open]` in `yazi.toml` (sxyazi#754)

* feat: support `YAZI_FILE_ONE` environment variable for `file(1)` path (sxyazi#752)

* feat: allow both '/' and '\' in folder creation (sxyazi#751)

* perf: apply `add_many()`/`remove_many()` to the visual mode items for selection conflict detecting (sxyazi#758)

* feat: support `%0` as the hovered file for Windows (sxyazi#761)

* feat: `ya.input()` plugin API (sxyazi#762)

* fix: remove redundant check to allow operations on the `shell` command with an empty file list

* feat: add musl linux build targets (sxyazi#759)

* fix: nested conflict detection exception when performing cross-level searches (sxyazi#769)

* refactor: add new `run` property (sxyazi#773)

* feat: add `Ctrl-[` as an escape key (sxyazi#763)

* feat: add `parse` method to `Line` element

* feat: `ya.notify()` plugin API (sxyazi#780)

---------

Co-authored-by: musjj <72612857+musjj@users.noreply.github.com>
Co-authored-by: rrveex <91850165+rrveex@users.noreply.github.com>
Co-authored-by: sxyazi <sxyazi@gmail.com>
Co-authored-by: little camel <54983536+evpeople@users.noreply.github.com>
Co-authored-by: Filipe Paniguel <paniguel.lpnh@gmail.com>
Co-authored-by: Nguyễn Đức Toàn <33489972+ndtoan96@users.noreply.github.com>
Co-authored-by: Konrad Baran <65494005+uznog@users.noreply.github.com>
Co-authored-by: hankertrix <91734413+hankertrix@users.noreply.github.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linux musl release
2 participants