From 55eb8bd3452fff32c2342dd95dc554514922debf Mon Sep 17 00:00:00 2001 From: Alan Parra Date: Thu, 10 Aug 2023 17:47:57 -0300 Subject: [PATCH] Move most devbox packages to "latest" (#30295) * Fix init_hook for Fish users * Move development tools to "latest" * Use Buf and OpenSSL formulas * Use rust and yarn formulas * Bump Go version * Update lock files --- build.assets/flake/flake.lock | 88 +----------------------- build.assets/flake/flake.nix | 55 ++++----------- devbox.json | 44 ++++++------ devbox.lock | 122 ++++++++++++++++++++++------------ 4 files changed, 117 insertions(+), 192 deletions(-) diff --git a/build.assets/flake/flake.lock b/build.assets/flake/flake.lock index bf85aebea267d..e437630e6fb9e 100644 --- a/build.assets/flake/flake.lock +++ b/build.assets/flake/flake.lock @@ -1,21 +1,5 @@ { "nodes": { - "batsPkgs": { - "locked": { - "lastModified": 1614022514, - "narHash": "sha256-htMUqRk3r5s3kuixCgojWZX9nwM++xeFfeZU+3xQLCA=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "5c1ffb7a9fc96f2d64ed3523c2bdd379bdb7b471", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixpkgs", - "rev": "5c1ffb7a9fc96f2d64ed3523c2bdd379bdb7b471", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems" @@ -34,24 +18,6 @@ "type": "github" } }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "helmPkgs": { "locked": { "lastModified": 1678571061, @@ -100,49 +66,12 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1681358109, - "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "root": { "inputs": { - "batsPkgs": "batsPkgs", "flake-utils": "flake-utils", "helmPkgs": "helmPkgs", "libbpfPkgs": "libbpfPkgs", - "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay" - } - }, - "rust-overlay": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1686537156, - "narHash": "sha256-mJD80brS6h6P4jzwdKID0S9RvfyiruxgJbXvPPIDqF0=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "e75da5cfc7da874401decaa88f4ccb3b4d64d20d", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" + "nixpkgs": "nixpkgs" } }, "systems": { @@ -159,21 +88,6 @@ "repo": "default", "type": "github" } - }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", diff --git a/build.assets/flake/flake.nix b/build.assets/flake/flake.nix index 574c796039acf..003fae439aaf0 100644 --- a/build.assets/flake/flake.nix +++ b/build.assets/flake/flake.nix @@ -1,11 +1,11 @@ # Copyright 2023 Gravitational, Inc. -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,27 +23,20 @@ inputs = { flake-utils.url = "github:numtide/flake-utils"; nixpkgs.url = "github:nixos/nixpkgs/8ad5e8132c5dcf977e308e7bf5517cc6cc0bf7d8"; # general packages - rust-overlay.url = "github:oxalica/rust-overlay"; - # Linting dependencies helmPkgs.url = "github:nixos/nixpkgs/8ad5e8132c5dcf977e308e7bf5517cc6cc0bf7d8"; # helm 3.11.1 # libbpf dependencies. libbpfPkgs.url = "github:nixos/nixpkgs/79b3d4bcae8c7007c9fd51c279a8a67acfa73a2a"; # libbpf 1.0.1 - - # bats dependencies. - batsPkgs.url = "github:nixos/nixpkgs/5c1ffb7a9fc96f2d64ed3523c2bdd379bdb7b471"; # bats 1.2.1 }; outputs = { self, flake-utils, nixpkgs, - rust-overlay, helmPkgs, libbpfPkgs, - batsPkgs, }: flake-utils.lib.eachDefaultSystem (system: @@ -54,16 +47,13 @@ nodeProtocTsVersion = "v5.0.1"; grpcToolsVersion = "1.12.4"; libpcscliteVersion = "1.9.9-teleport"; - rustVersion = "1.68.0"; - yarnVersion = "1.22.19"; - overlays = [ (import rust-overlay) ]; + overlays = []; # Package aliases to make reusing these packages easier. # The individual package names here have been determined by using # https://lazamar.co.uk/nix-versions/ libbpf = libbpfPkgs.legacyPackages.${system}.libbpf; - bats = batsPkgs.legacyPackages.${system}.bats; # pkgs is an alias for the nixpkgs at the system level. This will be used # for general utilities. @@ -74,7 +64,7 @@ # The helm unittest plugin. helm-unittest = pkgs.buildGoModule rec { name = "helm-unittest"; - + src = pkgs.fetchFromGitHub { owner = "vbehar"; repo = "helm3-unittest"; @@ -83,13 +73,13 @@ }; vendorSha256 = null; - + postInstall = '' install -Dm644 plugin.yaml $out/helm-unittest/plugin.yaml mkdir "$out/helm-unittest/bin" mv $out/bin/helm3-unittest $out/helm-unittest/bin/unittest ''; - + doCheck = false; }; @@ -167,7 +157,7 @@ grpc-tools = pkgs.stdenv.mkDerivation rec { pname = "grpc-tools"; version = grpcToolsVersion; - + src = pkgs.fetchFromGitHub { owner = "grpc"; repo = "grpc-node"; @@ -175,41 +165,22 @@ fetchSubmodules = true; sha256 = "sha256-708lBIGW5+vvSTrZHl/kc+ck7JKNXElrghIGDrMSyx8="; }; - + sourceRoot = "source/packages/grpc-tools"; - + nativeBuildInputs = [ pkgs.cmake ]; - + installPhase = '' install -Dm755 -t $out/bin grpc_node_plugin cp grpc_node_plugin grpc_tools_node_protoc_plugin install -Dm755 -t $out/bin grpc_tools_node_protoc_plugin - - install -Dm755 -t $out/bin deps/protobuf/protoc - ''; - }; - - rust = pkgs.rust-bin.stable.${rustVersion}.default; - # Yarn binary. - yarn = pkgs.stdenv.mkDerivation { - name = "yarn"; - src = fetchTarball { - url = "https://yarnpkg.com/downloads/${yarnVersion}/yarn-v${yarnVersion}.tar.gz"; - sha256 = "sha256:0jl77rl2sidsj3ym637w7g35wnv190l96n050aqlm4pyc6wi8v6p"; - }; - buildInputs = [ - pkgs.nodejs-16_x - ]; - buildPhase = '' - mkdir "$out" - cp -R * "$out" + install -Dm755 -t $out/bin deps/protobuf/protoc ''; }; conditionalBuildInputs = if pkgs.stdenv.isLinux then [ - bats libbpf ] else if pkgs.stdenv.isDarwin then [ pkgs.darwin.IOKit @@ -232,8 +203,6 @@ helm = helm; libpcsclite = libpcsclite; protoc-gen-gogo = protoc-gen-gogo; - rust = rust; - yarn = yarn; }; }); } diff --git a/devbox.json b/devbox.json index cf022c038be0c..ddeefaa90a87d 100644 --- a/devbox.json +++ b/devbox.json @@ -1,39 +1,41 @@ { "packages": [ - "addlicense@1.0.0", - "bats@1.3.0", - "github:nixos/nixpkgs/2920b6fc16a9ed5d51429e94238b28306ceda79e#buf", - "llvmPackages_14.clangUseLLVM@14.0.6", - "gci@0.9.1", - "go@1.20.5", - "golangci-lint@1.53.3", - "gotestsum@1.10.1", - "libiconvReal@1.16", + "addlicense@latest", + "bash@latest", + "bats@latest", + "buf@latest", + "gci@latest", + "git@latest", + "golangci-lint@latest", + "gotestsum@latest", + "libiconvReal@latest", + "openssl@latest", + "patchelf@latest", + "python@latest", + "shellcheck@latest", + "yamllint@latest", + "zlib@latest", + + "go@1.20.6", "libfido2@1.13.0", + "llvmPackages_14.clangUseLLVM@14.0.6", "nodejs@16.18.1", - "github:nixos/nixpkgs/b39bfdc033e1d79f2b58e1630530e5d54b19e698#openssl", - "patchelf@0.15.0", "protobuf3_20@3.20.3", - "python@3.11.2", - "shellcheck@0.9.0", - "yamllint@1.28.0", - "zlib@1.2.13", + "rustc@1.70.0", + "yarn@1.22.19", + "path:build.assets/flake#conditional", "path:build.assets/flake#grpc-tools", "path:build.assets/flake#helm", "path:build.assets/flake#libpcsclite", "path:build.assets/flake#node-protoc-ts", - "path:build.assets/flake#protoc-gen-gogo", - "path:build.assets/flake#rust", - "path:build.assets/flake#yarn", - "bash@latest", - "git@latest" + "path:build.assets/flake#protoc-gen-gogo" ], "shell": { "init_hook": [ "export TELEPORT_DEVBOX=1", "export PATH=\"$HOME/.cargo/bin:$PATH\"", - "unset GOROOT" + "type unset 2>/dev/null && unset GOROOT" ] }, "nixpkgs": { diff --git a/devbox.lock b/devbox.lock index 6a1994cc95136..090b4f457dee5 100644 --- a/devbox.lock +++ b/devbox.lock @@ -1,40 +1,55 @@ { "lockfile_version": "1", "packages": { - "addlicense@1.0.0": { - "last_modified": "2022-06-30T00:42:12Z", - "resolved": "github:NixOS/nixpkgs/d3248619647234b5dc74a6921bcdf6dd8323eb22#addlicense", - "version": "1.0.0" + "addlicense@latest": { + "last_modified": "2022-11-10T13:14:32Z", + "resolved": "github:NixOS/nixpkgs/72d8853228c9758820c39b8659415b6d89279493#addlicense", + "source": "devbox-search", + "version": "2021-04-22" }, "bash@latest": { - "resolved": "github:NixOS/nixpkgs/f91ee3065de91a3531329a674a45ddcb3467a650#bash" + "last_modified": "2023-05-14T19:13:12Z", + "resolved": "github:NixOS/nixpkgs/3007746b3f5bfcb49e102b517bca891822a41b31#bash", + "source": "devbox-search", + "version": "5.2-p15" }, - "bats@1.3.0": { - "last_modified": "2021-09-01T12:51:06Z", - "resolved": "github:NixOS/nixpkgs/6cc260cfd60f094500b79e279069b499806bf6d8#bats", - "version": "1.3.0" + "bats@latest": { + "last_modified": "2023-07-23T03:35:12Z", + "resolved": "github:NixOS/nixpkgs/af8cd5ded7735ca1df1a1174864daab75feeb64a#bats", + "source": "devbox-search", + "version": "1.10.0" }, - "gci@0.9.1": { - "last_modified": "2023-02-28T22:11:13Z", - "resolved": "github:NixOS/nixpkgs/995edc972ad3a1e291ac22d74b9610821357175f#gci", - "version": "0.9.1" + "buf@latest": { + "last_modified": "2023-07-30T12:29:02Z", + "resolved": "github:NixOS/nixpkgs/3acb5c4264c490e7714d503c7166a3fde0c51324#buf", + "source": "devbox-search", + "version": "1.25.0" + }, + "gci@latest": { + "last_modified": "2023-05-14T19:13:12Z", + "resolved": "github:NixOS/nixpkgs/3007746b3f5bfcb49e102b517bca891822a41b31#gci", + "source": "devbox-search", + "version": "0.10.1" }, "git@latest": { - "resolved": "github:NixOS/nixpkgs/f91ee3065de91a3531329a674a45ddcb3467a650#git" + "last_modified": "2023-07-23T03:35:12Z", + "resolved": "github:NixOS/nixpkgs/af8cd5ded7735ca1df1a1174864daab75feeb64a#git", + "source": "devbox-search", + "version": "2.41.0" }, - "go@1.20.5": { - "last_modified": "2023-06-29T16:20:38Z", - "resolved": "github:NixOS/nixpkgs/3c614fbc76fc152f3e1bc4b2263da6d90adf80fb#go", + "go@1.20.6": { + "last_modified": "2023-07-30T12:29:02Z", + "resolved": "github:NixOS/nixpkgs/3acb5c4264c490e7714d503c7166a3fde0c51324#go", "source": "devbox-search", - "version": "1.20.5" + "version": "1.20.6" }, - "golangci-lint@1.53.3": { - "last_modified": "2023-06-29T16:20:38Z", + "golangci-lint@latest": { + "last_modified": "2023-06-30T04:44:22Z", "resolved": "github:NixOS/nixpkgs/3c614fbc76fc152f3e1bc4b2263da6d90adf80fb#golangci-lint", "source": "devbox-search", "version": "1.53.3" }, - "gotestsum@1.10.1": { + "gotestsum@latest": { "last_modified": "2023-07-23T03:35:12Z", "resolved": "github:NixOS/nixpkgs/af8cd5ded7735ca1df1a1174864daab75feeb64a#gotestsum", "source": "devbox-search", @@ -45,9 +60,10 @@ "resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#libfido2", "version": "1.13.0" }, - "libiconvReal@1.16": { - "last_modified": "2023-05-01T16:53:22Z", - "resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#libiconvReal", + "libiconvReal@latest": { + "last_modified": "2023-05-14T19:13:12Z", + "resolved": "github:NixOS/nixpkgs/3007746b3f5bfcb49e102b517bca891822a41b31#libiconvReal", + "source": "devbox-search", "version": "1.16" }, "llvmPackages_14.clangUseLLVM@14.0.6": { @@ -61,9 +77,16 @@ "resolved": "github:NixOS/nixpkgs/a4379d2b0deefedc8dba360897557707ea9ee9a7#nodejs-16_x", "version": "16.18.1" }, - "patchelf@0.15.0": { - "last_modified": "2023-05-01T16:53:22Z", - "resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#patchelf", + "openssl@latest": { + "last_modified": "2023-07-23T03:35:12Z", + "resolved": "github:NixOS/nixpkgs/af8cd5ded7735ca1df1a1174864daab75feeb64a#openssl", + "source": "devbox-search", + "version": "3.0.9" + }, + "patchelf@latest": { + "last_modified": "2023-05-14T19:13:12Z", + "resolved": "github:NixOS/nixpkgs/3007746b3f5bfcb49e102b517bca891822a41b31#patchelf", + "source": "devbox-search", "version": "0.15.0" }, "protobuf3_20@3.20.3": { @@ -71,25 +94,42 @@ "resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#protobuf3_20", "version": "3.20.3" }, - "python@3.11.2": { - "last_modified": "2023-03-31T22:52:29Z", + "python@latest": { + "last_modified": "2023-06-30T04:44:22Z", "plugin_version": "0.0.1", - "resolved": "github:NixOS/nixpkgs/242246ee1e58f54d2322227fc5eef53b4a616a31#python311", - "version": "3.11.2" + "resolved": "github:NixOS/nixpkgs/3c614fbc76fc152f3e1bc4b2263da6d90adf80fb#python311", + "source": "devbox-search", + "version": "3.11.4" }, - "shellcheck@0.9.0": { - "last_modified": "2023-05-01T16:53:22Z", - "resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#shellcheck", + "rustc@1.70.0": { + "last_modified": "2023-06-30T04:44:22Z", + "plugin_version": "0.0.1", + "resolved": "github:NixOS/nixpkgs/3c614fbc76fc152f3e1bc4b2263da6d90adf80fb#rustc", + "source": "devbox-search", + "version": "1.70.0" + }, + "shellcheck@latest": { + "last_modified": "2023-07-23T03:35:12Z", + "resolved": "github:NixOS/nixpkgs/af8cd5ded7735ca1df1a1174864daab75feeb64a#shellcheck", + "source": "devbox-search", "version": "0.9.0" }, - "yamllint@1.28.0": { - "last_modified": "2023-02-28T22:11:13Z", - "resolved": "github:NixOS/nixpkgs/995edc972ad3a1e291ac22d74b9610821357175f#yamllint", - "version": "1.28.0" + "yamllint@latest": { + "last_modified": "2023-06-30T04:44:22Z", + "resolved": "github:NixOS/nixpkgs/3c614fbc76fc152f3e1bc4b2263da6d90adf80fb#yamllint", + "source": "devbox-search", + "version": "1.32.0" }, - "zlib@1.2.13": { - "last_modified": "2023-05-01T16:53:22Z", - "resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#zlib", + "yarn@1.22.19": { + "last_modified": "2023-05-21T19:52:09Z", + "resolved": "github:NixOS/nixpkgs/9356eead97d8d16956b0226d78f76bd66e06cb60#yarn", + "source": "devbox-search", + "version": "1.22.19" + }, + "zlib@latest": { + "last_modified": "2023-05-14T19:13:12Z", + "resolved": "github:NixOS/nixpkgs/3007746b3f5bfcb49e102b517bca891822a41b31#zlib", + "source": "devbox-search", "version": "1.2.13" } }