composer-patches: patches-search not working as documented?
patches-search seems to not be functional
Pre-requisites
- Using laravel framework (with laravel-enso on top)
To Reproduce Steps to reproduce the behavior:
- create
patches_composerfolder - create a
laravel-compile-unique.patchinside contents:
pre-support unique indexes on nullable fields
@package laravel/framework
--- src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php.org
+++ src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php
@@ -105,10 +105,11 @@
*/
public function compileUnique(Blueprint $blueprint, Fluent $command)
{
- return sprintf('create unique index %s on %s (%s)',
+ return sprintf('create unique index %s on %s (%s) where %s is not null',
$this->wrap($command->index),
$this->wrapTable($blueprint),
- $this->columnize($command->columns)
+ $this->columnize($command->columns),
+ implode(' is not null and ', $this->wrapArray($command->columns))
);
}
- ensure
"patches-search": "patches_composer"is part of theextrakey incomposer.json
Expected
laravel/framework
~ my-package: patches_composer/laravel-compile-unique.patch [NEW]
pre-support unique indexes on nullable fields
Actual A clear and concise description of what actually happened. No patches appearing at all
Notes (Optional) Add any other context about the problem here. Tested both on my local (windows 10-based) dev machine with PHP 7.1 and on the deployment CentOs server with PHP 7.2.
composer patch:list --from-source -vvv
Reading ./composer.json
Loading config file ./composer.json
Checked CA file C:\<redacted>.tmp: valid
Executing command (C:\<redacted>): git branch --no-color --no-abbrev -v
Reading C:/Users/<redacted>/AppData/Roaming/Composer/composer.json
Loading config file C:/Users/<redacted>/AppData/Roaming/Composer/composer.json
Reading C:\Users\<redacted>/vendor/composer/installed.json
Reading C:/Users/<redacted>/AppData/Roaming/Composer/vendor/composer/installed.json
Loading plugin PackageVersions\Installer
Loading plugin Vaimo\ComposerPatches\Plugin
Running 1.8.0 (2018-12-03 10:31:16) with PHP 7.1.20 on Windows NT / 10.0
and
$ composer patch:list --from-source -vvv
Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem: valid
Executing command (/home/gitlab-runner/builds/f67e7d46/1/<redacted>): git branch --no-color --no-abbrev -v
Executing command (/home/gitlab-runner/builds/f67e7d46/1/<redacted>): git describe --exact-match --tags
Reading /home/gitlab-runner/.config/composer/composer.json
Loading config file /home/gitlab-runner/.config/composer/composer.json
Reading /home/gitlab-runner/builds/f67e7d46/1/<redacted>/vendor/composer/installed.json
Reading /home/gitlab-runner/.config/composer/vendor/composer/installed.json
Loading plugin PackageVersions\Installer
Loading plugin Vaimo\ComposerPatches\Plugin
Running 1.6.5 (2018-05-04 11:44:59) with PHP 7.2.16 on Linux / 3.10.0-957.5.1.el7.x86_64
Using
"patches": {
"laravel/framework": {
"pre-support unique indexes on nullable fields": "patches_composer/laravel-compile-unique.patch"
}
}
does seem to work as expected.
I assume Iβm doing something wrong, but I canβt figure out what.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (12 by maintainers)
Will snoop around to get a finite answer to that π But yeah. It was a dodgy solution before. Using file() to load the lines is - for sure - much better way to go about it.
Fixes to this are in the latest releases btw:
Okay so the line endings are not properly dealt with so the whole file ends up being just one big chunk of data π Nice
Hmm. Okay from that Iβm sure that the issue is the speculation no. 1 π Will keep you posted on the fix π