From 28077c7e24732423d9951e438927b67b56c98cab Mon Sep 17 00:00:00 2001 From: Dane Lipscombe Date: Mon, 29 Jan 2024 17:04:12 +1100 Subject: turbo: refactor to remove golang code --- pkgs/tools/misc/turbo/default.nix | 104 ++------------------------------------ 1 file changed, 3 insertions(+), 101 deletions(-) (limited to 'pkgs/tools') diff --git a/pkgs/tools/misc/turbo/default.nix b/pkgs/tools/misc/turbo/default.nix index 904e89da76ce..c891ad5d0da2 100644 --- a/pkgs/tools/misc/turbo/default.nix +++ b/pkgs/tools/misc/turbo/default.nix @@ -1,13 +1,7 @@ { stdenv , lib , fetchFromGitHub -, buildGo120Module -, git -, nodejs -, capnproto , protobuf -, protoc-gen-go -, protoc-gen-go-grpc , rustPlatform , pkg-config , openssl @@ -17,15 +11,13 @@ , testers , turbo , nix-update-script -, go -, zlib -, libiconv -, Security , IOKit , CoreServices , CoreFoundation +, capnproto }: -let +rustPlatform.buildRustPackage rec{ + pname = "turbo"; version = "1.11.3"; src = fetchFromGitHub { owner = "vercel"; @@ -33,92 +25,6 @@ let rev = "v${version}"; hash = "sha256-hjJXbGct9ZmriKdVjB7gwfmFsV1Tv57V7DfUMFZ8Xv0="; }; - - ffi = rustPlatform.buildRustPackage { - pname = "turbo-ffi"; - inherit src version; - cargoBuildFlags = [ "--package" "turborepo-ffi" ]; - - cargoHash = "sha256-3eN8/nBARuaezlzPjAL0YPEPvNqm6jNQAREth8PgcSQ="; - - RUSTC_BOOTSTRAP = 1; - nativeBuildInputs = [ - pkg-config - extra-cmake-modules - protobuf - ]; - buildInputs = [ - openssl - fontconfig - ]; - - doCheck = false; - - postInstall = '' - cp target/release-tmp/libturborepo_ffi.a $out/lib - ''; - }; - - - go-turbo = buildGo120Module { - inherit src version; - pname = "go-turbo"; - modRoot = "cli"; - - proxyVendor = true; - vendorHash = "sha256-JHTg9Gcc0DVdltTGCUaOPSVxL0XVkwPJQm/LoKffU/o="; - - nativeBuildInputs = [ - git - nodejs - protobuf - protoc-gen-go - protoc-gen-go-grpc - ]; - - buildInputs = [zlib ] ++ lib.optionals stdenv.isDarwin [ - Security - libiconv - ]; - - ldflags = [ - "-s -w" - "-X main.version=${version}" - "-X main.commit=${src.rev}" - "-X main.date=1970-01-01-00:00:01" - "-X main.builtBy=goreleaser" - ]; - - preBuild = '' - make compile-protos - cp ${ffi}/lib/libturborepo_ffi.a ./internal/ffi/libturborepo_ffi_${go.GOOS}_${go.GOARCH}.a - ''; - - preCheck = '' - # Some tests try to run mkdir $HOME - HOME=$TMP - - # Test_getTraversePath requires that source is a git repo - # pwd: /build/source/cli - pushd .. - git config --global init.defaultBranch main - git init - popd - - # package_deps_hash_test.go:492: hash of child-dir/libA/pkgignorethisdir/file, got 67aed78ea231bdee3de45b6d47d8f32a0a792f6d want go-turbo> package_deps_hash_test.go:499: found extra hashes in map[.gitignore:3237694bc3312ded18386964 a855074af7b066af some-dir/another-one:7e59c6a6ea9098c6d3beb00e753e2c54ea502311 some-dir/excluded-file:7e59 c6a6ea9098c6d3beb00e753e2c54ea502311 some-dir/other-file:7e59c6a6ea9098c6d3beb00e753e2c54ea502311 some-fil e:7e59c6a6ea9098c6d3beb00e753e2c54ea502311] - rm ./internal/hashing/package_deps_hash_test.go - rm ./internal/hashing/package_deps_hash_go_test.go - # Error: Not equal: - # expected: env.DetailedMap{All:env.EnvironmentVariableMap(nil), BySource:env.BySource{Explicit:env.EnvironmentVariableMap{}, Matching:env.EnvironmentVariableMap{}}} - # actual : env.DetailedMap{All:env.EnvironmentVariableMap{}, BySource:env.BySource{Explicit:env.EnvironmentVariableMap{}, Matching:env.EnvironmentVariableMap{}}} - rm ./internal/run/global_hash_test.go - ''; - - }; -in -rustPlatform.buildRustPackage { - pname = "turbo"; - inherit src version; cargoBuildFlags = [ "--package" "turbo" @@ -144,10 +50,6 @@ rustPlatform.buildRustPackage { CoreFoundation ]; - postInstall = '' - ln -s ${go-turbo}/bin/turbo $out/bin/go-turbo - ''; - # Browser tests time out with chromium and google-chrome doCheck = false; -- cgit 1.4.1