| Age | Commit message (Collapse) | Author |
|
|
|
|
|
The pnpm v11 store uses a SQLite database (index.db) whose binary format
is non-deterministic across platforms (version-valid-for number, etc).
This caused hash mismatches when building the same pnpmDeps on different
machines despite identical logical content.
Fix by dumping the SQLite database to a text SQL file during the fetch
phase and reconstructing it during the build phase. This ensures the
stored representation is fully deterministic.
Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Gergő Gutyina <gutyina.gergo.2@gmail.com>
|
|
See https://github.com/NixOS/nixpkgs/pull/505103#issuecomment-4496933583
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
|
|
|
|
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
|
|
|
|
(#518360)
|
|
|
|
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
|
|
pnpm 11 does not support configuring some options through its new global
config format. As a workaround, we can define these environment
variables instead.
This also adds support for the new pmOnFail option in pnpm 11 that
replaces managePackageManagerVersions.
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
|
|
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
|
|
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
|
|
Extend the existing v1 deprecation warning to also fire for
`fetcherVersion = 2`, since callers should migrate directly to
`fetcherVersion = 3`. Both pre-v3 versions now share a single
`lib.warnIf` keyed on `fetcherVersion < 3` and produce a message
parameterised by the offending version.
Consolidate the manual's version-history entries: the per-item
**Deprecated** and **Recommended** labels are replaced by a single
sentence above the list noting that v3 is recommended and v1/v2 are
scheduled for removal.
Add a release note mirroring the existing v1 entry.
|
|
|
|
If the lockfile is empty, no files will be put in the output directory.
In this case, the find invocations produce an empty list of results.
xargs' default behaviour is to always invoke its command at least once;
if its input is empty, then its command will not be passed any
filenames. This produces an invocation like `chmod 555`. chmod, however,
fails in this case, expecting an operand. So we need to tell xargs not
to invoke its command at all in the case of empty input.
|
|
|
|
fetcherVersion = 1 was kept around for backwards compatibility while
callers migrated to 2/3.
Emit a `lib.warnIf` warning pointing at the affected pname whenever v1
is used.
After 26.11 ships, a follow-up PR should drop 1 from
`supportedFetcherVersions` and clean up the dead v1 code paths in
default.nix, pnpm-config-hook.sh and serve.nix.
Also rewrite the manual section to recommend fetcherVersion = 3 for new
packages and mark v1 as deprecated/scheduled-for-removal in the
version history.
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
|
|
|
|
|
|
The command `npm run` is wrongly logged as `npm build`. Fix it. Also,
the build script can be overridden, so log what is actually used:
npm run $npmBuildScript [...]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This would prevent hanging when pnpm tries to download the version set in package.json.
|
|
This is a shell builtin and is safer when dealing with large inputs:
it avoids possible 'argument list too long' errors.
|
|
passAsFile (#498929)
|
|
npm's locking process resolves Git dependencies to a given commit, separated
by a `#`. Before this change, any encounter of these URLs would cause `fetchGit`
to fail, as they're not valid repo URLs.
|
|
|
|
Up to now, existing symlinks were replaced by removing the existing link
and then creating a new one. This left a window where the link did not
exist, which would break cases where the hook was running concurrently
with other things using node_modules.
In my case, I would run multiple webpack builds at once like:
nix develop -c webpack build --mode production
nix develop -c webpack build --mode development
If one of the shells was ready faster than the other, webpack would
start running, then the second would run the linkNodeModules hook, and
the earlier webpack build would run into missing files as the second
linkNodeModules hook removed symlinks to replace them.
This change mitigates this race condition in two ways:
- Not replacing the symlink if it already points to the right target
(this also avoids superfluous filesystem writes)
- Replacing the symlink atomically, using a rename,
otherwise. The symlink was replaced atomically prior to
db7050bb887b72530d4c65a71af33cb49f710fab as well, but the name of the
temporary symlink was always the same, which led to a similar race
condition. This change reintroduces the atomic replacement, but adds
the PID to the temporary filename in order to avoid conflicting with
other instances of the hook running concurrently.
|
|
|
|
This should bring this in line with other packages in nixpkgs.
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
|
|
|
|
Do not rely on npmDeps being exported.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Upstream projects' `package-lock.json` file might include many deps with
no resolved line in them, as described here:
https://github.com/npm/cli/issues/6301
This can cause dependencies to be missing after generating a hash for
`.npmDeps`. If such dependencies are encountered, it's nice to print
them and warn the user that an upstream patch might be needed.
Co-Authored-By: Jörg Thalheim <joerg@thalheim.io>
|
|
|