sapling: 0.2.20230523-092610 -> 0.2.20231113-145254

The build for Sapling's isl package has changed:

* Instead of being a bunch of .js files installed along-side the main
  executable, isl is now one isl-dist.tar.xz file extracted at
  run-time by the 'sl web' command.

* To configure the 'node' executable used by 'sl web', set the
  web.node-path Sapling setting by changing the default configs
  embedded in the sl executable.
This commit is contained in:
Matthew "strager" Glazar 2023-11-15 22:36:01 -05:00 committed by Austin Seipp
parent 01449869ed
commit d6400c8a2a
4 changed files with 1925 additions and 1194 deletions

File diff suppressed because it is too large Load Diff

View File

@ -16,9 +16,12 @@
, fixup_yarn_lock
, glibcLocales
, libiconv
, Cocoa
, CoreFoundation
, CoreGraphics
, CoreServices
, Security
, WebKit
, enableMinimal ? false
}:
@ -45,7 +48,7 @@ let
owner = "facebook";
repo = "sapling";
rev = version;
hash = "sha256-NwOexCU+TdZAdruivqRuqhwt0veryeGykLdH6vth+p4=";
hash = "sha256-+LxvPJkyq/6gtcBQepZ5pVGXP1/h30zhCHVfUGPUzFE=";
};
addonsSrc = "${src}/addons";
@ -53,7 +56,7 @@ let
# Fetches the Yarn modules in Nix to to be used as an offline cache
yarnOfflineCache = fetchYarnDeps {
yarnLock = "${addonsSrc}/yarn.lock";
sha256 = "sha256-AlY7/cdGr4i87+wMhPBh/+LFDoF8aC23OLDEHu9lYqU=";
sha256 = "sha256-3JFrVk78EiNVLLXkCFbuRnXwYHNfVv1pBPBS1yCHtPU=";
};
# Builds the NodeJS server that runs with `sl web`
@ -77,6 +80,14 @@ let
yarn install --offline --frozen-lockfile --ignore-engines --ignore-scripts --no-progress
patchShebangs node_modules
# TODO: build-tar.py tries to run 'yarn install'. We patched
# shebangs node_modules, so we don't want 'yarn install'
# changing files. We should disable the 'yarn install' in
# build-tar.py to be safe.
${python3Packages.python}/bin/python3 build-tar.py \
--output isl-dist.tar.xz \
--yarn 'yarn --offline --frozen-lockfile --ignore-engines --ignore-scripts --no-progress'
runHook postBuild
'';
@ -84,8 +95,7 @@ let
runHook preInstall
mkdir -p $out
cd isl
node release.js $out
install isl-dist.tar.xz $out/isl-dist.tar.xz
runHook postInstall
'';
@ -103,14 +113,20 @@ python3Packages.buildPythonApplication {
lockFile = ./Cargo.lock;
outputHashes = {
"abomonation-0.7.3+smallvec1" = "sha256-AxEXR6GC8gHjycIPOfoViP7KceM29p2ZISIt4iwJzvM=";
"cloned-0.1.0" = "sha256-MKyj91z+hciJOg4Lhb6ik7zUgCwuHsX8N9HVSP2JkKE=";
"fb303_core-0.0.0" = "sha256-5AU54rpeDub2Iol56S4X+xfdU07zWAtOyCNRBZLzUZA=";
"fbthrift-0.0.1+unstable" = "sha256-n4ES6zRyTgsNxbrM4AUraJ6W4tLHiKdfSyL3Yd0ET34=";
"serde_bser-0.3.1" = "sha256-PkQx2/axT/7LQ4Mvfz1AYBWKXGvaTHkOP2jtljvuYxY=";
"cloned-0.1.0" = "sha256-dtAyQq6fgxvr1RXPQHGiCQesvitsKpVkis4c50uolLc=";
"fb303_core-0.0.0" = "sha256-j+4zPXxewRxJsPQaAfvcpSkGNKw3d+inVL45Ibo7Q4E=";
"fbthrift-0.0.1+unstable" = "sha256-fsIL07PFu645eJFttIJU4sRSjIVuA4BMJ6kYAA0BpwY=";
"serde_bser-0.3.1" = "sha256-h50EJL6twJwK90sBXu40Oap4SfiT4kQAK1+bA8XKdHw=";
};
};
postPatch = ''
cp ${./Cargo.lock} Cargo.lock
'' + lib.optionalString (!enableMinimal) ''
# If asked, we optionally patch in a hardcoded path to the
# 'nodejs' package, so that 'sl web' always works. Without the
# patch, 'sl web' will still work if 'nodejs' is in $PATH.
substituteInPlace lib/config/loader/src/builtin_static/core.rs \
--replace '"#);' $'[web]\nnode-path=${nodejs}/bin/node\n"#);'
'';
# Since the derivation builder doesn't have network access to remain pure,
@ -122,23 +138,8 @@ python3Packages.buildPythonApplication {
sed -i "s|https://files.pythonhosted.org/packages/[[:alnum:]]*/[[:alnum:]]*/[[:alnum:]]*/|file://$NIX_BUILD_TOP/$sourceRoot/hack_pydeps/|g" $sourceRoot/setup.py
'';
# Now, copy the "sl web" (aka edenscm-isl) results into the output of this
# package, so that the command can actually work. NOTES:
#
# 1) This applies on all systems (so no conditional a la postFixup)
# 2) This doesn't require any kind of fixup itself, so we leave it out
# of postFixup for that reason, too
# 3) If asked, we optionally patch in a hardcoded path to the 'nodejs' package,
# so that 'sl web' always works
# 4) 'sl web' will still work if 'nodejs' is in $PATH, just not OOTB
preFixup = ''
sitepackages=$out/lib/${python3Packages.python.libPrefix}/site-packages
chmod +w $sitepackages
cp -r ${isl} $sitepackages/edenscm-isl
'' + lib.optionalString (!enableMinimal) ''
chmod +w $sitepackages/edenscm-isl/run-isl
substituteInPlace $sitepackages/edenscm-isl/run-isl \
--replace 'NODE=node' 'NODE=${nodejs}/bin/node'
postInstall = ''
install ${isl}/isl-dist.tar.xz $out/lib/isl-dist.tar.xz
'';
postFixup = lib.optionalString stdenv.isLinux ''
@ -159,9 +160,12 @@ python3Packages.buildPythonApplication {
] ++ lib.optionals stdenv.isDarwin [
curl
libiconv
Cocoa
CoreFoundation
CoreGraphics
CoreServices
Security
WebKit
];
HGNAME = "sl";
@ -183,6 +187,9 @@ python3Packages.buildPythonApplication {
echo "OK!"
'';
# Expose isl to nix repl as sapling.isl.
passthru.isl = isl;
meta = with lib; {
description = "A Scalable, User-Friendly Source Control System";
homepage = "https://sapling-scm.com";

View File

@ -1,78 +1,5 @@
{
"links": [
{
"sha256": "0dgg5x4nvdpfiz552diy11xg72y14s38hjz9qxygafnfgybg6hab",
"url": "https://files.pythonhosted.org/packages/22/a6/858897256d0deac81a172289110f31629fc4cee19b6f01283303e18c8db3/ptyprocess-0.7.0-py2.py3-none-any.whl"
},
{
"sha256": "0dq9f7irmml1nm9a2rx8dd6m2dqmzjj1x40mk0rg619wrdfsaj0b",
"url": "https://files.pythonhosted.org/packages/39/7b/88dbb785881c28a102619d46423cb853b46dbccc70d3ac362d99773a78ce/pexpect-4.8.0-py2.py3-none-any.whl"
},
{
"sha256": "0r4xy2sqwyhwlwj81zvhzbnx7a7r4xdz9xyzzkjczlx7gk1cig1d",
"url": "https://files.pythonhosted.org/packages/23/6a/210816c943c9aeeb29e4e18a298f14bf0e118fe222a23e13bfcc2d41b0a4/ipython-7.16.1-py3-none-any.whl"
},
{
"sha256": "0wwi1c6md4vkbcsfsf8dklf3vr4mcdj4mpxkanwgb6jb1432x5yw",
"url": "https://files.pythonhosted.org/packages/3d/57/4d9c9e3ae9a255cd4e1106bb57e24056d3d0709fc01b2e3e345898e49d5b/simplegeneric-0.8.1.zip"
},
{
"sha256": "16sgpg57kxx5jh467d9qwc2hwshfvdbl0xkafdp3qspvbfp46qc0",
"url": "https://files.pythonhosted.org/packages/44/6f/7120676b6d73228c96e17f1f794d8ab046fc910d781c8d151120c3f1569e/toml-0.10.2-py2.py3-none-any.whl"
},
{
"sha256": "1qn3bnyd7gdwkyk8nvlhiy3c6zbwjd49fjxj0gp8xxi9faiysiwz",
"url": "https://files.pythonhosted.org/packages/44/98/5b86278fbbf250d239ae0ecb724f8572af1c91f4a11edf4d36a206189440/colorama-0.4.4-py2.py3-none-any.whl"
},
{
"sha256": "0mfj5d1bgpy1clfgwrkmjqm2pv70pm01jp4iyyhphc96kyifdg7v",
"url": "https://files.pythonhosted.org/packages/4c/1c/ff6546b6c12603d8dd1070aa3c3d273ad4c07f5771689a7b69a550e8c951/backcall-0.2.0-py2.py3-none-any.whl"
},
{
"sha256": "0yxz45fzjsq6zh5f9cjl0gf4vfg1l7rd79zyb3ih544layjg3ff8",
"url": "https://files.pythonhosted.org/packages/4e/78/56aa1b5f4d8ac548755ae767d84f0be54fdd9d404197a3d9e4659d272348/setuptools-57.0.0-py3-none-any.whl"
},
{
"sha256": "1177pfa343r378020a85l3b16ak479qgyvh8k5719fgbkhm81d5y",
"url": "https://files.pythonhosted.org/packages/59/7c/e39aca596badaf1b78e8f547c807b04dae603a433d3e7a7e04d67f2ef3e5/wcwidth-0.2.5-py2.py3-none-any.whl"
},
{
"sha256": "1r55ffffaq4q3dpvha7iipgxlqwvjg5cklf9izr42xj5rr226r26",
"url": "https://files.pythonhosted.org/packages/87/61/2dfea88583d5454e3a64f9308a686071d58d59a55db638268a6413e1eb6d/prompt_toolkit-2.0.10-py3-none-any.whl"
},
{
"sha256": "08v36wa0kckc892bk4nypl6sszbysarm8jhslviz1agp2sf1jp3f",
"url": "https://files.pythonhosted.org/packages/6a/36/b1b9bfdf28690ae01d9ca0aa5b0d07cb4448ac65fb91dc7e2d094e3d992f/decorator-5.0.9-py3-none-any.whl"
},
{
"sha256": "0mnzcb714ynl1qlv9dwnh50rv75mmj18ywaxbl8xzm3l9m0syjcn",
"url": "https://files.pythonhosted.org/packages/9a/41/220f49aaea88bc6fa6cba8d05ecf24676326156c23b991e80b3f2fc24c77/pickleshare-0.7.5-py2.py3-none-any.whl"
},
{
"sha256": "13iv73575lilrm01ffhr8y8sxn8kxhvfqsgwckbr919725280vnn",
"url": "https://files.pythonhosted.org/packages/a6/c9/be11fce9810793676017f79ffab3c6cb18575844a6c7b8d4ed92f95de604/Pygments-2.9.0-py3-none-any.whl"
},
{
"sha256": "0i7ycyjad9kq6lgq5ih7j8xsm639z24250s6d17pp781v6hwdd3h",
"url": "https://files.pythonhosted.org/packages/ca/ab/872a23e29cec3cf2594af7e857f18b687ad21039c1f9b922fac5b9b142d5/traitlets-4.3.3-py2.py3-none-any.whl"
},
{
"sha256": "0m02dsi8lvrjf4bi20ab6lm7rr6krz7pg6lzk3xjs2l9hqfjzfwa",
"url": "https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl"
},
{
"sha256": "1f7sc4ydjj33gadcgfz8fcx02d1wm2frlqwzdik1krlr6wikgpbj",
"url": "https://files.pythonhosted.org/packages/fa/bc/9bd3b5c2b4774d5f33b2d544f1460be9df7df2fe42f352135381c347c69a/ipython_genutils-0.2.0-py2.py3-none-any.whl"
},
{
"sha256": "1ibql99agjf2gj7y0svzd5m0h81hailf4p3sj3yl9i1i8ykdj6wm",
"url": "https://files.pythonhosted.org/packages/fc/56/9f67dcd4a4b9960373173a31be1b8c47fe351a1c9385677a7bdd82810e57/ipdb-0.13.9.tar.gz"
},
{
"sha256": "1xqsihpqnfal29nb5kmw8z71nd4jbsnbz7p3lkr094xpb13wycw7",
"url": "https://files.pythonhosted.org/packages/4c/76/1e41fbb365ad20b6efab2e61b0f4751518444c953b390f9b2d36cf97eea0/Cython-0.29.32.tar.gz"
}
],
"version": "0.2.20230523-092610+f12b7eee",
"versionHash": "11350811807294821405"
"links": [],
"version": "0.2.20231113-145254+995db0d6",
"versionHash": "214505116687308775"
}

View File

@ -33681,7 +33681,7 @@ with pkgs;
};
sapling = callPackage ../applications/version-management/sapling {
inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices Security;
inherit (darwin.apple_sdk.frameworks) Cocoa CoreFoundation CoreGraphics CoreServices Security WebKit;
};
mercurialFull = mercurial.override { fullBuild = true; };