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

tilt: 0.33.10 -> 0.33.12 #306333

Closed
wants to merge 1 commit into from
Closed
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
26 changes: 16 additions & 10 deletions pkgs/applications/networking/cluster/tilt/assets.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
{ lib
, stdenvNoCC
, version, src
, fetchYarnDeps
, fixup-yarn-lock, yarn, nodejs
, yarn-berry, callPackage
, nodejs
}:

stdenvNoCC.mkDerivation rec {
pname = "tilt-assets";

inherit src version;

nativeBuildInputs = [ fixup-yarn-lock yarn nodejs ];
nativeBuildInputs = [ yarn-berry nodejs ];

yarnOfflineCache = fetchYarnDeps {
yarnLock = "${src}/web/yarn.lock";
hash = "sha256-0JpoAQKRmU7P1bzYNR/vqtPjOOSw8wSlNjXl2f6uBrw=";
/*
Introduced as a temporary hack until 'fetchYarnDeps' is fixed to
accommodate yarn berry lockfiles:
https://github.com/NixOS/nixpkgs/issues/254369
*/
yarnOfflineCache = callPackage ./yarn.nix {
inherit src;
hash = "sha256-Z5sTVFyfSVw5soLj7mGjYMWT+51KVqjeaVqKsVD5IUg=";
};

configurePhase = ''
Expand All @@ -24,11 +29,12 @@ stdenvNoCC.mkDerivation rec {
buildPhase = ''
runHook preBuild

yarn config --offline set yarn-offline-mirror $yarnOfflineCache

cd web
fixup-yarn-lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-engines

export YARN_ENABLE_TELEMETRY=0
ln -sf $yarnOfflineCache /build/source/web/.yarn/cache
yarn install --immutable --immutable-cache

patchShebangs node_modules
export PATH=$PWD/node_modules/.bin:$PATH
./node_modules/.bin/react-scripts build
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/networking/cluster/tilt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ let args = rec {
/* Do not use "dev" as a version. If you do, Tilt will consider itself
running in development environment and try to serve assets from the
source tree, which is not there once build completes. */
version = "0.33.10";
version = "0.33.12";

src = fetchFromGitHub {
owner = "tilt-dev";
repo = "tilt";
rev = "v${version}";
hash = "sha256-LPb2tC3xIGhjiLYkTU+NBIUoqiicO2ORM6Nt1eTnwQs=";
hash = "sha256-gZD99wu8RxqWOdIDz3L/OEFvYIS0r2xIpecB4sTRzqg=";
};
};

Expand Down
41 changes: 41 additions & 0 deletions pkgs/applications/networking/cluster/tilt/yarn.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
Introduced as a temporary hack until 'fetchYarnDeps' is fixed to
accommodate yarn berry lockfiles:
https://github.com/NixOS/nixpkgs/issues/254369
*/
{
stdenvNoCC,
yarn-berry,
cacert,
src,
hash,
}:
stdenvNoCC.mkDerivation {
name = "yarn-deps";
nativeBuildInputs = [yarn-berry cacert];
inherit src;

dontInstall = true;

NODE_EXTRA_CA_CERTS = "${cacert}/etc/ssl/certs/ca-bundle.crt";

buildPhase = ''
cd web
mkdir -p $out

export HOME=$(mktemp -d)
echo $HOME

export YARN_ENABLE_TELEMETRY=0
export YARN_COMPRESSION_LEVEL=mixed

cache="$(yarn config get cacheFolder)"
yarn install --immutable --mode skip-build

cp -r $cache/* $out/
'';

outputHashAlgo = "sha256";
outputHash = hash;
outputHashMode = "recursive";
}