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

Support for building monorepo with git dependencies using pnpm and nix #1142

Open
lessuselesss opened this issue Dec 16, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@lessuselesss
Copy link
Contributor

Is your feature request related to a problem? Please describe.

When trying to build a pnpm monorepo using Nix's buildNpmPackage that includes git dependencies (specifically @discordjs/opus), the build fails due to git access restrictions in the Nix build environment. The current workarounds involve either modifying package.json or pre-fetching git dependencies, both of which are not ideal solutions for maintaining the project.

Describe the solution you'd like

A built-in way to handle git dependencies in buildNpmPackage that:

  1. Automatically fetches git dependencies using fetchgit during the build process
  2. Maintains compatibility with pnpm workspaces and monorepo structure
  3. Preserves the original package.json without requiring modifications
  4. Works with trusted dependencies in pnpm

Describe alternatives you've considered

  1. Manually pre-fetching git dependencies and placing them in node_modules
  2. Modifying package.json to use published versions instead of git dependencies
  3. Using mkDerivation instead of buildNpmPackage to handle the build process manually
  4. Creating a custom derivation to handle git dependencies before the main build

Additional context

This issue particularly affects projects using Discord.js and similar packages that rely on git dependencies for native modules. The current workarounds either break the development workflow or require maintaining separate package configurations for Nix builds.
Example of a failing build:

ERR_PNPM_LOCKFILE_CONFIG_MISMATCH Cannot proceed with the frozen installation. The current "overrides" configuration doesn't match the value found in the lockfile

@lessuselesss lessuselesss added the enhancement New feature or request label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant