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

pagefind: init at 1.0.3 #247773

Merged
merged 2 commits into from
Sep 18, 2023
Merged

pagefind: init at 1.0.3 #247773

merged 2 commits into from
Sep 18, 2023

Conversation

pbsds
Copy link
Member

@pbsds pbsds commented Aug 7, 2023

Description of changes

This PR packages pagefind by @CloudCannon (pagefind source), which can generate a low-bandwidth search index for nearly any static website. I've tested the use case documented here on a huge HTML soup, and it worked wonders.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 23.11 Release Notes (or backporting 23.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.

@pbsds pbsds requested review from bendlas, emilylange and dali99 August 7, 2023 17:15
@pbsds pbsds marked this pull request as ready for review August 7, 2023 17:51
wasm-bindgen-84 = wasm-bindgen-cli.override {
version = "0.2.84";
hash = "sha256-0rK+Yx4/Jy44Fw5VwJ3tG243ZsyOIBBehYU54XP/JGk=";
cargoHash = "sha256-vcpxcRlW1OKoD64owFF6mkxSqmNrvY+y3Ckn5UwEQ50=";
};
Copy link
Member

Choose a reason for hiding this comment

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

I would expect overrideAttrs here

Copy link
Member Author

@pbsds pbsds Aug 7, 2023

Choose a reason for hiding this comment

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

Intuitively i would agree, but updating hashes in fetchers is a chore, and .override was enabled here: b691051

pkgs/applications/misc/pagefind/default.nix Outdated Show resolved Hide resolved
Comment on lines +16869 to +16884
# https://github.com/NixOS/nixpkgs/issues/89426
rustc-wasm32 = (rustc.override {
stdenv = stdenv.override {
targetPlatform = stdenv.targetPlatform // {
parsed = {
cpu.name = "wasm32";
vendor.name = "unknown";
kernel.name = "unknown";
abi.name = "unknown";
};
};
};
}).overrideAttrs (old: {
configureFlags = old.configureFlags ++ ["--set=build.docs=false"];
});

Copy link
Member Author

@pbsds pbsds Aug 18, 2023

Choose a reason for hiding this comment

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

@nixos/rust: Any one of you opposed to this? It's already in cache thanks to lldap.
Context: #89426

pkgs/applications/misc/pagefind/default.nix Outdated Show resolved Hide resolved
@pbsds pbsds changed the title pagefind: init at unstable-2023-06-29 pagefind: init at 1.0.0 Sep 13, 2023
Comment on lines 41 to 63
env.npmDeps_web_js = fetchNpmDeps {
src = "${src}/pagefind_web_js";
hash = "sha256-pGE4lUFZ4dA++8kBklcMBoaN/1Z92dfOzQKhukbuEyc=";
};
env.npmDeps_ui_default = fetchNpmDeps {
src = "${src}/pagefind_ui/default";
hash = "sha256-voCs49JneWYE1W9U7aB6G13ypH6JqathVDeF58V57U8=";
};
env.npmDeps_ui_modular = fetchNpmDeps {
src = "${src}/pagefind_ui/modular";
hash = "sha256-O0RqZUsRFtByxMQdwNGNcN38Rh+sDqqNo9YlBcrnsF4=";
};

postPatch = ''
# Tricky way to run npmConfigHook multiple times
(
local postPatchHooks=() # written to by npmConfigHook
source ${npmHooks.npmConfigHook}/nix-support/setup-hook
npmRoot=pagefind_web_js npmDeps=$npmDeps_web_js npmConfigHook
npmRoot=pagefind_ui/default npmDeps=$npmDeps_ui_default npmConfigHook
npmRoot=pagefind_ui/modular npmDeps=$npmDeps_ui_modular npmConfigHook
)
'';
Copy link
Member Author

Choose a reason for hiding this comment

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

(I copied this comment from the old commit before the bump to v1.0.0)

@winterqt Would you consider this pattern for building multiple npm projects sound, or should it be torched? I do not want to establish a bad precedent.

@pbsds
Copy link
Member Author

pbsds commented Sep 13, 2023

This forcepush bumps the version to 1.0.0. 🚀 Due to a git dependency i was force to vendor the lock, tracked in CloudCannon/pagefind#421
@ofborg build pagefind

@pbsds
Copy link
Member Author

pbsds commented Sep 14, 2023

This force push bumps the version to 1.0.2, removing the need to vendor the cargo lock file. I also set different names to each npm-dep, making it far easier to update their hashes.

@ofborg build pagefind

@pbsds pbsds changed the title pagefind: init at 1.0.0 pagefind: init at 1.0.2 Sep 14, 2023
@happysalada
Copy link
Contributor

LGTM, I have nothing to add.
I'm going to wait for people with more knowledge on the js ecosystem to comment on those part.
feel free to ping me in a couple of weeks if nothing happened.

@bdesham
Copy link
Contributor

bdesham commented Sep 15, 2023

I have built and run this on aarch64-darwin. It seems to work well.

@happysalada
Copy link
Contributor

ofborg seems to have problems with aarch64-darwin https://logs.ofborg.org/?key=nixos/nixpkgs.247773&attempt_id=23427e33-a91f-4bc2-8ff7-dcf32dd84710
it's good to know that it works.

@pbsds pbsds changed the title pagefind: init at 1.0.2 pagefind: init at 1.0.3 Sep 17, 2023
@happysalada happysalada merged commit fe806f6 into NixOS:master Sep 18, 2023
14 checks passed
@happysalada happysalada deleted the pagefind-init branch September 18, 2023 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants