Skip to main content

Development Environment

This guide prepares a workstation for changing LakeSoul itself. It is different from the local runtime quick start, which installs released connector artifacts for application users.

LakeSoul combines Rust, Java/Scala, Python, native JNI libraries, PostgreSQL, and optional object storage. Linux x86_64 GNU is the officially supported native development and release platform; see the compatibility matrix.

Choose an environment

ApproachProvidesUse it when
Nix FlakePinned compiler support libraries, Java, Hadoop, PostgreSQL client, language servers, and all repository formattersDeveloping on x86_64 Linux with Nix. This is the recommended reproducible shell.
Devenv servicesRepository-configured PostgreSQL 14 and RustFS processes with persistent local stateTests need metadata or S3-compatible object storage. It can be used with either the Nix shell or a manually prepared toolchain.
Manual toolchainTools installed by the operating system or a version managerNix is unavailable, or the developer needs an environment matching a specific deployment.

The Flake shell and Devenv services are complementary: nix develop provides development tools; devenv up runs local services.

Nix Flake

The repository Flake currently supports x86_64-linux and exposes three shells:

# Default native shell: Java 17, Hadoop, Clang/LLVM, PostgreSQL client,
# Rust tooling, language servers, and formatters
nix develop

# FHS-style shell with Java 11, useful for Maven/Spark/Flink work
nix develop .#fhs

# Minimal shell containing only repository formatters
nix develop .#formatter

The default and FHS shells configure JAVA_HOME, HADOOP_HOME, HADOOP_CONF_DIR, CLASSPATH, LIBCLANG_PATH, LD_LIBRARY_PATH, MAVEN_OPTS, and UTC timezone data.

The Flake is the source of truth for packages it provides. Component package managers are still used inside the shell: Cargo for Rust, Maven for JVM modules, uv for Python, and npm for the website. If a component command is not present in the selected shell, install that tool separately or add it to flake.nix; do not silently rely on a different system version in CI-sensitive work.

Run one command in the formatter shell without entering an interactive shell:

nix develop .#formatter --command treefmt --ci -- path/to/changed-file

flake.lock pins the Nix inputs. Do not update it as a side effect of entering the shell.

Devenv: PostgreSQL and RustFS

devenv.nix defines the local services used by metadata and object-store tests:

  • PostgreSQL 14 on 127.0.0.1:5432;
  • database, user, and password: lakesoul_test;
  • LakeSoul schema initialized from script/meta_init.sql;
  • RustFS API on 127.0.0.1:9000 and console on 127.0.0.1:9001;
  • RustFS access key and secret key: rustfsadmin.

Inspect the evaluated configuration:

devenv info

Start both services in one foreground process:

devenv up

Keep that terminal open. Stop the services with Ctrl-C. Service data is persisted under .devenv/state, so initialization scripts apply when a fresh service state is created; use the repository metadata migration tools for an existing state.

In another terminal, configure LakeSoul clients:

export LAKESOUL_PG_URL='jdbc:postgresql://127.0.0.1:5432/lakesoul_test?stringtype=unspecified'
export LAKESOUL_PG_USERNAME='lakesoul_test'
export LAKESOUL_PG_PASSWORD='lakesoul_test'

Verify PostgreSQL and the initialized schema:

PGPASSWORD=lakesoul_test psql \
-h 127.0.0.1 -p 5432 -U lakesoul_test -d lakesoul_test \
-c '\dt'

Verify RustFS:

curl -fsS http://127.0.0.1:9000/health

Devenv starts the storage service but application tests may still need to create their expected bucket.

Manual prerequisites

For a non-Nix setup, install:

ToolRequired baseline or purpose
Linux x86_64 GNUOfficial native build platform
Rust stablePinned by rust-toolchain.toml; includes rustfmt, Clippy, and rust-analyzer
protoc 23.xRust and Python protobuf generation; matches CI
JDK 11Maven, Spark, and Flink build baseline
MavenJVM multi-module build
PostgreSQL 14+ and psqlMetadata service and integration tests
Python 3.10+LakeSoul Python SDK
uv and MaturinPython dependency management and PyO3 extension builds
Node.js 18+ and npmDocusaurus website
Clang/LLVM and pkg-configNative compilation and bindings
treefmt plus configured formattersRepository-wide formatting
LefthookLocal pre-commit and pre-push hooks

Check the core commands before building:

rustc --version
cargo --version
protoc --version
java -version
mvn --version
python --version
uv --version
node --version
npm --version
psql --version

Continue with Build from source, then Testing and quality checks.