!jngDrdMgndWibPCYsR:nixos.org

Nix PHP

75 Members
A room for PHP developers running on Nix21 Servers

Load older messages


SenderMessageTime
22 May 2023
@jtojnar:matrix.orgJan Tojnar
In reply to @drupol:matrix.org
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

I am only providing a single variant since otherwise fetchComposerDeps would have to store both, possibly doubling+ the output size.

I can only use source in composition-c4 because builtins.fetchGit works without an output hash, whereas builtins.fetchTarball would require it even without restricted evaluation mode. It is not a problem for you since you use FOD so you are already specifying the output hash.

16:10:05
@jtojnar:matrix.orgJan Tojnar alternately, we could provide both source and dist generated from a single source but that is pointless since composer will always fall back on what is available, even when using --prefer-source/--prefer-dist flags 16:12:28
@drupol:matrix.orgPol
In reply to @jtojnar:matrix.org
I do not see the motivation for https://github.com/drupol/composer-local-repo-plugin/commit/9e1144ba0f3e98442bbfc955edd148be281c4148
In Drupal, you have these kind of things: https://github.com/drupal/drupal/blob/11.x/composer.json#L124
16:16:15
@drupol:matrix.orgPolComposer repos inside the drupal sources.16:16:24
@drupol:matrix.orgPolWithout this change: https://github.com/drupol/composer-local-repo-plugin/commit/9e1144ba0f3e98442bbfc955edd148be281c4148 it simply doesn't work16:16:51
@drupol:matrix.orgPolBy the way, I just forced pushed on the branch, I made this new improvement: https://github.com/NixOS/nixpkgs/pull/232450/files#diff-d6938cf1d292c64b6f1726b28397358dfa80ce78c9cfaaf54591acf09c36a04eR4316:17:48
@drupol:matrix.orgPolI'm creating a derivation for building the Composer Home directory containing the Composer plugin.16:18:04
@drupol:matrix.orgPolThe setup hook is even more clean: https://github.com/NixOS/nixpkgs/blob/240a1b5003a5a6d6ef1ad1786033288941c69c63/pkgs/build-support/php/hooks/composer-setup-hook.sh16:19:18
@jtojnar:matrix.orgJan Tojnar
In reply to @drupol:matrix.org
The setup hook is even more clean: https://github.com/NixOS/nixpkgs/blob/240a1b5003a5a6d6ef1ad1786033288941c69c63/pkgs/build-support/php/hooks/composer-setup-hook.sh
one thing I do not like is that the file contains functions both for fetchComposerDeps and buildComposerProject
16:24:19
@jtojnar:matrix.orgJan Tojnar I would probably move composerSetupBuildHook directly into fetchComposerDeps nix file, it should not really be used outside anyway 16:24:48
@jtojnar:matrix.orgJan Tojnarand we will want to minimize API surface so that it is harder to misuse and easier to change in the future16:25:26
@drupol:matrix.orgPolTrue16:28:17
@drupol:matrix.orgPolI count on you to tell me all these things16:29:17
23 May 2023
@drupol:matrix.orgPolRedacted or Malformed Event06:48:12
@drupol:matrix.orgPol I just force pushed a commit that is renaming the Composer hook mkComposerVendorCache into mkComposerRepository. 11:20:35
@drupol:matrix.orgPol I also added tests on the composerHomeDir internal derivation. To make sure that the plugin drupol/composer-local-repo-plugin is correctly installed. 11:21:21
@drupol:matrix.orgPolI moved things around and cleaned even further the hooks. 11:21:51
@drupol:matrix.orgPol I'm trying to keep the branch as tidy as possible, but also making sure that the derivation composer is always working. I'll recalculate the hash of all the other derivations when we will be stable enough. 11:27:41
@drupol:matrix.orgPol Today, Gael committed some things to add composer validate here and there. Later on, we had to make a little debug in Composer to understand why the command composer diagnose was not working. Turns out that some security keys needs to be installed for that.
Therefore, I created an internal derivation for installing those keys and added composer diagnose while building the Composer Local Repository.
When building a PHP derivation, the output should be similar to: https://gist.github.com/drupol/d1a3ae1ac6bad32b1d1d08188270d157 (see the Composer information in the log).
16:05:14
@drupol:matrix.orgPolA full installation of Drupal: https://gist.github.com/drupol/2316c9db560d4a646f491083d0b41726 with all the deps... 16:56:37
@drupol:matrix.orgPolAmazing :)16:56:39
@hexa:lossy.networkhexawhat happend to the backlog of this room?17:18:31
@hexa:lossy.networkhexanvm, it took a while to load17:18:52
@drupol:matrix.orgPolI'm going to merge the branch https://github.com/NixOS/nixpkgs/pull/232450 in https://github.com/NixOS/nixpkgs/pull/225401 in a few min.20:11:26
@drupol:matrix.orgPolJob done! I added a little history of the PR: https://github.com/NixOS/nixpkgs/pull/22540121:04:44
24 May 2023
@drupol:matrix.orgPol I have found a simpler way to create a repository of type composer. 13:52:32
@drupol:matrix.orgPolSimpler and definitely faster.13:52:42
@drupol:matrix.orgPol The idea is to run composer install, as usual. This will create the vendor directory with all the deps.
Then, run composer build-local-repo. The command will just create a composer repo tree structure by copying the dependencies from vendor :)
13:53:42
@drupol:matrix.orgPolThis has been implemented in the plugin at: https://github.com/drupol/composer-local-repo-plugin/commit/e4e96810d5cbaa0b80fce6ab6848404ff61e1da713:54:26
@philipp:xndr.dephilippHad similar issues. Maybe because of the long thread just above your message?14:41:54

Show newer messages


Back to Room ListRoom Version: 6