Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turbo: 1.13.2 -> 2.0.11; modernize; adopt #328295

Merged
merged 7 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pkgs/by-name/tu/turbo-unwrapped/enable-lazy_cell.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/crates/turborepo-lib/src/lib.rs b/crates/turborepo-lib/src/lib.rs
index e8d41933da..26b8c7c92f 100644
--- a/crates/turborepo-lib/src/lib.rs
+++ b/crates/turborepo-lib/src/lib.rs
@@ -2,6 +2,7 @@
#![feature(box_patterns)]
#![feature(error_generic_member_access)]
#![feature(hash_extract_if)]
+#![feature(lazy_cell)]
#![feature(option_get_or_insert_default)]
#![feature(once_cell_try)]
#![feature(panic_info_message)]
96 changes: 96 additions & 0 deletions pkgs/by-name/tu/turbo-unwrapped/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
stdenv,
lib,
fetchFromGitHub,
rustPlatform,
capnproto,
darwin,
extra-cmake-modules,
fontconfig,
llvmPackages,
nix-update-script,
openssl,
pkg-config,
protobuf,
rust-jemalloc-sys,
zlib,
}:

rustPlatform.buildRustPackage rec {
pname = "turbo-unwrapped";
version = "2.0.12";

src = fetchFromGitHub {
owner = "vercel";
repo = "turbo";
rev = "v${version}";
hash = "sha256-rh9BX8M3Kgu07Pz4G3AM6S9zeK3Bb6CzOpcYo7rQgIw=";
};

patches = [
# upstream uses nightly where lazy_cell is stable
./enable-lazy_cell.patch
];

cargoHash = "sha256-oZHSoPrPCUwXSrxEASm4LuYO+XHyNDRRl38Q7U7F/lk=";

nativeBuildInputs =
[
capnproto
extra-cmake-modules
pkg-config
protobuf
]
# https://github.com/vercel/turbo/blob/ea740706e0592b3906ab34c7cfa1768daafc2a84/CONTRIBUTING.md#linux-dependencies
++ lib.optional stdenv.isLinux llvmPackages.bintools;

buildInputs =
[
fontconfig
openssl
rust-jemalloc-sys
zlib
]
++ lib.optionals stdenv.isDarwin (
with darwin.apple_sdk_11_0.frameworks;
[
CoreFoundation
CoreServices
IOKit
]
);

cargoBuildFlags = [
"--package"
"turbo"
];

# Browser tests time out with chromium and google-chrome
doCheck = false;

env = {
# nightly features are used
RUSTC_BOOTSTRAP = 1;
};

passthru = {
updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"'v(\d+\.\d+\.\d+)'"
];
};
};

meta = {
description = "High-performance build system for JavaScript and TypeScript codebases";
homepage = "https://turbo.build/";
changelog = "https://github.com/vercel/turbo/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
dlip
getchoo
];
mainProgram = "turbo";
};
}
42 changes: 42 additions & 0 deletions pkgs/by-name/tu/turbo/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
lib,
symlinkJoin,
makeBinaryWrapper,
testers,
turbo,
turbo-unwrapped,
# https://turbo.build/repo/docs/telemetry
disableTelemetry ? true,
disableUpdateNotifier ? true,
}:

symlinkJoin rec {
pname = "turbo";
inherit (turbo-unwrapped) version;
name = "${pname}-${version}";

nativeBuildInputs = [ makeBinaryWrapper ];

paths = [ turbo-unwrapped ];

postBuild = ''
wrapProgram $out/bin/turbo \
${lib.optionalString disableTelemetry "--set TURBO_TELEMETRY_DISABLED 1"} \
${lib.optionalString disableUpdateNotifier "--set TURBO_NO_UPDATE_NOTIFIER 1"}
'';

passthru = {
tests.version = testers.testVersion { package = turbo; };
};

meta = {
inherit (turbo-unwrapped.meta)
description
homepage
changelog
license
mainProgram
maintainers
;
};
}
Loading