!jngDrdMgndWibPCYsR:nixos.org

Nix PHP

64 Members
A room for PHP developers running on Nix22 Servers

Load older messages


SenderMessageTime
16 Aug 2024
@nebucatnetzer13:matrix.orgnebucatnetzer13ah okay, because the rest I have already working08:25:29
@drupol:matrix.orgPol But you'll find all the most used tools already in nixpkgs (phpunit, psalm, phpstan, etc etc) 08:25:42
@drupol:matrix.orgPolI know that you could do 2 derivations08:26:34
@drupol:matrix.orgPolFor example:08:26:38
@drupol:matrix.orgPol
  1. my-app -> would be made with buildComposerProject, using regular attributes. This is ready to go in prod if needed, it doesn't contain any require-dev stuff.
08:27:14
@drupol:matrix.orgPol
  1. my-app-dev -> would also be made with buildComposerProject but this time, you can add an attribute that will install the require-dev dependencies.
08:27:54
@drupol:matrix.orgPol Then you create a devshell and use the attribute inputsFrom = [ my-app-dev ]; 08:28:12
@drupol:matrix.orgPolThat might work.08:28:22
@drupol:matrix.orgPolTo be tested.08:28:27
@nebucatnetzer13:matrix.orgnebucatnetzer13Okay, yeah that was my last idea as well, the problem with that is that the code for the project lands twice in the store right? It's not a killer, just a bit inelegant.08:30:12
@rikudou:lemmings.worldrikudou@lemmings.worldAdded php84 to https://history.nix-packages.com/search?packageName=php%2Ftag08:33:04
@drupol:matrix.orgPol
In reply to @nebucatnetzer13:matrix.org
Okay, yeah that was my last idea as well, the problem with that is that the code for the project lands twice in the store right? It's not a killer, just a bit inelegant.
Yes. I'm pretty sure there's room for improvements...
08:44:16
@drupol:matrix.orgPol
In reply to @rikudou:lemmings.world
Added php84 to https://history.nix-packages.com/search?packageName=php%2Ftag
The sort is not really optimal in the list.
08:44:52
@drupol:matrix.orgPolimage.png
Download image.png
08:45:07
@rikudou:lemmings.worldrikudou@lemmings.worldYep, I've noticed08:45:11
@rikudou:lemmings.worldrikudou@lemmings.worldFixed09:07:17
@drupol:matrix.orgPolquick and nice ! :)09:23:00
@nebucatnetzer13:matrix.orgnebucatnetzer13
In reply to @drupol:matrix.org
Yes. I'm pretty sure there's room for improvements...

I found a bit of a hack that works, but it's basically the same as sharing the COMPOSER_CACHED_DIR between runners.
On the runner I then point it to the result as the cache dir and set the env var COMPOSER_CACHE_READ_ONLY=1

{
  lib,
  php83Packages,
  root,
  stdenvNoCC,
}:
let
  fs = lib.fileset;
  sourceFiles = fs.unions [
    (root + "/composer.json")
    (root + "/composer.lock")
  ];
  composerFiles = fs.toSource {
    fileset = sourceFiles;
    inherit root;
  };
in
stdenvNoCC.mkDerivation {
  name = "composer-dev-dependencies";
  src = composerFiles;
  nativeBuildInputs = [ php83Packages.composer ];
  buildPhase = ''
    export COMPOSER_HOME=$TMPDIR
    composer install --download-only --no-interaction --no-scripts --no-ansi --no-autoloader
  '';
  installPhase = ''
    mkdir -p $out/
    cp -r $COMPOSER_HOME/cache/files $out/
  '';
  dontFixup = true;
  outputHashAlgo = "sha256";
  outputHashMode = "recursive";
  outputHash = "sha256-b3RbFaiVPuSpG6jZjSwOjFGyWo/sSb91JLdtcIIv1C8=";
}
10:58:26
@nebucatnetzer13:matrix.orgnebucatnetzer13 set a profile picture.11:05:52
@nebucatnetzer13:matrix.orgnebucatnetzer13From the reaction I assume it's a stupid idea :)12:13:12
@drupol:matrix.orgPolnooooo12:43:40
@drupol:matrix.orgPolI mean, I don't know these stuff12:43:46
@drupol:matrix.orgPolSo I'm surprised we can do this12:43:51
@drupol:matrix.orgPolI would not judge it, I don't know it12:44:12
@nebucatnetzer13:matrix.orgnebucatnetzer13Easy, well we will see how it works out. Fixed output derivations are a bit of a pain to update, especially for non-nix people.12:49:26
@drupol:matrix.orgPolyep :912:50:47
@drupol:matrix.orgPol * yep :(12:50:49
17 Aug 2024
@piotrkwiecinski:matrix.orgpiotrkwiecinski I was able to fix 20 jobs yesterday https://github.com/piotrkwiecinski/php-src-nix/pull/108:50:43
@drupol:matrix.orgPolman, wow ! Impressive !!!08:51:45
@piotrkwiecinski:matrix.orgpiotrkwiecinskiThere is fair amount of copy/paste. For now I plan to ensure all of them are green and see I can simply it08:51:47

Show newer messages


Back to Room ListRoom Version: 6