| 20 May 2023 |
Jan Tojnar | Pol: how did you solve the issue with store paths in FOD in packages.json? | 16:31:14 |
Pol | Ah that. | 16:31:33 |
Pol | I found something interesting about that. | 16:31:49 |
Jan Tojnar | or are you still doing the /build/source thing? | 16:32:12 |
Pol | Instead of doing symlinks, I'm copying stuff from the local repo :) | 16:32:14 |
Pol | Thanks to this variable: COMPOSER_MIRROR_PATH_REPOS | 16:32:26 |
Pol | But | 16:32:28 |
Pol | The solution was: | 16:32:43 |
Pol | substituteInPlace .repo/packages.json \
--replace '/build/source/repo' $composerVendorCache \
| 16:32:46 |
Pol | In reply to @jtojnar:matrix.org or are you still doing the /build/source thing? That stuff is the only thing I don't like in the implementation. | 16:34:01 |
Pol | I would I could immediately use $out in it. | 16:34:11 |
Jan Tojnar | ah, you are copying the repo into the builder | 16:34:37 |
Pol | I haven't found a better alternative yet. | 16:35:26 |
Pol | I just copy packages.json, nothing else | 16:35:42 |
Pol | I don't copy the repo in the builder | 16:35:47 |
Pol | cp -ar ${composerVendorCache}/packages.json .repo/
| 16:35:57 |
Pol | See: https://github.com/NixOS/nixpkgs/blob/b636eeae54bb7fd1223041eecf5fa08dcf77520f/pkgs/build-support/php/hooks/composer-setup-hook.sh | 16:36:18 |
Pol | And: https://github.com/NixOS/nixpkgs/blob/b636eeae54bb7fd1223041eecf5fa08dcf77520f/pkgs/build-support/php/hooks/composer-install-hook.sh | 16:36:36 |
Jan Tojnar | yeah, I think this is an okay low-tech variant workaround | 16:36:53 |
Jan Tojnar | * yeah, I think this is an okay low-tech workaround | 16:36:57 |
Jan Tojnar | HTTP server would be cleaner but not sure doing that is worth it | 16:36:59 |
Pol | I wish I could get rid of
| 16:37:01 |
Pol | * I wish I could get rid of
substituteInPlace .repo/packages.json \
--replace '/build/source/repo' $composerVendorCache \
| 16:37:10 |
Pol | WDYT about the idea of using JQ to nuke the require-dev and packages-dev ? | 16:37:45 |
Jan Tojnar | I do not like it very much – composer config already interfered with the project too much for my taste – but it might be a necessary compromise | 16:39:37 |
Pol | I agree... | 16:39:48 |
Pol | We can now focus on the scripts | 16:40:18 |
Pol | And avoid repeating stuff in both of them | 16:40:28 |
Jan Tojnar | I only worry about project that need dev dependencies during build time | 16:40:32 |
Pol | For example, where to put those 2 lines?
composer config repo.packagist false
composer config repo.composer '{"type": "composer", "url": "file://'"$PWD"'/.repo"}'
In the install or in the setup ?
| 16:40:54 |