Nix PHP | 78 Members | |
| A room for PHP developers running on Nix | 23 Servers |
| Sender | Message | Time |
|---|---|---|
| 20 May 2023 | ||
| enjoy | 16:46:08 | |
| I mean, feel free to modify it at anytime :) | 16:54:10 | |
| I think it needs improvements | 16:54:24 | |
| For example, | 16:54:30 | |
We should make sure that keys are sorted alphabetically in the produced packages.json | 16:54:45 | |
| So we don't have surprise at some point. | 16:54:59 | |
Changing the structure of that single packages.json file and we are good to re-compute all the derivation hashes | 16:55:20 | |
| So we need to fix the structure of that file | 16:55:27 | |
| And avoid modifying it once it's done. | 16:55:34 | |
| Then we tag that plugin and we're good to go. | 16:55:43 | |
| We should also think about where to put that project | 16:56:47 | |
| 21 May 2023 | ||
| I've updated the composer plugin with new commands options:
| 10:11:52 | |
I made those options to reduce the amount of file manipulation in pkgs/build-support/php/hooks/composer-install-hook.sh | 10:12:30 | |
| The package installation procedure is now reduced to:
| 10:13:09 | |
| I also updated the plugin to output json in alphabetical order | 10:13:39 | |
| 22 May 2023 | ||
| Today I will most probably write a summary of all the things we tried to get this thing working. | 06:58:52 | |
| I've been testing that thing the whole weekend, and I improved it here and there as you can see in the PR. | 06:59:19 | |
| There is only ONE single issue with that method. | 06:59:31 | |
If by any change you have post-update-cmd in composer.json like in Drupal: https://github.com/drupal/drupal/blob/11.x/composer.json#L111This is going to fail. | 07:00:30 | |
Why? Because as far as I can see, the update command is expected to be run AFTER the install command and the autoloader needs to be loaded so the update command can run the command properly. | 07:01:14 | |
But in our case, we are running the update command BEFORE the install command: https://github.com/NixOS/nixpkgs/blob/58fed5f92032c4e51286d08a76d9d2bab5443ecb/pkgs/build-support/php/hooks/composer-install-hook.sh#L52 | 07:02:18 | |
So today I'm going to test stuff and see how we can get rid of that composer update command before the install. If you have any clue, please let me know. | 07:02:50 | |
| Oh I think I fixed the Drupal issue ! | 08:28:50 | |
| Confirmed! Drupal issue fixed :) | 08:31:55 | |
The fix has been committed to drupol/composer-local-repo-plugin: https://github.com/drupol/composer-local-repo-plugin/commit/9e1144ba0f3e98442bbfc955edd148be281c4148 and in the PR: https://github.com/NixOS/nixpkgs/compare/58fed5f92032c4e51286d08a76d9d2bab5443ecb..2d49300918ee738fa8f2e9d086647539493bb879 | 08:37:56 | |
| Jan Tojnar: FYI, I think there are rooms for improvements in fossar/composition-c4. I'm trying to propose a PR, but I have the feeling that I need to move this aside or else I won't be doing anything else today... and I'm at work :D | 10:09:39 | |
Basically, the idea is that Composer is able to download a package from dist or source attribute (see relevant part of the code https://github.com/composer/composer/blob/main/src/Composer/Downloader/DownloadManager.php#L143). In fossar/composition-c4, we only handle source. I guess it would not be complicated to fix this. | 10:42:54 | |
* Basically, the idea is that Composer is able to download a package from dist or source attribute (see relevant part of the code https://github.com/composer/composer/blob/main/src/Composer/Downloader/DownloadManager.php#L143). In fossar/composition-c4, we only handle source. I guess it would not be complicated to fix this. I just don't have enough knowledge in Nix to do it... I'm still trying :D | 11:45:27 | |
| I created the relevant issue to keep track of this: https://github.com/fossar/composition-c4/pull/6 | 11:57:44 | |
| WDYT of this? I just pushed a commit to refactor the script and add a little bit of documentation: https://github.com/NixOS/nixpkgs/blob/7f2c754d1daeeca5eef173b7a2ec6d305522857d/pkgs/build-support/php/hooks/composer-setup-hook.sh | 14:03:28 | |