!jngDrdMgndWibPCYsR:nixos.org

Nix PHP

74 Members
A room for PHP developers running on Nix22 Servers

Load older messages


SenderMessageTime
5 May 2024
@drupol:matrix.orgPolArgh15:02:03
@drupol:matrix.orgPol
In reply to @drupol:matrix.org

The overriding part is:

  composerRepository = finalAttrs.composerRepository.overrideAttrs (oldAttrs: {
    preBuild = ''
      setComposeRootVersion
      composer config platform.php 7.4
      composer require --no-update symfony/polyfill-iconv symfony/polyfill-mbstring
      composer require --no-update --dev roave/security-advisories:dev-latest
    '';
  });
There's no way to override it cleanly like that?
15:02:31
@jtojnar:matrix.orgJan Tojnar You could do (php.buildComposerProjectNext (finalAttrs: {})).overrideAttrs (_finalAttrs: prevAttrs: {composerRepository = prevAttrs.composerRepository.overrideAttrs (oldAttrs: { }); } but that is ugly too 15:04:33
@drupol:matrix.orgPolOh boy yeah... 15:05:02
@jtojnar:matrix.orgJan Tojnar the issue is that the attribute set passed to buildComposerProjectNext is level 0, and overrides can only refer to either level n - 1 or the final level 15:05:54
@jtojnar:matrix.orgJan Tojnar * the issue is that the attribute set passed to buildComposerProjectNext is level 0, and overrides can only refer to either level n - 1 or the final level 15:06:04
@jtojnar:matrix.orgJan Tojnarand final level will not work since that would be a cycle15:06:17
@drupol:matrix.orgPolCan we do some nice things in the new version of the PHP Composer Builder ? I would like to sort those things.15:06:56
@jtojnar:matrix.orgJan Tojnar you could maybe add extra composerRepositoryArgs argument that could be passed in level 0 but there are issues with that as well 15:08:10
@drupol:matrix.orgPolIndeed, I've been thinking about that... but yeah it's ugly :(15:08:29
@drupol:matrix.orgPolI will check other builders how they do15:10:06
@jtojnar:matrix.orgJan Tojnar
  • it would be confusing if you added that and e.g. composerNoDev – which should take precedence, especially with multiple levels of overrides
  • you would have to filter it out of arguments passed to mkDerivation since attribute sets are not allowed, but then it would disappear from the fix point (maybe it would work in passthru, not sure)
15:10:09
@jtojnar:matrix.orgJan Tojnar other builders did not really bother to support or predated the finalAttrs pattern, buildComposerProject is unique here 15:11:24
@drupol:matrix.orgPolYeah I noticed :S15:11:39
@drupol:matrix.orgPolhence, the added complexity to override some stuff15:11:49
@jtojnar:matrix.orgJan Tojnar well, there is no shame in leaving advanced use cases to explicit mkComposerRepository 15:13:11
@drupol:matrix.orgPolI will see the things to do to override the preBuild step.15:13:56
@jtojnar:matrix.orgJan Tojnar btw, might be a good idea to clone the old infrastructure first and then apply the changes in a new commit so the differences are easier to review. Also maybe use 2 suffix instead of Next so that further evolution has space to grow into 15:14:56
@drupol:matrix.orgPolOkidocky15:16:26
@drupol:matrix.orgPolHave you seen, that version get rid of the composer plugin :)15:19:47
@jtojnar:matrix.orgJan TojnarI was to lazy to diff it against the old one, hence the request for a separate commit :)15:25:14
@drupol:matrix.orgPolDone now: https://github.com/NixOS/nixpkgs/pull/30805915:52:15
@drupol:matrix.orgPolHope it's what you're expecting15:52:21
@drupol:matrix.orgPolI'll continue working on this in the upcoming days to relax 15:55:12
6 May 2024
@patka_123:matrix.org@patka_123:matrix.org joined the room.15:46:02
@drupol:matrix.orgPolPaving the way for the next version of the builder by reorganizing files of the version 1 of the builder: https://github.com/NixOS/nixpkgs/pull/30960517:10:27
@drupol:matrix.orgPolThis PR doesn't change anything in the way the current builder works. It just reorganize files, nothing else, nothing more.17:11:47
@nick_kadutskyi:matrix.org@nick_kadutskyi:matrix.org changed their display name from nick_kadutskyi to nickkadutskyi.17:33:23
@nick_kadutskyi:matrix.org@nick_kadutskyi:matrix.org left the room.17:35:36
@nickkadutskyi:matrix.orgNick Kadutskyi joined the room.17:38:32

Show newer messages


Back to Room ListRoom Version: 6