Nix PHP | 73 Members | |
| A room for PHP developers running on Nix | 21 Servers |
| Sender | Message | Time |
|---|---|---|
| 5 May 2024 | ||
| I made further improvements | 12:09:47 | |
| Definitely much better than before, and also faster. | 12:09:59 | |
| Jan Tojnar: I implemented the changes you suggested from https://github.com/NixOS/nixpkgs/pull/308608 in https://github.com/NixOS/nixpkgs/pull/308059 In the last commit, I'm trying to make the upgrade of psysh, but I end up in a infinite recursion. I've been spending the last hour trying to figure out workarounds, but I'm running out of ideas, do you think you could have a look? | 12:23:11 | |
| The overriding part is:
| 14:38:07 | |
| When I remove it, I don't have the infinite recursion. something must be wrong somewhere, I can't figure it out. | 14:38:33 | |
Pol: right, you finalAttrs.composerRepository in physh ends up pointing to the composerRepository attribute in buildComposerProjectOverride, and the previousAttrs.composerRepository in that points to the composerRepository in physh | 14:52:20 | |
* Pol: right, the finalAttrs.composerRepository in physh ends up pointing to the composerRepository attribute in buildComposerProjectOverride, and the previousAttrs.composerRepository in that points to the composerRepository in physh | 14:52:30 | |
| Let me re-read that slowly. | 14:52:43 | |
| OK got it. | 14:53:04 | |
| What should we do to fix that? | 14:53:13 | |
| This is the part where I'm totally insecure in the PHP Composer Builder | 14:55:27 | |
I guess the cleanest solution would be just using composerRepository = mkComposerRepositoryNext { … }; when more advanced usage is needed | 15:01:06 | |
| Argh | 15:02:03 | |
In reply to @drupol:matrix.orgThere's no way to override it cleanly like that? | 15:02:31 | |
You could do (php.buildComposerProjectNext (finalAttrs: {})).overrideAttrs (_finalAttrs: prevAttrs: {composerRepository = prevAttrs.composerRepository.overrideAttrs (oldAttrs: { }); } but that is ugly too | 15:04:33 | |
| Oh boy yeah... | 15:05:02 | |
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 | |
* 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 | |
| and final level will not work since that would be a cycle | 15:06:17 | |
| Can we do some nice things in the new version of the PHP Composer Builder ? I would like to sort those things. | 15:06:56 | |
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 | |
| Indeed, I've been thinking about that... but yeah it's ugly :( | 15:08:29 | |
| I will check other builders how they do | 15:10:06 | |
| 15:10:09 | |
other builders did not really bother to support or predated the finalAttrs pattern, buildComposerProject is unique here | 15:11:24 | |
| Yeah I noticed :S | 15:11:39 | |
| hence, the added complexity to override some stuff | 15:11:49 | |
well, there is no shame in leaving advanced use cases to explicit mkComposerRepository | 15:13:11 | |
| I will see the things to do to override the preBuild step. | 15:13:56 | |
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 | |