Installation
Quark is a c-module package: a native library that nanos world loads into the server. It runs on Linux and Windows servers.
Adding Quark to a server
- Download
quark-<version>.zipfrom the releases and extract it into thePackagesfolder of the server, so that the server has aPackages/quarkfolder. - Add
"quark"topackages_requirementsin thePackage.tomlof every package that uses it. - Start the server with
--enable_unsafe_libs, otherwise nanos world refuses to load c-module packages.
# Packages/my-package/Package.toml
[meta]
title = "My Package"
[script]
packages_requirements = ["quark"]
Every package that requires Quark finds the global Quark in its server scripts:
Console.Log("Quark " .. Quark.Version .. " with " .. table.concat(Quark.Modules(), ", "))
The package folder
The package folder contains Package.toml and the binaries for both platforms:
Packages/quark/
├── Package.toml
├── libquark.so
└── quark.dll
The release also contains quark-library-<version>.zip with the editor definitions and a SHA256SUMS file to verify the downloads.
Building from source
Quark needs a current Rust toolchain:
cargo build --release
cargo xwin build --release --target x86_64-pc-windows-msvc
The Windows build can be done from Linux with cargo-xwin. Only the MSVC target is supported, because the SDK's lua.lib is built with MSVC. The results are target/release/libquark.so and target/x86_64-pc-windows-msvc/release/quark.dll.
Modules can be left out at compile time with Cargo features, for example cargo build --release --no-default-features --features crypto,formats.