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

docmost: init at 0.5.0 #355762

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

pluiedev
Copy link
Contributor

Closes #355628

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@74k1
Copy link
Contributor

74k1 commented Nov 14, 2024

builds fine & getting expected results for a nixos module in the future 👍
Thanks a lot! LGTM

hash = hashes.${stdenv.hostPlatform.system};
};

dontBuild = true;
Copy link
Member

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

Copy link
Contributor Author

@pluiedev pluiedev Nov 25, 2024

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

Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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 🤷🏼‍♀️

Copy link
Member

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.


buildPhase = ''
runHook preBuild
node-pre-gyp install --build-from-source
Copy link
Member

@Scrumplex Scrumplex Nov 29, 2024

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate 😅

Copy link
Member

@Scrumplex Scrumplex Dec 11, 2024

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

Comment on lines +59 to +60
faketty pnpm nx run @docmost/editor-ext:build
faketty pnpm build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

Suggested change
faketty pnpm nx run @docmost/editor-ext:build
faketty pnpm build
faketty pnpm exec nx run @docmost/editor-ext:build
faketty pnpm run build

@FliegendeWurst FliegendeWurst added the awaiting_changes (old Marvin label, do not use) label Dec 4, 2024
@SigmaSquadron SigmaSquadron removed the awaiting_changes (old Marvin label, do not use) label Jan 5, 2025
stdenv,
fetchFromGitHub,
nodejs,
pnpm,
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package request: docmost
6 participants