-
Notifications
You must be signed in to change notification settings - Fork 23
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
Integrity override mechanism for resolution=tarball dependencies #13
Comments
I added a patch that automatically detects git dependencies and downloads them through Let me know if it works for you |
I have tried to use the master version of this repository to package rsshub, and find it failed to parse dependencies. It complains "attribute 'id' missing" at here. I package it like this:
Output error is:
|
@CHN-beta sorry for the (very) late answer. I have now reworked the dependency download logic and am able to build rsshub with the following derivation: mkPnpmPackage {
src = pkgs.fetchFromGitHub
{
owner = "DIYgod";
repo = "RSSHub";
rev = "ecab0c0882a17b9b70431aca0c155a2da9d2c4fa";
hash = "sha256-VAIUQCQcKYaav4Ch73Cn7poO0/VCGtWkWJkPJ3Qp31A=";
};
installEnv = {
PUPPETEER_EXECUTABLE_PATH = "${pkgs.coreutils}/bin/true"; # Prevent puppeteer from trying to connect to the internet
};
script = "build:all";
distDir = "."; # Copy everything from the build directory to the output
} |
@nzbr Thank you for your great job. I tried to package rsshub with the following code and it works well: {
lib, mkPnpmPackage, nodejs, writeShellScriptBin, src,
chromium, bash
}:
let
unwrapped = mkPnpmPackage
{
name = "rsshub-unwrapped";
inherit src nodejs;
installEnv.PUPPETEER_SKIP_DOWNLOAD = "1";
script = "build:all";
distDir = ".";
};
in writeShellScriptBin "rsshub"
''
cd ${unwrapped}
export PATH=${lib.makeBinPath [ bash nodejs nodejs.pkgs.pnpm chromium ]}:$PATH
export CHROMIUM_EXECUTABLE_PATH=chromium
pnpm start
'' I also tried to package misskey, but it still does not works, with another error: {
lib, mkPnpmPackage, nodejs, writeShellScriptBin, # use nodejs 21
bash, cypress, vips, pkg-config, src
}:
let
unwrapped = mkPnpmPackage
{
inherit src nodejs;
name = "misskey-unwrapped";
installEnv = { CYPRESS_RUN_BINARY = "${cypress}/bin/Cypress"; NODE_ENV = "production"; };
copyPnpmStore = true;
distDir = ".";
noDevDependencies = true;
};
in writeShellScriptBin "misskey"
''
cd ${unwrapped}
export PATH=${lib.makeBinPath [ bash nodejs nodejs.pkgs.pnpm nodejs.pkgs.gulp cypress ]}:$PATH
export CYPRESS_RUN_BINARY="${cypress}/bin/Cypress"
export NODE_ENV=production
pnpm run migrateandstart
'' The error is:
Could you please help me? |
Hi! I'm trying to package misskey using this project. Misskey uses some dependencies that are not published on NPM and are resolved using resolution=tarball instead: https://github.com/misskey-dev/misskey/blob/develop/pnpm-lock.yaml#L21139
pnpm doesn't provide an integrity hash for this kind of dependencies, so they can't be fetched in a pure build. There's an issue for it but it hasn't seen any activity since 2018. pnpm/pnpm#1035
I think an easy way to fix this would be adding an argument to
mkPnpmPackage
accepting an attrset that you override dependencies manually, maybe like this:And then in
lockfile.nix
check if the package name exists in that attrset and use that derivation instead of generating one.It's kind of a hack but I can't think of a better way until pnpm provides an integrity hash for that kind of dependencies in the lockfile. I'll probably fork this repo to add this tomorrow so I can get the misskey package done, would you accept a PR that adds this mechanism? Or do you have another idea for how to solve this?
The text was updated successfully, but these errors were encountered: