Skip to content

Conversation

@pditommaso
Copy link
Member

@pditommaso pditommaso commented Dec 24, 2025

Summary

Add GraalVM native image compilation to deliver pre-built nlsp binaries for:

  • linux-amd64 - Linux x86_64
  • linux-arm64 - Linux ARM64
  • macos-intel - macOS Intel
  • macos-silicon - macOS Apple Silicon

Build Process

The native image build uses a two-phase approach to handle Groovy's dynamic nature:

  1. Tracing Phase: The lsp-simulator.sh script simulates an LSP client session, sending JSON-RPC messages that exercise all major LSP operations (initialize, hover, completion, definition, references, formatting, etc.). This runs with the GraalVM tracing agent (-agentlib:native-image-agent) to capture reflection, resource, and serialization metadata.

  2. Compilation Phase: The captured metadata is fed to native-image along with manual configuration in conf/native-image/ to produce a self-contained binary.

Changes

  • build.gradle: GraalVM native image plugin with generateNativeImageConfig task that runs the tracing agent
  • lsp-simulator.sh: LSP client simulator covering lifecycle, document sync, and language features
  • build-native.sh: Local build script with requirements checking and testing
  • conf/native-image/: Manual reflection configuration for edge cases
  • .github/workflows/build-native.yml: CI workflow for multi-platform builds

Test plan

  • Verify native builds complete on all 4 platforms
  • Test nlsp binary responds to LSP initialize request
  • Validate artifacts are uploaded correctly

🤖 Generated with Claude Code

pditommaso and others added 3 commits December 24, 2025 10:08
- Add Gradle native image plugin configuration with tracing agent
- Add lsp-simulator.sh to exercise LSP operations for reflection tracing
- Add build-native.sh for self-contained native builds
- Add GitHub Actions workflow for multi-platform releases (linux-amd64, linux-arm64, darwin-arm64)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
- Use macos-latest-large for macos-amd64 (Intel)
- Use macos-latest-xlarge for macos-arm64 (Apple Silicon)
- Change platform prefix from darwin- to macos-
- Add conf/native-image to configuration directories

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Rename binary to nlsp
- Use macos-intel and macos-silicon platform names
- Remove packaging from build script (upload raw binary instead)
- Simplify detect_platform function

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@pditommaso pditommaso linked an issue Dec 24, 2025 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

GraalVM native image

2 participants