-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
immich: 1.123.0 -> 1.124.2 #371942
immich: 1.123.0 -> 1.124.2 #371942
Conversation
Building sharp from source fails with
as in lovell/sharp#4253. Any ideas? |
The reference code comes from node-addon-api: |
Yes, and I tried updating node-addon-api but that didn't help. |
0790177
to
95d1bc2
Compare
Build issue with the latest Updating from 1.123.0 Archive: ./cities500.zip [nix-shell:~/nixpkgs]$ git stash [nix-shell:~/nixpkgs]$ git status |
diff --git a/pkgs/by-name/im/immich/package.nix b/pkgs/by-name/im/immich/package.nix
index 6a9c5f5973c3..b6bae49fabb0 100644
--- a/pkgs/by-name/im/immich/package.nix
+++ b/pkgs/by-name/im/immich/package.nix
@@ -184,6 +184,7 @@ buildNpmPackage' {
# we manually build sharp from source later on
# FIXME figure out why otherwise it fails with
# error: 'NewOrCopy' is not a member of 'Napi::Buffer<char>'
+ unset SHARP_IGNORE_GLOBAL_LIBVIPS
export SHARP_IGNORE_GLOBAL_LIBVIPS=1
'';
@@ -199,6 +200,8 @@ buildNpmPackage' {
mkdir node_modules
ln -s ${node-addon-api} node_modules/node-addon-api
+ unset SHARP_IGNORE_GLOBAL_LIBVIPS
+ export SHARP_FORCE_GLOBAL_LIBVIPS=1
node install/check
rm -r node_modules fixed the sharp build failure for me |
That doesn't make any sense. Anyway, I tried it and get the same build error. Can you post the entire code that supposedly works? |
I might have messed up on my end. Let me double check. the culprit seems to be https://github.com/immich-app/immich/blob/d5a9294eebcf303b63e585b4b668687f3146b471/server/package-lock.json#L11131 |
So, one issue seems to be that |
pkgs/by-name/im/immich/package.nix
Outdated
rm -r node_modules/node-addon-api | ||
rm -r node_modules/**/node-addon-api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vale981 That's not an issue since I remove all old versions of node-addon-api here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the thing is that the hook doesn't know about that...
with renaming preConfigure to prePatch, I get it to build but then it fails with
> Finished npmBuildHook
> Running phase: glibPreInstallPhase
> Running phase: glibPreInstallPhase
> Running phase: installPhase
> npm error code ENOTCACHED
> npm error request to https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz failed: cache mode is 'only-if-cached' but no cached response is available.
> npm error A complete log of this run can be found in: /build/.npm/_logs/2025-01-18T01_34_28_575Z-debug-0.log
For full logs, run 'nix log /nix/store/l1jg60arlbd2y1v7bi10hj7lcqfqh8gq-immich-1.124.2.drv'.
Ok. Applying the following on top of your pr seems to work for me. Something internal to buildNpmPackage seems to have changed... diff --git a/pkgs/by-name/im/immich/package.nix b/pkgs/by-name/im/immich/package.nix
index 6a9c5f5973c3..f3e314446a00 100644
--- a/pkgs/by-name/im/immich/package.nix
+++ b/pkgs/by-name/im/immich/package.nix
@@ -180,7 +180,7 @@ buildNpmPackage' {
# Required because vips tries to write to the cache dir
makeCacheWritable = true;
- preConfigure = ''
+ prePatch = ''
# we manually build sharp from source later on
# FIXME figure out why otherwise it fails with
# error: 'NewOrCopy' is not a member of 'Napi::Buffer<char>'
@@ -213,9 +213,6 @@ buildNpmPackage' {
installPhase = ''
runHook preInstall
- npm config delete cache
- npm prune --omit=dev
-
# remove build artifacts that bloat the closure
rm -r node_modules/**/{*.target.mk,binding.Makefile,config.gypi,Makefile,Release/.deps} |
Thanks! So my approach was correct but |
There seems to be another dependency of theirs that needs the 5er version. I don't know how npm handles such conficts... Edit: haha... i didn't look at your PR. Now I see how it's done :P. I still wonder why the sharp dependency doesn't enforce that version of the addon api though.... Edit edit: So it's a devDependency of sharp... is there a way to get nix to care about that (transitively through the immich package)? I guess adding it to immich is fine if they're cool with it. |
Diff: immich-app/immich@refs/tags/v1.123.0...v1.124.2
Changelog:
https://github.com/immich-app/immich/releases/tag/v1.124.0
https://github.com/immich-app/immich/releases/tag/v1.124.1
https://github.com/immich-app/immich/releases/tag/v1.124.2
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)closes #366377
Add a 👍 reaction to pull requests you find important.