-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
phpbench: init at 1.2.14 #255253
phpbench: init at 1.2.14 #255253
Conversation
@dantleech Would you be OK to let the |
f40684c
to
480e831
Compare
480e831
to
35452a4
Compare
In theory I'm OK with it, the build might need to be updated |
Excellent news ! I'll wait for you to publish the new update, so I don't push to git files that will be removed at a later point... and put this PR in draft then. |
Well, it probably won't happen soon, as I should probably automate the generation of the lock file as otherwise it's "works on my machine"? (I.e. you'll pin the PHP version to something, but that won't always correlate to the versionvthta I generate the lock file). But PHPBench has a PHAR - is that a worse option? Also another consideration is that PHPBench will spawn a PHP process to benchmark the code, but that PHP process should be the one in the developers env. (I.e. wjth same versuon, extensions, etc). so unsure how this will work with NixOS. |
35452a4
to
9076ea8
Compare
@dantleech Ideally I'd say that each release should come with a For the other consideration, this means that we'd have to provide |
The PHAR file already achieves this and is auto-published on release. It's the same difference but if I want a
I'm sceptical of this approach vs. letting |
Correct, however, nixpkgs always opt for building packages from source. Using the
I would say it's best practices to have it commited to the repository at all times, how else would you synchronize exact versions of dependencies between different contributors to the project or do you expect to just use "latest within version constraint"? That's not reproducible and error-prone due to reasons I've already mentioned. This is not about CI. However, this is up to you and I'm not here to run your project for you 🙂
I'm not talking about composer dependencies, I'm talking about PHP extensions, such as The only way to manage extensions for PHP in nix is to use our Here's a short example: PHP in nix doesn't come by default with imagick, if you want imagick you can get it by having this extension of PHP: {
# For specific versions
php81 = php81.withExtensions ({ enabled, all }: enabled ++ [ all.imagick ]);
php82 = php82.withExtensions ({ enabled, all }: enabled ++ [ all.imagick ]);
php83 = php83.withExtensions ({ enabled, all }: enabled ++ [ all.imagick ]);
# For default version (currently 8.2)
php = php.withExtensions ({ enabled, all }: enabled ++ [ all.imagick ]);
# Get composer with imagick and redis installed for PHP 8.1
composer-imagick-redis = (php81.withExtensions ({ enabled, all }:
enabled ++ [ all.imagick all.redis ])).packages.composer;
} We went through a great amount of effort a couple of years back to build every built in PHP extension as a separate package so we can binary cache it per package per php version. This makes it possible to have a super minimal PHP version as base and then compose a package with any combination of extensions within seconds since there's no compile time, just a config file that needs to be built. So I wouldn't worry about having it as a PHP version dependent package, that's how we package PHP programs that are version dependent.
This is exactly right, that's why we did all this work 🙂 |
thanks for the explanations!
the problem becomes how to ensure that the Depending on the maintainer or the individual contributors to remember to generate the lock file correctly is error prone, so it needs to be automated, which is ... probably fine but requires additional effort. Saying that - I could probably run the test suite with the locked-down version of the package in all PHP versions, but that would increase the build time significantly (it already runs all the tests in multiple versions of PHP with min and max deps). Note that for right or wrong, it's intended that PHPBench supports a wide range of constraints. In summary - I think it's more effort than just committing the lock file.
It's amazing stuff 🎉 |
You as a project will have to decide which versions of PHP you support, this can be defined in your
Now we're getting into the weeds here and I'm pretty confident that that's not how it works... but now I'm not 100% sure. I'm pretty sure that a
This is something we can handle in nixpkgs though, and already have cases for. Sure, we do generate the So what we can do is like we do with the We can do the same for tools/packages 🙂 So if a tool is only supporting certain versions of PHP we can accommodate for that. 🙂
My experience with composer for the past 10 years and the lock files is that it's fine to use lock files even from older versions (not sure about newer) of composer. I think, like once they have changed the lock-file format and it didn't break use with newer versions of composer. So it's in my experience very reliable. They have changed datetime formats and such as well some times. However it's been minimal and fine. I'm not here to convince you to change your development practices though.
Do I haven't used Because then we, in nixpkgs, could automate the update of our |
So I think it makes sense now. By default composer will use the current PHP interpreters version to resolve packages, but you can override this with by declaring the platform, so in theory that should produce reproducible lock file, in this case I guess I should set it to 7.4 (or give the package a long-overdue bump to PHP 8.0 or 8.1). I should probably also set an upper limit on the supported PHP version (i.e. |
@dantleech The same kind of request has been made for the Grumphp project, follow the interesting discussion at phpro/grumphp#1095 |
@dantleech ^^ :) |
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)