!jngDrdMgndWibPCYsR:nixos.org

Nix PHP

79 Members
A room for PHP developers running on Nix22 Servers

Load older messages


SenderMessageTime
7 Apr 2023
@drupol:matrix.orgPolDamn, it's still failing, the checksums are different: https://github.com/NixOS/nixpkgs/pull/22512910:25:11
@drupol:matrix.orgPolI can't figure out why.10:25:16
@drupol:matrix.orgPolforget about it, I found the issue !!!10:26:43
@drupol:matrix.orgPolIT WORKS ! :) 10:28:06
@drupol:matrix.orgPolThis is super cool because we can document that and help people package their PHP app !!!10:28:52
@drupol:matrix.orgPol tgerbet, @Shyim ^^ 10:30:12
@jtojnar:matrix.orgJan Tojnar Pol: ideally, we would have a function like rustPlatform.fetchCargoTarball to avoid the boilerplate 10:33:37
@drupol:matrix.orgPolI will work on this very soon :)10:33:54
@tgerbet:matrix.orgtgerbet
In reply to @drupol:matrix.org
tgerbet, @Shyim ^^

Yeah this is not something really new, this is fine for personal/corporate stuff but not so much for nixpkgs:

  • that cannot work with dependencies only using a source repository because that make us dependent on the output of git/svn/mercurial/whatever
  • AFAIK there is no way to tell composer to use only dist tarball, there is a --prefer-dist flag but it will happily switch
10:43:26
@jtojnar:matrix.orgJan Tojnaroh, right source deps are a thing. Maybe we could post-process the output to strip the VCS directories10:51:52
@drupol:matrix.orgPol
In reply to @jtojnar:matrix.org
oh, right source deps are a thing. Maybe we could post-process the output to strip the VCS directories
Where ?
11:10:13
@tgerbet:matrix.orgtgerbet
In reply to @jtojnar:matrix.org
oh, right source deps are a thing. Maybe we could post-process the output to strip the VCS directories
I'm also not sure how Composer behaves with things like Git LFS and submodules. It would also requires dealing with the things the "traditional" fetchers are dealing with like the path to the CA bundle, proxy information...
Even with all of that I'm not sure it is currently possible to tell Composer to use only the dist tarball or the source for package proposing both. If I remember correctly even with --fetch-dist it will try to fallback to to the source if the dist tarball cannot be retrieved for some reasons
11:23:16
@drupol:matrix.orgPolhttps://planttext.com/api/plantuml/png/hP7D2i8m48JlUOg0ju3w0gKKl7YIujNsa3IhHjDisAHetzxK7ugWFVMukxFVC4mHegJO6gTRwHaBL-CuOG3612-tPUKssFeqK-K8FA7k6gECDR5F2i7ta8uc8lMLorH-C_7Cc_V7oc9ppTOgJq8nRYy1tIYMNKIBKWCjFS7Ht3yFuh0u4O2h1u-dhrGM9b3OnKaQWQxv3YEdRzwl30DhjXZ_ZESDmWf87RvwV00011:32:25
@drupol:matrix.orgPolhere's a diagram summarizing the situation with composer.11:32:35
@jtojnar:matrix.orgJan Tojnarugh, that will not be reproducible then, GitHub filters out stuff from the tarballs according to .gitattributes so dist archives will commonly be different from vcs checkout11:33:13
@tgerbet:matrix.orgtgerbetYep and it's something that is often used in the packages to filter out tests in the dist tarballs for example11:34:52
9 Apr 2023
@drupol:matrix.orgPolI'm going to try to build a builder for PHP apps, where would you add this new function ? In which file? Any advice are good here :) 08:43:29
@drupol:matrix.orgPolOh my.09:42:54
@drupol:matrix.orgPolI got it working.09:42:57
@drupol:matrix.orgPol

Here's what I succeeded to do in 30 minutes:

{ buildPHPproject, fetchFromGitHub, makeWrapper, lib, php, tree }:

buildPHPproject rec {
  inherit php;

  pname = "grumphp";
  version = "1.15.0";

  src = fetchFromGitHub {
    owner = "phpro";
    repo = "grumphp";
    rev = "v${version}";
    hash = "sha256-EIGIoImRKR1Mc7oFXIzuLD3S1zx9WtHwDX0ST1T4BH0=";
  };

  vendorOutputHash = "sha256-TGGwRh7NSBKqt43GpmS7zY6togyEkEk/6wf2ys18OF8=";

  postInstall = ''
     ln -s $out/share/php/${pname}/bin/${pname} $out/bin/${pname}
  '';
}

09:43:29
@drupol:matrix.orgPolI don't know what you think, but I just found this amazing for the PHP ecosystem !09:44:07
@drupol:matrix.orgPol *

Here's what I succeeded to do in 30 min, with the grumphp derivation as example:

{ buildPHPproject, fetchFromGitHub, makeWrapper, lib, php, tree }:

buildPHPproject rec {
  inherit php;

  pname = "grumphp";
  version = "1.15.0";

  src = fetchFromGitHub {
    owner = "phpro";
    repo = "grumphp";
    rev = "v${version}";
    hash = "sha256-EIGIoImRKR1Mc7oFXIzuLD3S1zx9WtHwDX0ST1T4BH0=";
  };

  vendorOutputHash = "sha256-TGGwRh7NSBKqt43GpmS7zY6togyEkEk/6wf2ys18OF8=";

  postInstall = ''
     ln -s $out/share/php/${pname}/bin/${pname} $out/bin/${pname}
  '';
}

09:46:19
@drupol:matrix.orgPol *

Here's what I succeeded to do in 30 min, with the grumphp derivation as example:

{ buildPHPproject, fetchFromGitHub, lib, php }:

buildPHPproject rec {
  inherit php;

  pname = "grumphp";
  version = "1.15.0";

  src = fetchFromGitHub {
    owner = "phpro";
    repo = "grumphp";
    rev = "v${version}";
    hash = "sha256-EIGIoImRKR1Mc7oFXIzuLD3S1zx9WtHwDX0ST1T4BH0=";
  };

  vendorOutputHash = "sha256-TGGwRh7NSBKqt43GpmS7zY6togyEkEk/6wf2ys18OF8=";

  postInstall = ''
     ln -s $out/share/php/${pname}/bin/${pname} $out/bin/${pname}
  '';
}
09:46:52
@drupol:matrix.orgPol *

Here's what I succeeded to do in 30 min, with the grumphp derivation as example:

{ buildPHPproject, fetchFromGitHub, lib }:

buildPHPproject rec {
  pname = "grumphp";
  version = "1.15.0";

  src = fetchFromGitHub {
    owner = "phpro";
    repo = "grumphp";
    rev = "v${version}";
    hash = "sha256-EIGIoImRKR1Mc7oFXIzuLD3S1zx9WtHwDX0ST1T4BH0=";
  };

  vendorOutputHash = "sha256-TGGwRh7NSBKqt43GpmS7zY6togyEkEk/6wf2ys18OF8=";

  postInstall = ''
     cd $out
     ln -s $out/share/php/${pname}/bin/${pname} $out/bin/${pname}
  '';

  meta = with lib; {
    changelog = "https://github.com/phpro/grumphp/releases/tag/v${version}";
    description = "A PHP code-quality tool";
    homepage = "https://github.com/phpro/grumphp";
    license = licenses.mit;
    maintainers = teams.php.members;
  };
}

09:49:48
@drupol:matrix.orgPolI pushed my draft here: https://github.com/NixOS/nixpkgs/pull/22540109:58:06
@drupol:matrix.orgPolMy Easter sunday starts very well :D09:59:46
@drupol:matrix.orgPolI'm pretty sure the excitement will drop down after some reviews anyway :D10:00:02
@drupol:matrix.orgPol invited @shyim-5532ae2f15522ed4b3df33d3:gitter.im@shyim-5532ae2f15522ed4b3df33d3:gitter.im.17:47:02
@shyim:matrix.orgShyim joined the room.17:47:49
@drupol:matrix.orgPol Jan Tojnar: I tried the finalAttrs: pattern... but I can't get it to work. 19:06:45

Show newer messages


Back to Room ListRoom Version: 6