nix-community / yarn2nix

Generate nix expressions from a yarn.lock file [maintainer=???]
GNU General Public License v3.0
123 stars 61 forks source link

Github "Can't make a request in offline mode" #111

Closed ghost closed 4 years ago

ghost commented 5 years ago

package.json:

    "emoji-mart": "Gargron/emoji-mart#build",

yarn.lock:

emoji-mart@Gargron/emoji-mart#build:
  version "2.6.3"
  resolved "https://codeload.github.com/Gargron/emoji-mart/tar.gz/934f314fd8322276765066e8a2a6be5bac61b1cf"

yarn.nix:

    {
      name = "https___codeload.github.com_Gargron_emoji_mart_tar.gz_934f314fd8322276765066e8a2a6be5bac61b1cf";
      path = fetchurl {
        name = "https___codeload.github.com_Gargron_emoji_mart_tar.gz_934f314fd8322276765066e8a2a6be5bac61b1cf";
        url  = "https://codeload.github.com/Gargron/emoji-mart/tar.gz/934f314fd8322276765066e8a2a6be5bac61b1cf";
        sha1 = "1768aa6ab3d6b926f457e082bd4ed7279f6fc9cf";
      };
    }

The following file gets created in the nix store: /nix/store/f5sy6fg883qs8fw39m52zqq78k9ic4fz-offline/https___codeload.github.com_Gargron_emoji_mart_tar.gz_934f314fd8322276765066e8a2a6be5bac61b1cf

mkYarnPackage fails:

building '/nix/store/vxmjbrsw2hbny4c7r2bc6g152gp49br8-mastodon-modules-v2.9.3.drv'...
configuring
building
yarn config v1.17.3
success Set "yarn-offline-mirror" to "/nix/store/f5sy6fg883qs8fw39m52zqq78k9ic4fz-offline".
Done in 0.04s.
yarn install v1.17.3
[1/4] Resolving packages...
[2/4] Fetching packages...
error Can't make a request in offline mode ("https://codeload.github.com/Gargron/emoji-mart/tar.gz/934f314fd8322276765066e8a2a6be5bac61b1cf")
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
ghost commented 5 years ago

The file should be called just 934f314fd8322276765066e8a2a6be5bac61b1cf instead of https___codeload.github.com_Gargron_emoji_mart_tar.gz_934f314fd8322276765066e8a2a6be5bac61b1cf

nh2 commented 4 years ago

The code in yarn to create the

  resolved "https://codeload.github.com/Gargron/emoji-mart/tar.gz/934f314fd8322276765066e8a2a6be5bac61b1cf"

entry is here: https://github.com/yarnpkg/yarn/blob/989a74067420f370fa575a59624ed258334f90d1/src/resolvers/exotics/github-resolver.js#L24-L26


I made a PR to fix this issue: #130