-
-
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
docmost: init at 0.5.0 #355762
base: master
Are you sure you want to change the base?
docmost: init at 0.5.0 #355762
Conversation
builds fine & getting expected results for a nixos module in the future 👍 |
hash = hashes.${stdenv.hostPlatform.system}; | ||
}; | ||
|
||
dontBuild = true; |
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.
Please add a comment explaining why we don't build from source
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.
Good question. I think I only did it this way because I saw another package (EDIT: It's PeerTube) that downloads bcrypt and didn't question it further — also, I don't know where you would put this since nodePackages
isn't exactly designed to be extensible
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.
Hmm.. maybe because it doesn't build for Darwin
npm error In file included from ../src/bcrypt_node.cc:3:
npm error In file included from /private/tmp/nix-build-bcrypt-lib-5.1.1.drv-0/source/node_modules/node-addon-api/napi.h:5:
npm error In file included from /nix/store/0m4n63p6lldjys591p2r5kbr87zcpfbz-libcxx-16.0.6-dev/include/c++/v1/functional:510:
npm error In file included from /nix/store/0m4n63p6lldjys591p2r5kbr87zcpfbz-libcxx-16.0.6-dev/include/c++/v1/__functional/bind.h:17:
npm error In file included from /nix/store/0m4n63p6lldjys591p2r5kbr87zcpfbz-libcxx-16.0.6-dev/include/c++/v1/tuple:1857:
npm error /nix/store/0m4n63p6lldjys591p2r5kbr87zcpfbz-libcxx-16.0.6-dev/include/c++/v1/new:355:14: error: no member named 'aligned_alloc' in the global namespace
npm error return ::aligned_alloc(__alignment, __size > __rounded_size ? __size : __rounded_size);
npm error ~~^
npm error 1 error generated.
npm error make: *** [bcrypt_lib.target.mk:131: Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1
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.
🤔 Is this an upstream bug or is it just not tested against Clang? Both could happen, TBH. Maybe try GCC?
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 log is from ofborg. If you want to try something, just push to this PR.
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.
I don't own any Macs 🤷🏼♀️
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.
If you push, ofborg will try to build it. I also don't have a Mac.
ccae76c
to
8d607a3
Compare
|
||
buildPhase = '' | ||
runHook preBuild | ||
node-pre-gyp install --build-from-source |
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.
Upstream relies on node-gyp-build
which in turn relies on/supports prebuildify
. Using that would allow us to use BCRYPT_PREBUILD
for the consuming package to define the path to our own builds. We could even use a setup hook for that.
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.
Can you elaborate 😅
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.
Upstream uses https://github.com/prebuild/node-gyp-build to manage its native library, which supports overriding the path to the prebuilt library using ${name}_PREBUILD
(see https://github.com/prebuild/node-gyp-build/blob/6822ec52423a2b3ed48ef8960a9fe05902e9e1a3/node-gyp-build.js#L30). You can therefore utilize the tool prebuildify
from the same vendor to build the native library, and then define env.BCRYPT_PREBUILD
in the main derivation to point to it. For reference, upstream uses prebuildify too: https://github.com/kelektiv/node.bcrypt.js/blob/d8195c6c4bb170b3b2ee2d04047a60fda80aa091/package.json#L30
faketty pnpm nx run @docmost/editor-ext:build | ||
faketty pnpm build |
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.
nit
faketty pnpm nx run @docmost/editor-ext:build | |
faketty pnpm build | |
faketty pnpm exec nx run @docmost/editor-ext:build | |
faketty pnpm run build |
stdenv, | ||
fetchFromGitHub, | ||
nodejs, | ||
pnpm, |
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.
Most likely you need to change pnpm
to pnpm_9
. Since #371832, it points to pnpm_10
instead of pnpm_9
.
Closes #355628
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/
)Add a 👍 reaction to pull requests you find important.