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

infinite recursion encountered #19

Open
kotletmotlet opened this issue Feb 14, 2024 · 1 comment
Open

infinite recursion encountered #19

kotletmotlet opened this issue Feb 14, 2024 · 1 comment

Comments

@kotletmotlet
Copy link

I've tried migrating my react project with workspaces to yarnpnp2nix, but encountered error during package building with nix build
`

   … while evaluating attribute 'unplugPhase' of derivation 'babel-helper-compilation-targets-7.23.6-aa6f07f088'

     at /nix/store/mmihlxna7x7wryngb0h47n0ssbravph0-source/lib/mkYarnPackage.nix:309:9:

      308|
      309|         unplugPhase =
         |         ^
      310|           # for debugging:

   … from call site

     at /nix/store/mmihlxna7x7wryngb0h47n0ssbravph0-source/lib/mkYarnPackage.nix:153:30:

      152|
      153|       createLockFileScript = mkCreateLockFileScript_internal {
         |                              ^
      154|         inherit packageRegistry;

   … while calling 'mkCreateLockFileScript_internal'

     at /nix/store/mmihlxna7x7wryngb0h47n0ssbravph0-source/lib/mkYarnPackage.nix:67:5:

       66|   mkCreateLockFileScript_internal =
       67|     {
         |     ^
       68|       packageRegistry,

   … while evaluating derivation 'browserslist-4.22.3-c3c1809375'
     whose name attribute is located at /nix/store/80v3x99d9cl7h9fbhqrpajwg4vjyxg6y-source/pkgs/stdenv/generic/make-derivation.nix:348:7

   … while evaluating attribute 'unplugPhase' of derivation 'browserslist-4.22.3-c3c1809375'

     at /nix/store/mmihlxna7x7wryngb0h47n0ssbravph0-source/lib/mkYarnPackage.nix:309:9:

      308|
      309|         unplugPhase =
         |         ^
      310|           # for debugging:

   … from call site

     at /nix/store/mmihlxna7x7wryngb0h47n0ssbravph0-source/lib/mkYarnPackage.nix:153:30:

      152|
      153|       createLockFileScript = mkCreateLockFileScript_internal {
         |                              ^
      154|         inherit packageRegistry;

   … while calling 'mkCreateLockFileScript_internal'

     at /nix/store/mmihlxna7x7wryngb0h47n0ssbravph0-source/lib/mkYarnPackage.nix:67:5:

       66|   mkCreateLockFileScript_internal =
       67|     {
         |     ^
       68|       packageRegistry,

   … while evaluating derivation 'update-browserslist-db-1.0.13-ea7b8ee24d'
     whose name attribute is located at /nix/store/80v3x99d9cl7h9fbhqrpajwg4vjyxg6y-source/pkgs/stdenv/generic/make-derivation.nix:348:7

   … while evaluating attribute 'unplugPhase' of derivation 'update-browserslist-db-1.0.13-ea7b8ee24d'

     at /nix/store/mmihlxna7x7wryngb0h47n0ssbravph0-source/lib/mkYarnPackage.nix:309:9:

      308|
      309|         unplugPhase =
         |         ^
      310|           # for debugging:

   … from call site

     at /nix/store/mmihlxna7x7wryngb0h47n0ssbravph0-source/lib/mkYarnPackage.nix:153:30:

      152|
      153|       createLockFileScript = mkCreateLockFileScript_internal {
         |                              ^
      154|         inherit packageRegistry;

   … while calling 'mkCreateLockFileScript_internal'

     at /nix/store/mmihlxna7x7wryngb0h47n0ssbravph0-source/lib/mkYarnPackage.nix:67:5:

       66|   mkCreateLockFileScript_internal =
       67|     {
         |     ^
       68|       packageRegistry,

   error: infinite recursion encountered

   at /nix/store/80v3x99d9cl7h9fbhqrpajwg4vjyxg6y-source/lib/customisation.nix:250:7:

      249|       drvPath = assert condition; drv.drvPath;
      250|       outPath = assert condition; drv.outPath;
         |       ^
      251|     };`

I suspect that it has something to do with how the yarn-manifest.nix is generated, because of code that looks like a cyclic dependency ( packages."browserslist@npm:4.22.3 referring to update-browserslist-db@npm:1.0.13 and update-browserslist-db@npm:1.0.13 back to former)

"update-browserslist-db@npm:1.0.13" = {
    name = "update-browserslist-db";
    reference = "npm:1.0.13";
    linkType = "HARD";
    outputName = "update-browserslist-db-1.0.13-ea7b8ee24d";
    outputHash = "";
    shouldBeUnplugged = true;
    flatName = "update-browserslist-db";
    languageName = "node";
    scope = null;
    descriptorRange = "npm:^1.0.13";
    checksum = "10c0/e52b8b521c78ce1e0c775f356cd16a9c22c70d25f3e01180839c407a5dc787fb05a13f67560cbaf316770d26fa99f78f1acd711b1b54a4f35d4820d4ea7136e6";
    bin = {
      "update-browserslist-db" = "cli.js";
    };
    dependencies = {
      "escalade" = packages."escalade@npm:3.1.2";
      "picocolors" = packages."picocolors@npm:1.0.0";
    };
    packagePeers = [
      "@types/browserslist"
      "browserslist"
    ];
    };
    "update-browserslist-db@virtual:c3c1809375389507a1aeedf534fd79f857bb3c64ecc9e006768cadbfe62986d5f0c6d60929598771fa39a935d74fd2f97a9ee5a236e30da17e2b3a480f1ecae0#npm:1.0.13" = {
    name = "update-browserslist-db";
    reference = "virtual:c3c1809375389507a1aeedf534fd79f857bb3c64ecc9e006768cadbfe62986d5f0c6d60929598771fa39a935d74fd2f97a9ee5a236e30da17e2b3a480f1ecae0#npm:1.0.13";
    canonicalPackage = packages."update-browserslist-db@npm:1.0.13";
    dependencies = {
      "browserslist" = packages."browserslist@npm:4.22.3";
      "escalade" = packages."escalade@npm:3.1.2";
      "picocolors" = packages."picocolors@npm:1.0.0";
    };
};
and
"browserslist@npm:4.22.3" = {
    name = "browserslist";
    reference = "npm:4.22.3";
    linkType = "HARD";
    outputName = "browserslist-4.22.3-c3c1809375";
    outputHash = "";
    shouldBeUnplugged = true;
    flatName = "browserslist";
    languageName = "node";
    scope = null;
    descriptorRange = "npm:^4.22.2";
    checksum = "10c0/5a1f673ce0d6e61a68369835a6b66e199669bde02c3bed5ec51e77598d8daafd91719dba55b15af2021b9ad0bbaa94951fd702eb71087449eb28be8002815ece";
    bin = {
      "browserslist" = "cli.js";
    };
    dependencies = {
      "caniuse-lite" = packages."caniuse-lite@npm:1.0.30001585";
      "electron-to-chromium" = packages."electron-to-chromium@npm:1.4.665";
      "node-releases" = packages."node-releases@npm:2.0.14";
      "update-browserslist-db" = packages."update-browserslist-db@virtual:c3c1809375389507a1aeedf534fd79f857bb3c64ecc9e006768cadbfe62986d5f0c6d60929598771fa39a935d74fd2f97a9ee5a236e30da17e2b3a480f1ecae0#npm:1.0.13";
    };
};

Does anyone have idea how to fix it?

@adrian-gierakowski
Copy link

I’ve ran into similar issue recently.
You should be able to break the cycle by reminding browserlist peerDep from update-browserslist-db via yarn’s patch protocol. If update-browserslist-db is not a direct dep of your project you might also have to used resolutions to force the patched version to be used

note that when using patch you’ll have to manually edit the path to the patch in package.json to use relative path instead of ~

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

No branches or pull requests

2 participants