From d116e1f241f5dfe46a9d2e2be63d1607b380a414 Mon Sep 17 00:00:00 2001 From: ahirner Date: Mon, 11 Mar 2024 20:37:22 +0100 Subject: [PATCH] attempt to add rising wave, krb5 missing perl --- flake.lock | 38 ++++++++++++++++++++++++++++++++++++++ flake.nix | 35 ++++++++++++++++++++++++++++++++--- patches/risingwave.patch | 12 ++++++++++++ 3 files changed, 82 insertions(+), 3 deletions(-) create mode 100644 patches/risingwave.patch diff --git a/flake.lock b/flake.lock index 36e9ae8..587b8ee 100644 --- a/flake.lock +++ b/flake.lock @@ -24,6 +24,26 @@ "type": "github" } }, + "crane": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1710003968, + "narHash": "sha256-g8+K+mLiNG5uch35Oy9oDQBAmGSkCcqrd0Jjme7xiG0=", + "owner": "ipetkov", + "repo": "crane", + "rev": "10484f86201bb94bd61ecc5335b1496794fedb78", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, "dream2nix": { "inputs": { "nixpkgs": [ @@ -177,14 +197,32 @@ "type": "github" } }, + "risingwave": { + "flake": false, + "locked": { + "lastModified": 1710138933, + "narHash": "sha256-ms9GyFioCglzN8ZEhwxC2bHhk5RynIB01UFWj1s+gUQ=", + "owner": "risingwavelabs", + "repo": "risingwave", + "rev": "0b23c9d84032bd1f3fafb2e912b1d001a2f70d75", + "type": "github" + }, + "original": { + "owner": "risingwavelabs", + "repo": "risingwave", + "type": "github" + } + }, "root": { "inputs": { "alejandra": "alejandra", + "crane": "crane", "dream2nix": "dream2nix", "flake-compat": "flake-compat", "flake-parts": "flake-parts", "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", + "risingwave": "risingwave", "rust-overlay": "rust-overlay" } }, diff --git a/flake.nix b/flake.nix index f1803c0..eb7f90d 100644 --- a/flake.nix +++ b/flake.nix @@ -27,6 +27,10 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.flake-utils.follows = "flake-utils"; }; + crane.url = "github:ipetkov/crane"; + crane.inputs.nixpkgs.follows = "nixpkgs"; + risingwave.url = "github:risingwavelabs/risingwave"; + risingwave.flake = false; dream2nix = { url = "github:nix-community/dream2nix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -36,11 +40,12 @@ outputs = inputs @ { self, flake-parts, + crane, ... }: let lib = inputs.nixpkgs.lib; - overlayAttrs = (import ./overlays.nix {inherit lib;}) // {rustc = inputs.rust-overlay.overlays.default;}; - overlays = builtins.attrValues overlayAttrs; + overlayAttrs = import ./overlays.nix {inherit lib;}; + overlays = (builtins.attrValues overlayAttrs) ++ [(import inputs.rust-overlay)]; systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin"]; flakeDefaults = { @@ -66,7 +71,31 @@ system, ... }: let - packages = builtins.mapAttrs (name: _: builtins.getAttr name pkgs) overlayAttrs; + # pin nightly for ahash https://users.rust-lang.org/t/error-e0635-unknown-feature-stdsimd/106445/2 + rustWithWasiTarget = pkgs.rust-bin.nightly."2024-02-04".default.override { + targets = ["wasm32-wasi"]; + }; + craneLib = (crane.mkLib pkgs).overrideToolchain rustWithWasiTarget; + risingwave = craneLib.buildPackage { + pname = "risingwave"; + version = "1.7.0"; + src = craneLib.cleanCargoSource (craneLib.path inputs.risingwave.outPath); + strictDeps = true; + patches = [./patches/risingwave.patch]; + nativeBuildInputs = with pkgs; [ + krb5 + openssl.dev + pkg-config + ]; + PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig"; + OPENSSL_NO_VENDOR = 1; + buildInputs = + [] + ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ + pkgs.libiconv + ]; + }; + packages = (builtins.mapAttrs (name: _: builtins.getAttr name pkgs) overlayAttrs) // {inherit risingwave;}; in { devShells.default = with pkgs; mkShell { diff --git a/patches/risingwave.patch b/patches/risingwave.patch new file mode 100644 index 0000000..3646f60 --- /dev/null +++ b/patches/risingwave.patch @@ -0,0 +1,12 @@ +diff --git a/.cargo/config.toml b/.cargo/config.toml +index fbe29b3e6b..c969802673 100644 +--- a/.cargo/config.toml ++++ b/.cargo/config.toml +@@ -20,7 +20,6 @@ rustflags = [ + [target.x86_64-apple-darwin] + rustflags = [ + "-Ctarget-feature=+sse4.2", # use a generally available feature, since it's not for production +- "-Clink-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld", + ] + + [target.aarch64-apple-darwin]