Skip to content

Conversation

@sgammon
Copy link
Member

@sgammon sgammon commented Jul 21, 2025

Ready for review Powered by Pull Request Badge

Summary

At one point our musl-targeted Linux build was broken by upstream stuff; in the intervening time, we made changes which made us further incompatible with a static target. Upstream fixed their thing, and now we need to propagate fixes downstream to re-enable the static Linux native build.

As a result, this PR is small, because it only accounts for our own errors on that path. Between this and the GVM update in the last PR, our static musl build works smoothly again.

@sgammon sgammon added this to the Release R18: Beta milestone Jul 21, 2025
@sgammon sgammon self-assigned this Jul 21, 2025
@sgammon sgammon added the bug Something isn't working label Jul 21, 2025
@sgammon sgammon added this to Elide Jul 21, 2025
@sgammon sgammon added the platform:linux Issues relating to Linux label Jul 21, 2025
@sgammon sgammon force-pushed the fix/static-linux-build branch from dae32de to 86f567a Compare July 21, 2025 19:24
@codecov
Copy link

codecov bot commented Jul 21, 2025

Codecov Report

Attention: Patch coverage is 22.22222% with 7 lines in your changes missing coverage. Please review.

Project coverage is 39.82%. Comparing base (590ae3e) to head (35fa343).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...n/kotlin/elide/runtime/core/lib/NativeLibraries.kt 20.00% 0 Missing and 4 partials ⚠️
...er/src/main/kotlin/elide/tooling/web/WebBuilder.kt 25.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1568      +/-   ##
==========================================
- Coverage   39.84%   39.82%   -0.02%     
==========================================
  Files         769      769              
  Lines       37010    37011       +1     
  Branches     5230     5232       +2     
==========================================
- Hits        14745    14740       -5     
- Misses      20499    20503       +4     
- Partials     1766     1768       +2     
Flag Coverage Δ
jvm 39.82% <22.22%> (-0.02%) ⬇️
lib 39.82% <22.22%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...er/src/main/kotlin/elide/tooling/web/WebBuilder.kt 52.94% <25.00%> (-2.62%) ⬇️
...n/kotlin/elide/runtime/core/lib/NativeLibraries.kt 12.50% <20.00%> (-20.84%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 590ae3e...35fa343. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Fixes: #1439
Signed-off-by: Sam Gammon <sam@elide.dev>
@sgammon sgammon force-pushed the fix/static-linux-build branch from 86f567a to 35fa343 Compare July 21, 2025 19:39
@sgammon sgammon moved this to Done in Elide Jul 21, 2025
@sgammon sgammon requested review from a team and Copilot July 21, 2025 20:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the static native Linux build targeting musl by addressing JNI library loading compatibility issues. The changes ensure that static builds can properly handle native library dependencies without attempting to dynamically load libraries that aren't available in the static context.

  • Adds conditional logic to skip JNI library loading when running in static mode
  • Updates native library resolution to respect the elide.staticJni system property
  • Prevents web and media builder features from attempting library loads during static builds

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
NativeLibraries.kt Adds static JNI detection and conditional library loading logic
WebBuilderFeature.kt Adds early return for static JNI builds to skip library loading
MediaBuilderFeature.kt Adds early return for static JNI builds to skip library loading
WebBuilder.kt Removes unnecessary synchronization around library loading

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@sgammon sgammon merged commit 0a5a728 into main Jul 21, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working platform:linux Issues relating to Linux

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Fix static Linux build

3 participants