rover: 0.24.0 -> 0.37.0 (#452819)

This commit is contained in:
Sandro
2025-12-14 00:36:20 +00:00
committed by GitHub
2 changed files with 11 additions and 59 deletions
+11 -8
View File
@@ -4,20 +4,21 @@
pkg-config,
rustPlatform,
openssl,
nix-update-script,
}:
rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
pname = "rover";
version = "0.24.0";
version = "0.37.0";
src = fetchFromGitHub {
owner = "apollographql";
repo = "rover";
rev = "v${version}";
sha256 = "sha256-uyeePAHBDCzXzwIWrKcc9LHClwSI7DMBYod/o4LfK+Y=";
tag = "v${finalAttrs.version}";
hash = "sha256-r/uVaj1+J8wQhc/mTCr9RaMMzEIXdJoRU5iX7/eYZMA=";
};
cargoHash = "sha256-uR5XvkHUmZzCHZITKgScmzqjLOIvbPyrih/0B1OpsAc=";
cargoHash = "sha256-Z9B9DKu6t78Xd75EAKXfB+nr1Au4ylYkZojiENxSykQ=";
buildInputs = [
openssl
@@ -31,6 +32,8 @@ rustPlatform.buildRustPackage rec {
OPENSSL_NO_VENDOR = true;
};
__darwinAllowLocalNetworking = true;
# This test checks whether the plugins specified in the plugins json file are
# valid by making a network call to the repo that houses their binaries; but, the
# build env can't make network calls (impurity)
@@ -38,8 +41,6 @@ rustPlatform.buildRustPackage rec {
"-- --skip=latest_plugins_are_valid_versions"
];
passthru.updateScript = ./update.sh;
# Some tests try to write configuration data to a location in the user's home
# directory. Since this would be /homeless-shelter during the build, point at
# a writeable location instead.
@@ -47,6 +48,8 @@ rustPlatform.buildRustPackage rec {
export APOLLO_CONFIG_HOME="$PWD"
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "CLI for interacting with ApolloGraphQL's developer tooling, including managing self-hosted and GraphOS graphs";
mainProgram = "rover";
@@ -57,4 +60,4 @@ rustPlatform.buildRustPackage rec {
lib.maintainers.aaronarinder
];
};
}
})
-51
View File
@@ -1,51 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnugrep gnused jq nix-prefetch
set -eu -o pipefail
dirname=$(realpath "$(dirname "$0")")
nixpkgs=$(realpath "${dirname}/../../../..")
old_rover_version=$(nix eval --raw -f "$nixpkgs" rover.version)
rover_url=https://api.github.com/repos/apollographql/rover/releases/latest
rover_tag=$(curl "$rover_url" | jq --raw-output ".tag_name")
rover_version="$(expr "$rover_tag" : 'v\(.*\)')"
if [[ "$old_rover_version" == "$rover_version" ]]; then
echo "rover is up-to-date: ${old_rover_version}"
exit 0
fi
echo "Fetching rover"
rover_tar_url="https://github.com/apollographql/rover/archive/refs/tags/${rover_tag}.tar.gz"
{
read rover_hash
read repo
} < <(nix-prefetch-url "$rover_tar_url" --unpack --type sha256 --print-path)
# Convert hash to SRI representation
rover_sri_hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$rover_hash")
# Update rover version.
sed --in-place \
"s|version = \"[0-9.]*\"|version = \"$rover_version\"|" \
"$dirname/default.nix"
# Update rover hash.
sed --in-place \
"s|sha256 = \"[a-zA-Z0-9\/+-=]*\"|sha256 = \"$rover_sri_hash\"|" \
"$dirname/default.nix"
# Clear cargoHash.
sed --in-place \
"s|cargoHash = \".*\"|cargoHash = \"sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"|" \
"$dirname/default.nix"
# Update cargoHash
echo "Computing cargoHash"
cargoHash=$(
nix-prefetch "{ hash }: (import $nixpkgs {}).rover.cargoDeps.overrideAttrs (_: { outputHash = hash; })"
)
sed --in-place \
"s|cargoHash = \".*\"|cargoHash = \"$cargoHash\"|" \
"$dirname/default.nix"