Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ tokio = { version = "1.39", features = [
"macros",
], optional = true }
crossbeam-queue = "0.3.8"
derive-where = "1.5.0"

[workspace]
members = [
Expand Down
81 changes: 66 additions & 15 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

104 changes: 30 additions & 74 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,79 +1,35 @@
{
description = "Wasmer Webassembly runtime";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flakeutils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default";
rust-overlay.url = "github:oxalica/rust-overlay";
};

outputs = { self, nixpkgs, flakeutils }:
flakeutils.lib.eachDefaultSystem (system:
let
NAME = "wasmer";

pkgs = import nixpkgs {
inherit system;
};
in
rec {
packages.${NAME} = import ./scripts/nix/pkg.nix pkgs;
defaultPackage = pkgs.callPackage packages.${NAME} pkgs;

# For `nix run`.
apps.${NAME} = flakeutils.lib.mkApp {
drv = packages.${NAME};
};
defaultApp = apps.${NAME};

# Development shell.
# Run "nix develop" to activate.
devShell = pkgs.mkShell {
name = NAME;
src = self;
packages = with pkgs; [
pkg-config
openssl

# LLVM and related dependencies
llvmPackages_18.libllvm
llvmPackages_18.llvm
libxml2
libffi

# Rust tooling

# Snapshot testing
# https://github.com/mitsuhiko/insta
cargo-insta
# Test runner
# https://github.com/nextest-rs/nextest
cargo-nextest
# Rust dependency vulnerability checker
# https://github.com/EmbarkStudios/cargo-deny
cargo-deny

# Webassembly tooling

# "Official" WASM CLI tools
# (wasm2wat, wat2wasm, wasm-objdump, ...)
# https://github.com/WebAssembly/wabt
wabt
# Provides `wasm-opt` (WASM optimizer) and some other tools
# https://github.com/WebAssembly/binaryen
binaryen
# Various WASM debugging and conversion tools
# (partial overlap with "wabt")
# https://github.com/bytecodealliance/wasm-tools
wasm-tools
];

env.LLVM_SYS_180_PREFIX = pkgs.llvmPackages_18.llvm.dev;

# shellHook = ''
# LD_LIBRARY_PATH = "${ env.LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ pkgs.stdenv.cc.cc pkgs.openssl.out ] }:$LD_LIBRARY_PATH"
# '';

};
}
);
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
perSystem = { config, self', pkgs, lib, system, rust-overlay, ... }: rec {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ (import inputs.rust-overlay) ];
};

packages.rust-toolchain = pkgs.rust-bin.fromRustupToolchainFile
./rust-toolchain.toml;

# Rust dev environment
devShells.default = pkgs.mkShell {
shellHook = ''
# For rust-analyzer 'hover' tooltips to work.
export RUST_SRC_PATH=${packages.rust-toolchain.availableComponents.rust-src}
export LIBCLANG_PATH=${pkgs.libclang.lib}/lib
export PATH=$PWD/target/debug:~/.cargo/bin:$PATH
'';
nativeBuildInputs = with pkgs; [
packages.rust-toolchain
rust-analyzer
];
};
};
};
}
1 change: 1 addition & 0 deletions lib/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ loupe = { workspace = true, optional = true, features = [
] }
paste = "1.0.15"
derive_more = { workspace = true, features = ["from", "debug"] }
derive-where = "1.5.0"

# Dependencies and Development Dependencies for `sys`.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
Expand Down
Loading
Loading