From 8f57ca92bddf8c6a003ee91e737dffad288b8b90 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 29 Jan 2021 19:14:27 +0200 Subject: [PATCH] chore(3p|nix): Remove typed Go Nobody has actually done any experimentation with typed Go, so we're getting rid of it for now - it's causing annoying IFD during build graph generation. Change-Id: Ibac3dea98ebed1b3ee08acda184d24c500cf695d Reviewed-on: https://cl.tvl.fyi/c/depot/+/2458 Tested-by: BuildkiteCI Reviewed-by: sterni Reviewed-by: lukegb Reviewed-by: Profpatsch --- nix/buildTypedGo/default.nix | 34 ------------------- nix/buildTypedGo/example/default.nix | 8 ----- nix/buildTypedGo/example/main.go2 | 15 -------- ops/besadii/default.nix | 4 +-- ops/besadii/{main.go2 => main.go} | 0 third_party/default.nix | 30 ---------------- .../nixpkgs-exposed/exposed/default.nix | 1 + 7 files changed, 3 insertions(+), 89 deletions(-) delete mode 100644 nix/buildTypedGo/default.nix delete mode 100644 nix/buildTypedGo/example/default.nix delete mode 100644 nix/buildTypedGo/example/main.go2 rename ops/besadii/{main.go2 => main.go} (100%) diff --git a/nix/buildTypedGo/default.nix b/nix/buildTypedGo/default.nix deleted file mode 100644 index f135b1ebb..000000000 --- a/nix/buildTypedGo/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# -# A crude wrapper around //nix/buildGo that supports the Go 2 alpha. -# -# The way the alpha is implemented is via a transpiler from typed to -# untyped Go. -{ depot, pkgs, ... }: - -let - inherit (builtins) - baseNameOf - stringLength - substring; - - inherit (depot.nix.buildGo) gpackage program; - - go2goext = file: substring 0 ((stringLength file) - 1) file; - go2go = file: pkgs.runCommandNoCC "${go2goext (baseNameOf file)}" {} '' - cp ${file} . - ${pkgs.go}/bin/go tool go2go translate *.go2 - mv *.go $out - ''; - -in rec { - program = { name, srcs, deps ? [], x_defs ? {} }: depot.nix.buildGo.program { - inherit name deps x_defs; - srcs = map go2go srcs; - }; - - package = { name, srcs, deps ? [], path ? name, sfiles ? [] }: depot.nix.buildGo.package { - inherit name deps path sfiles; - srcs = map go2go srcs; - }; -} diff --git a/nix/buildTypedGo/example/default.nix b/nix/buildTypedGo/example/default.nix deleted file mode 100644 index 5b6d4171f..000000000 --- a/nix/buildTypedGo/example/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ depot, ... }: - -depot.nix.buildTypedGo.program { - name = "example"; - srcs = [ - ./main.go2 - ]; -} diff --git a/nix/buildTypedGo/example/main.go2 b/nix/buildTypedGo/example/main.go2 deleted file mode 100644 index 8986f57b9..000000000 --- a/nix/buildTypedGo/example/main.go2 +++ /dev/null @@ -1,15 +0,0 @@ -package main - -import ( - "fmt" -) - -func Print(type T)(s []T) { - for _, v := range s { - fmt.Print(v) - } -} - -func main() { - Print([]string{"Hello, ", "TVL\n"}) -} diff --git a/ops/besadii/default.nix b/ops/besadii/default.nix index 48856fce0..bcf83778b 100644 --- a/ops/besadii/default.nix +++ b/ops/besadii/default.nix @@ -4,7 +4,7 @@ let inherit (builtins) toFile toJSON; -in depot.nix.buildTypedGo.program { +in depot.nix.buildGo.program { name = "besadii"; - srcs = [ ./main.go2 ]; + srcs = [ ./main.go ]; } diff --git a/ops/besadii/main.go2 b/ops/besadii/main.go similarity index 100% rename from ops/besadii/main.go2 rename to ops/besadii/main.go diff --git a/third_party/default.nix b/third_party/default.nix index 5c99b55d1..096396d3b 100644 --- a/third_party/default.nix +++ b/third_party/default.nix @@ -67,36 +67,6 @@ in exposed.lib.fix(self: exposed // { emacs27-nox = assert ((exposed.lib.versions.major nixpkgs.emacs.version) == "27"); nixpkgs.emacs-nox; - # The Go authors have released a version of Go (in alpha) that has a - # type system. This makes it available, specifically for use with - # //nix/buildTypedGo. - go = nixpkgs.go.overrideAttrs(old: { - version = "dev-go2go"; - doCheck = false; - patches = []; # they all don't apply and are mostly about Darwin crap - - src = nixpkgs.fetchgit { - url = "https://go.googlesource.com/go"; - # You might think these hashes are trivial to update. It's just - # a branch in a git repository, right? - # - # Well, think again. Somehow I managed to get no fewer than 3 - # (!) different commit hashes for the same branch by cloning - # this repository thrice. Only the third one (which you, the - # reader, can find below for your reading pleasure) actually - # gave me `go tool go2go`. - rev = "ad307489d41133f32c779cfa1b0db4a852ace047"; - leaveDotGit = true; - sha256 = "1nxmqdlyfx7w3g5vhjfq24yrc9hwpsa2mjv58xrmhh8vvy50ziqq"; - - postFetch = '' - cd $out - ${nixpkgs.git}/bin/git log -n 1 "--format=format:devel +%H %cd" HEAD > VERSION - rm -rf .git - ''; - }; - }); - # Make NixOS available nixos = import "${nixpkgsSrc}/nixos"; }) diff --git a/third_party/nixpkgs-exposed/exposed/default.nix b/third_party/nixpkgs-exposed/exposed/default.nix index b24f134bc..bf8d7eac5 100644 --- a/third_party/nixpkgs-exposed/exposed/default.nix +++ b/third_party/nixpkgs-exposed/exposed/default.nix @@ -62,6 +62,7 @@ gmock gnused gnutar + go google-cloud-sdk graphviz gzip