Unverified Commit 2e4f09f2 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

influxdb: 1.10.7 -> 1.12.0, influxdb2: 2.7.6 -> 2.7.12 (#410939)

parents 6a3064bb 3b72abe0
Loading
Loading
Loading
Loading
+9 −20
Original line number Diff line number Diff line
@@ -6,12 +6,11 @@
  pkg-config,
  rustPlatform,
  libiconv,
  fetchpatch,
  nixosTests,
}:

let
  libflux_version = "0.194.5";
  libflux_version = "0.196.1";

  # This is copied from influxdb2 with the required flux version
  flux = rustPlatform.buildRustPackage rec {
@@ -21,21 +20,11 @@ let
      owner = "influxdata";
      repo = "flux";
      tag = "v${libflux_version}";
      hash = "sha256-XHT/+JMu5q1cPjZT2x/OKEPgxFJcnjrQKqn8w9/Mb3s=";
      hash = "sha256-935aN2SxfNZvpG90rXuqZ2OTpSGLgiBDbZsBoG0WUvU=";
    };
    patches = [
      # Fix build on Rust 1.78 (included after v0.195.0)
      (fetchpatch {
        name = "fix-build-on-rust-1.78.patch";
        url = "https://github.com/influxdata/flux/commit/68c831c40b396f0274f6a9f97d77707c39970b02.patch";
        stripLen = 2;
        extraPrefix = "";
        excludes = [ ];
        hash = "sha256-6LOTgbOCfETNTmshyXgtDZf9y4t/2iqRuVPkz9dYPHc=";
      })
      # https://github.com/influxdata/flux/pull/5542
      ../influxdb2/fix-unsigned-char.patch
      # https://github.com/influxdata/flux/pull/5516
      ../influxdb2/rust_lifetime.patch
    ];
    # Don't fail on missing code documentation
    postPatch = ''
@@ -44,7 +33,7 @@ let
    '';
    sourceRoot = "${src.name}/libflux";
    useFetchCargoVendor = true;
    cargoHash = "sha256-wJVvpjaBUae3FK3lQaQov4t0UEsH86tB8B8bsSFGGBU=";
    cargoHash = "sha256-A6j/lb47Ob+Po8r1yvqBXDVP0Hf7cNz8WFZqiVUJj+Y=";
    nativeBuildInputs = [ rustPlatform.bindgenHook ];
    buildInputs = lib.optional stdenv.hostPlatform.isDarwin libiconv;
    pkgcfg = ''
@@ -60,7 +49,7 @@ let
        mkdir -p $out/include $out/pkgconfig
        cp -r $NIX_BUILD_TOP/source/libflux/include/influxdata $out/include
        substitute $pkgcfgPath $out/pkgconfig/flux.pc \
          --replace /out $out
          --replace-fail /out $out
      ''
      + lib.optionalString stdenv.hostPlatform.isDarwin ''
        install_name_tool -id $out/lib/libflux.dylib $out/lib/libflux.dylib
@@ -69,16 +58,16 @@ let
in
buildGoModule rec {
  pname = "influxdb";
  version = "1.10.7";
  version = "1.12.0";

  src = fetchFromGitHub {
    owner = "influxdata";
    repo = pname;
    repo = "influxdb";
    rev = "v${version}";
    hash = "sha256-Aibu3yG/D1501Hr2F2qsGvjig14tbEAI+MBfqbxlpg8=";
    hash = "sha256-jSv3zzU/jIqALF9mb4gV7zyQvm8pIwJU6Y4ADBlpVOE=";
  };

  vendorHash = "sha256-AA6uj7PgXjC+IK2ZSwRnYpHS4MFScOROO1BpP+s33IU=";
  vendorHash = "sha256-tPw/1vkUTwmRHrnENDG3NJTV6RplI4pCP6GueRT8dbc=";

  nativeBuildInputs = [ pkg-config ];

+11 −21
Original line number Diff line number Diff line
@@ -14,20 +14,20 @@
}:

let
  version = "2.7.6";
  ui_version = "OSS-v2.7.1";
  libflux_version = "0.194.5";
  version = "2.7.12";
  ui_version = "OSS-v2.7.12";
  libflux_version = "0.196.1";

  src = fetchFromGitHub {
    owner = "influxdata";
    repo = "influxdb";
    rev = "v${version}";
    hash = "sha256-0gqFUIV0ETdVuVmC+SwoKsO6OkoT/s+qKO1f8fkaZj4=";
    hash = "sha256-FwvcKxCozMqJulDDCFDgp7MYJwMq/9XZ6g2q2lIgFc0=";
  };

  ui = fetchurl {
    url = "https://github.com/influxdata/ui/releases/download/${ui_version}/build.tar.gz";
    hash = "sha256-0k59SKvt9pFt3WSd5PRUThbfbctt2RYtaxaxoyLICm8=";
    hash = "sha256-aC+GYMaxYKkY9GMaeRx22hQ3xi3kfWpaTLC9ajqOaAA=";
  };

  flux = rustPlatform.buildRustPackage {
@@ -37,21 +37,11 @@ let
      owner = "influxdata";
      repo = "flux";
      rev = "v${libflux_version}";
      hash = "sha256-XHT/+JMu5q1cPjZT2x/OKEPgxFJcnjrQKqn8w9/Mb3s=";
      hash = "sha256-935aN2SxfNZvpG90rXuqZ2OTpSGLgiBDbZsBoG0WUvU=";
    };
    patches = [
      # Fix build on Rust 1.78 (included after v0.195.0)
      (fetchpatch {
        name = "fix-build-on-rust-1.78.patch";
        url = "https://github.com/influxdata/flux/commit/68c831c40b396f0274f6a9f97d77707c39970b02.patch";
        stripLen = 2;
        extraPrefix = "";
        excludes = [ ];
        hash = "sha256-6LOTgbOCfETNTmshyXgtDZf9y4t/2iqRuVPkz9dYPHc=";
      })
      # https://github.com/influxdata/flux/pull/5542
      ./fix-unsigned-char.patch
      # https://github.com/influxdata/flux/pull/5516
      ./rust_lifetime.patch
    ];
    # Don't fail on missing code documentation
    postPatch = ''
@@ -60,7 +50,7 @@ let
    '';
    sourceRoot = "${src.name}/libflux";
    useFetchCargoVendor = true;
    cargoHash = "sha256-wJVvpjaBUae3FK3lQaQov4t0UEsH86tB8B8bsSFGGBU=";
    cargoHash = "sha256-A6j/lb47Ob+Po8r1yvqBXDVP0Hf7cNz8WFZqiVUJj+Y=";
    nativeBuildInputs = [ rustPlatform.bindgenHook ];
    buildInputs = lib.optional stdenv.hostPlatform.isDarwin libiconv;
    pkgcfg = ''
@@ -76,7 +66,7 @@ let
        mkdir -p $out/include $out/pkgconfig
        cp -r $NIX_BUILD_TOP/source/libflux/include/influxdata $out/include
        substitute $pkgcfgPath $out/pkgconfig/flux.pc \
          --replace /out $out
          --replace-fail /out $out
      ''
      + lib.optionalString stdenv.hostPlatform.isDarwin ''
        install_name_tool -id $out/lib/libflux.dylib $out/lib/libflux.dylib
@@ -94,7 +84,7 @@ buildGoModule {
    perl
  ];

  vendorHash = "sha256-3Vf8BCrOwliXrH+gmZ4RJ1YBEbqL0Szx2prW3ie9CNg=";
  vendorHash = "sha256-B4w8+UaewujKVr98MFhRh2c6UMOdB+TE/mOT+cy2pHk=";
  subPackages = [
    "cmd/influxd"
    "cmd/telemetryd"
@@ -105,7 +95,7 @@ buildGoModule {
  postPatch = ''
    # use go-bindata from environment
    substituteInPlace static/static.go \
      --replace 'go run github.com/kevinburke/go-bindata/' ""
      --replace-fail 'go run github.com/kevinburke/go-bindata/' ""
  '';

  # Check that libflux and the UI are at the right version, and embed
+0 −26
Original line number Diff line number Diff line
diff --git a/flux-core/src/ast/walk/mod.rs b/flux-core/src/ast/walk/mod.rs
index 90f70ba6f7..a6966827e8 100644
--- a/flux-core/src/ast/walk/mod.rs
+++ b/flux-core/src/ast/walk/mod.rs
@@ -180,7 +180,7 @@ impl<'a> Node<'a> {
 
 impl<'a> Node<'a> {
     #[allow(missing_docs)]
-    pub fn from_expr(expr: &'a Expression) -> Node {
+    pub fn from_expr(expr: &'a Expression) -> Node<'a> {
         match expr {
             Expression::Identifier(e) => Node::Identifier(e),
             Expression::Array(e) => Node::ArrayExpr(e),
diff --git a/flux-core/src/parser/mod.rs b/flux-core/src/parser/mod.rs
index ac7d4b9a72..561c3a0ff6 100644
--- a/flux-core/src/parser/mod.rs
+++ b/flux-core/src/parser/mod.rs
@@ -41,7 +41,7 @@ pub struct Parser<'input> {
 
 impl<'input> Parser<'input> {
     /// Instantiates a new parser with the given string as input.
-    pub fn new(src: &'input str) -> Parser {
+    pub fn new(src: &'input str) -> Parser<'input> {
         let s = Scanner::new(src);
         Parser {
             s,