Unverified Commit dcb4dd1a authored by Maximilian Bosch's avatar Maximilian Bosch Committed by GitHub
Browse files

Merge: evcxr: 0.17.0 -> 0.19.0 (#402167)

parents cb1697b9 687ebf44
Loading
Loading
Loading
Loading
+41 −18
Original line number Diff line number Diff line
{
  cargo,
  lib,
  stdenv,
  rustPlatform,
  fetchFromGitHub,
  makeWrapper,
  pkg-config,
  rustPlatform,
  lib,
  stdenv,
  gcc,
  cmake,
  libiconv,
  cargo,
  gcc,
  mold,
  rustc,
  nix-update-script,
}:

rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
  pname = "evcxr";
  version = "0.17.0";
  version = "0.19.0";

  src = fetchFromGitHub {
    owner = "google";
    repo = "evcxr";
    rev = "v${version}";
    sha256 = "sha256-6gSJJ3ptqpYydjg+xf5Pz3iTk0D+bkC6N79OeiKxPHY=";
    rev = "v${finalAttrs.version}";
    sha256 = "sha256-8PjZFWUH76QrA8EI9Cx0sBCzocvSmnp84VD7Nv9QMc8=";
  };

  useFetchCargoVendor = true;
  cargoHash = "sha256-U2LBesQNOa/E/NkVeLulb8JUtGsHgMne0MgY0RT9lqI=";
  cargoHash = "sha256-hE/O6lHC0o+nrN4vaQ155Nn2gZscpfsZ6o7IDi/IEjI=";

  RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";

@@ -37,12 +40,28 @@ rustPlatform.buildRustPackage rec {
  ];

  checkFlags = [
    # test broken with rust 1.69:
    # * https://github.com/evcxr/evcxr/issues/294
    # * https://github.com/NixOS/nixpkgs/issues/229524
    "--skip=check_for_errors"
    # outdated rust-analyzer (disabled, upstream)
    # https://github.com/evcxr/evcxr/blob/fcdac75f49dcab3229524e671d4417d36c12130b/evcxr/tests/integration_tests.rs#L741
    # https://github.com/evcxr/evcxr/issues/295
    "--skip=partially_inferred_variable_type"
    # fail, but can't reproduce in the REPL
    "--skip=code_completion"
    "--skip=save_and_restore_variables"
  ];

  # Some tests fail when types aren't explicitly specified, but which can't be
  # reproduced inside the REPL.
  # Likely related to https://github.com/evcxr/evcxr/issues/295
  postConfigure = ''
    substituteInPlace evcxr/tests/integration_tests.rs \
      --replace-fail "let var2 = String" "let var2: String = String"           `# code_completion` \
      --replace-fail "let a = vec" "let a: Vec<i32> = vec"                     `# function_panics_{with,without}_variable_preserving` \
      --replace-fail "let a = Some(" "let a: Option<String> = Some("           `# moved_value` \
      --replace-fail "let a = \"foo\"" "let a: String = \"foo\""               `# statement_and_expression` \
      --replace-fail "let owned = \"owned\"" "let owned:String = \"owned\""    `# question_mark_operator` \
      --replace-fail "let mut owned_mut =" "let mut owned_mut: String ="
  '';

  postInstall =
    let
      wrap = exe: ''
@@ -51,6 +70,8 @@ rustPlatform.buildRustPackage rec {
            lib.makeBinPath [
              cargo
              gcc
              mold # fix fatal error: "unknown command line option: -run"
              rustc # requires rust edition 2024
            ]
          } \
          --set-default RUST_SRC_PATH "$RUST_SRC_PATH"
@@ -62,14 +83,16 @@ rustPlatform.buildRustPackage rec {
      rm $out/bin/testing_runtime
    '';

  meta = with lib; {
  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Evaluation context for Rust";
    homepage = "https://github.com/google/evcxr";
    license = licenses.asl20;
    maintainers = with maintainers; [
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [
      protoben
      ma27
    ];
    mainProgram = "evcxr";
  };
}
})