-
-
Notifications
You must be signed in to change notification settings - Fork 14k
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
mkYarnPackage: fix uncopied resolutions field #214952
mkYarnPackage: fix uncopied resolutions field #214952
Conversation
This breaks |
I ran into this problem independently literally 10 minutes ago, and this fixes it! Thanks @GuillaumeDesforges. |
c914aa7
to
65a492f
Compare
Rebased onto master (7479275) |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/mkyarnpackage-lockfile-has-incorrect-entry/21586/6 |
This uses IFD which is not allowed in nixpkgs. |
@SuperSandro2000 thanks for alerting me. This package was not added by me, nor What's the impact for my PR? |
This doesn't use IFD on its own, but if something calls these functions with a The way I see around this is to add in the |
As long as it triggers IFD in any form while ofborg evals it cannot be merged. You could give Radvendii idea a try, I didn't try to come up with one. |
A package I maintain ( |
65a492f
to
9a0956d
Compare
I used @lilyinstarlight 's snippet and it works. I can build packages with a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think you could commit this without all of the reformatting changes?
It makes it a bit difficult to review and we still don't yet have a blessed formatter for nixpkgs
My bad 🤦♂️ I still forget that nixpkgs is not always formatted with nixpkgs-fmt... will do |
5e4283a
to
3ca8b5c
Compare
@lilyinstarlight how about now? I tested and it still seems to work. $ nix repl
Welcome to Nix 2.14.1. Type :? for help.
nix-repl> nixpkgs = builtins.getFlake (builtins.toString ./.)
nix-repl> pkgs = nixpkgs.legacyPackages.x86_64-linux
nix-repl> marp-cli = pkgs.mkYarnPackage { pname = "marp-cli"; version = "2.4.0"; src = pkgs.fetchFromGitHub { owner = "marp-team"; repo = "marp-cli"; rev = "v2.4.0"; sha256 = "vZ1EKjuicFxkzcT/akV3U7+1adhMkJUgC3mALsAw/WM="; }; }
nix-repl> :b marp-cli
This derivation produced the following outputs:
out -> /nix/store/acszdx7jxpvq693w1p5lklbazni7d0bs-marp-team-marp-cli-2.4.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! No regressions against master either
Result of nixpkgs-review pr 214952
run on x86_64-linux 1
1 package marked as broken and skipped:
- micropad
6 packages failed to build: (all broken in master)
- apache-airflow (python310Packages.apache-airflow) (dependency marked broken on master)
- apache-airflow.dist (python310Packages.apache-airflow.dist) (dependency marked broken on master)
- plausible (broken on master - Hydra failure)
- python311Packages.apache-airflow (dependency marked broken on master)
- python311Packages.apache-airflow.dist (dependency marked broken on master)
- zammad (broken on master - Hydra failure)
31 packages built:
- gotify-server
- grafana-image-renderer
- hedgedoc
- heroic
- heroic-unwrapped
- jellyseerr
- lemmy-ui
- listmonk
- matrix-alertmanager
- matrix-appservice-discord
- matrix-appservice-slack
- matrix-hookshot
- meshcentral
- mirakurun
- pgadmin4
- pgadmin4-desktopmode
- pgadmin4-desktopmode.dist
- pgadmin4.dist
- pomerium
- powerdns-admin
- puppeteer-cli
- rstudio
- rstudio-server
- rstudioServerWrapper
- rstudioWrapper
- sharedown
- synapse-admin
- uivonim
- v2raya
- woodpecker-server
- yarn2nix
Yarn only uses the "resolutions" field in the top-level package.json file of a workspace. While it has been taken into account for mkYarnWorkspace (9801e6e), it has not been fixed for mkYarnPackage yet, which also uses the yarn workspace mechanism under the hood. A bit of care was needed because we don't want to introduce any IFD.
3ca8b5c
to
6bf78d8
Compare
@SuperSandro2000, any objection to me going ahead and merging this? It looks good to me now and nixpkgs-review still looks good |
I'm going to go ahead and merge so this doesn't just bitrot. If there are any more review comments, they can be fixed in a follow-up Thanks @GuillaumeDesforges! |
Description of changes
Yarn only uses the "resolutions" field in the top-level package.json file of a workspace. While it has been taken into account for mkYarnWorkspace (9801e6e), it has not been fixed for mkYarnPackage yet, which also uses the yarn workspace mechanism under the hood.
This change should fix some issues such as this.
Things done
nix shell github:nixos/nixpkgs#nixpkgs-review --command nixpkgs-review rev HEAD