Skip to content

Commit

Permalink
packages/contrast: use buildGoCache
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Meyer <[email protected]>
  • Loading branch information
katexochen committed Jul 19, 2024
1 parent 4ea193d commit e0c2784
Show file tree
Hide file tree
Showing 5 changed files with 215 additions and 4 deletions.
80 changes: 79 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
build-go-cache = {
url = "github:katexochen/build-go-cache/fork";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs =
Expand All @@ -21,14 +25,18 @@
nixpkgs,
flake-utils,
treefmt-nix,
build-go-cache,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import ./overlays/nixpkgs.nix) ];
overlays = [
(final: prev: { inherit (build-go-cache.legacyPackages.${system}) buildGoCache; })
(import ./overlays/nixpkgs.nix)
];
};
inherit (pkgs) lib;
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
Expand Down
2 changes: 1 addition & 1 deletion initializer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func run() (retErr error) {
dial := dialer.NewWithKey(issuer, atls.NoValidator, &net.Dialer{}, privKey)
conn, err := dial.Dial(ctx, net.JoinHostPort(coordinatorHostname, meshapi.Port))
if err != nil {
return nil, fmt.Errorf("dialing: %w", err)
return nil, fmt.Errorf("test: %w", err)
}
defer conn.Close()

Expand Down
114 changes: 114 additions & 0 deletions packages/by-name/contrast/imported-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
bufio
bytes
context
crypto/ecdsa
crypto/elliptic
crypto/rand
crypto/rsa
crypto/sha256
crypto/sha512
crypto/tls
crypto/x509
crypto/x509/pkix
embed
encoding/asn1
encoding/base64
encoding/hex
encoding/json
encoding/pem
errors
filippo.io/keygen
flag
fmt
github.com/google/go-github/v62/github
github.com/google/go-sev-guest/abi
github.com/google/go-sev-guest/client
github.com/google/go-sev-guest/kds
github.com/google/go-sev-guest/proto/sevsnp
github.com/google/go-sev-guest/validate
github.com/google/go-sev-guest/verify
github.com/google/go-sev-guest/verify/trust
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus
github.com/katexochen/sync/api/client
github.com/prometheus/client_golang/prometheus
github.com/prometheus/client_golang/prometheus/promauto
github.com/prometheus/client_golang/prometheus/promhttp
github.com/prometheus/client_golang/prometheus/testutil
github.com/prometheus/common/expfmt
github.com/spf13/afero
github.com/spf13/cobra
github.com/spf13/pflag
github.com/stretchr/testify/assert
github.com/stretchr/testify/require
go.uber.org/goleak
golang.org/x/crypto/hkdf
golang.org/x/exp/constraints
golang.org/x/sync/errgroup
golang.org/x/sys/unix
google.golang.org/grpc
google.golang.org/grpc/codes
google.golang.org/grpc/credentials
google.golang.org/grpc/credentials/insecure
google.golang.org/grpc/keepalive
google.golang.org/grpc/peer
google.golang.org/grpc/status
google.golang.org/protobuf/proto
google.golang.org/protobuf/reflect/protoreflect
google.golang.org/protobuf/runtime/protoimpl
google.golang.org/protobuf/types/known/wrapperspb
gopkg.in/yaml.v3
hash
io
io/fs
k8s.io/api/apps/v1
k8s.io/api/batch/v1
k8s.io/api/core/v1
k8s.io/apimachinery/pkg/api/meta
k8s.io/apimachinery/pkg/api/resource
k8s.io/apimachinery/pkg/apis/meta/v1
k8s.io/apimachinery/pkg/apis/meta/v1/unstructured
k8s.io/apimachinery/pkg/runtime
k8s.io/apimachinery/pkg/runtime/serializer/yaml
k8s.io/apimachinery/pkg/util/intstr
k8s.io/apimachinery/pkg/watch
k8s.io/client-go/applyconfigurations
k8s.io/client-go/applyconfigurations/apps/v1
k8s.io/client-go/applyconfigurations/batch/v1
k8s.io/client-go/applyconfigurations/core/v1
k8s.io/client-go/applyconfigurations/meta/v1
k8s.io/client-go/applyconfigurations/node/v1
k8s.io/client-go/dynamic
k8s.io/client-go/kubernetes
k8s.io/client-go/kubernetes/scheme
k8s.io/client-go/rest
k8s.io/client-go/restmapper
k8s.io/client-go/tools/clientcmd
k8s.io/client-go/tools/portforward
k8s.io/client-go/tools/remotecommand
k8s.io/client-go/transport/spdy
k8s.io/utils/clock
k8s.io/utils/clock/testing
log
log/slog
math/big
net
net/http
net/url
os
os/exec
os/signal
path
path/filepath
reflect
regexp
runtime
sigs.k8s.io/yaml
slices
sort
strconv
strings
sync
sync/atomic
testing
text/tabwriter
time
13 changes: 12 additions & 1 deletion packages/by-name/contrast/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@
lib,
buildGoModule,
buildGoTest,
buildGoCache,
microsoft,
genpolicy ? microsoft.genpolicy,
contrast,
installShellFiles,
}:

let
goCache = buildGoCache {
importPackagesFile = ./imported-packages;
inherit (contrast) vendorHash proxyVendor src;
};
e2e = buildGoTest {
inherit (contrast)
version
Expand All @@ -23,6 +28,8 @@ let
;
pname = "${contrast.pname}-e2e";

buildInputs = [ goCache ];

tags = [ "e2e" ];

ldflags = [
Expand Down Expand Up @@ -87,6 +94,8 @@ buildGoModule rec {

nativeBuildInputs = [ installShellFiles ];

buildInputs = [ goCache ];

subPackages = packageOutputs ++ [ "internal/kuberesource/resourcegen" ];

prePatch = ''
Expand Down Expand Up @@ -115,6 +124,8 @@ buildGoModule rec {
runHook postCheck
'';

# doCheck = false;

postInstall = ''
for sub in ${builtins.concatStringsSep " " packageOutputs}; do
mkdir -p "''${!sub}/bin"
Expand All @@ -134,7 +145,7 @@ buildGoModule rec {
'';

passthru = {
inherit e2e;
inherit e2e goCache;
inherit (genpolicy) settings rules;
};

Expand Down

0 comments on commit e0c2784

Please sign in to comment.