Skip to content
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

Patching doesn't work #9

Closed
VeeeneX opened this issue Feb 7, 2017 · 2 comments
Closed

Patching doesn't work #9

VeeeneX opened this issue Feb 7, 2017 · 2 comments

Comments

@VeeeneX
Copy link

VeeeneX commented Feb 7, 2017

I've tested with composer installed locally and it works but using a image it doesn't work at all.

Composer:

docker run --rm -v $(pwd):/app:rw -v $HOME/.composer:/composer -v /etc/passwd:/etc/passwd:ro  -v /etc/group:/etc/group:ro --user $(id -u):$(id -g) composer ${@:2} --no-ansi --no-interaction --no-progress --optimize-autoloader --ignore-platform-reqs

composer.json:

{
    "require": {
        "brouwers/shortcodes": "1.*"
    },
    "config": {
        "preferred-install": "source",
        "process-timeout": 1800,
        "discard-changes" : true
    },
    "extra": {
        "patches": {
            "brouwers/shortcodes": {
                "Fixed bugs from Updates": "https://github.com/patrickbrouwers/Laravel-Shortcodes/compare/master...VeeeneX:master.patch"
            }
        }
    }
}

Gathering patches for dependencies. This might take a minute.
Found 1 patches for brouwers/shortcodes.
  - Installing brouwers/shortcodes (1.0.2)Executing command (CWD): git --version

    Cloning to cache at '/composer/cache/vcs/https---github.com-patrickbrouwers-Laravel-Shortcodes.git/'
Executing command (/composer/cache/vcs/https---github.com-patrickbrouwers-Laravel-Shortcodes.git/): git rev-parse --git-dir
Executing command (/composer/cache/vcs/https---github.com-patrickbrouwers-Laravel-Shortcodes.git/): git remote -v
Executing command (/composer/cache/vcs/https---github.com-patrickbrouwers-Laravel-Shortcodes.git/): git remote set-url origin 'https://github.com/patrickbrouwers/Laravel-Shortcodes.git' && git remote update --prune origin
 Cloning a35dc13a67e88f477d3429cc1bf0a2eee2297128 from cache
Executing command (CWD): git clone --no-checkout 'https://github.com/patrickbrouwers/Laravel-Shortcodes.git' '/app/vendor/brouwers/shortcodes' --dissociate --reference '/composer/cache/vcs/https---github.com-patrickbrouwers-Laravel-Shortcodes.git/' && cd '/app/vendor/brouwers/shortcodes' && git remote add composer 'https://github.com/patrickbrouwers/Laravel-Shortcodes.git' && git fetch composer
Executing command (/app/vendor/brouwers/shortcodes): git remote set-url --push origin 'git@github.com:patrickbrouwers/Laravel-Shortcodes.git'
Executing command (/app/vendor/brouwers/shortcodes): git branch -r
Executing command (/app/vendor/brouwers/shortcodes): git checkout '1.0.2' --
Executing command (/app/vendor/brouwers/shortcodes): git reset --hard 'a35dc13a67e88f477d3429cc1bf0a2eee2297128' --
    REASON: Required by the root package: Install command rule (install brouwers/shortcodes 1.0.0|install brouwers/shortcodes 1.0.1|install brouwers/shortcodes 1.0.2)

  - Applying patches for brouwers/shortcodes
    https://github.com/patrickbrouwers/Laravel-Shortcodes/compare/master...VeeeneX:master.patch (Fixed bugs from Updates)
Downloading https://github.com/patrickbrouwers/Laravel-Shortcodes/compare/master...VeeeneX:master.patch
cd '/app/vendor/brouwers/shortcodes' && GIT_DIR=. git apply --check '-p1' '/tmp/589a3d0418aca.patch'
Executing command (CWD): cd '/app/vendor/brouwers/shortcodes' && GIT_DIR=. git apply --check '-p1' '/tmp/589a3d0418aca.patch'
error: patch failed: src/Brouwers/Shortcodes/Compilers/ShortcodeCompiler.php:1
error: src/Brouwers/Shortcodes/Compilers/ShortcodeCompiler.php: patch does not apply

Executing command (CWD): cd '/app/vendor/brouwers/shortcodes' && GIT_DIR=. git apply --check '-p0' '/tmp/589a3d0418aca.patch'
cd '/app/vendor/brouwers/shortcodes' && GIT_DIR=. git apply --check '-p0' '/tmp/589a3d0418aca.patch'
error: a/README.md: No such file or directory
error: a/composer.json: No such file or directory
error: a/src/Brouwers/Shortcodes/Compilers/Shortcode.php: No such file or directory
error: a/src/Brouwers/Shortcodes/Compilers/ShortcodeCompiler.php: No such file or directory
error: a/src/Brouwers/Shortcodes/Facades/Shortcode.php: No such file or directory
error: a/src/Brouwers/Shortcodes/Illuminate/View/Factory.php: No such file or directory
error: a/src/Brouwers/Shortcodes/Illuminate/View/View.php: No such file or directory
error: a/src/Brouwers/Shortcodes/Shortcode.php: No such file or directory
error: a/src/Brouwers/Shortcodes/ShortcodesServiceProvider.php: No such file or directory
error: a/src/config/config.php: No such file or directory

error: a/src/Brouwers/Shortcodes/Compilers/Shortcode.php: No such file or directory
error: a/src/Brouwers/Shortcodes/Compilers/ShortcodeCompiler.php: No such file or directory
error: a/src/Brouwers/Shortcodes/Facades/Shortcode.php: No such file or directory
error: a/src/Brouwers/Shortcodes/Illuminate/View/Factory.php: No such file or directory
error: a/src/Brouwers/Shortcodes/Illuminate/View/View.php: No such file or directory
error: a/src/Brouwers/Shortcodes/Shortcode.php: No such file or directory
error: a/src/Brouwers/Shortcodes/ShortcodesServiceProvider.php: No such file or directory

cd '/app/vendor/brouwers/shortcodes' && GIT_DIR=. git apply --check '-p2' '/tmp/589a3d0418aca.patch'
Executing command (CWD): cd '/app/vendor/brouwers/shortcodes' && GIT_DIR=. git apply --check '-p2' '/tmp/589a3d0418aca.patch'
fatal: git diff header lacks filename information when removing 2 leading pathname components (line 28)

patch '-p1' --no-backup-if-mismatch -d '/app/vendor/brouwers/shortcodes' < '/tmp/589a3d0418aca.patch'
Executing command (CWD): patch '-p1' --no-backup-if-mismatch -d '/app/vendor/brouwers/shortcodes' < '/tmp/589a3d0418aca.patch'
patch: unrecognized option: no-backup-if-mismatch

BusyBox v1.24.2 (2016-11-01 12:56:05 GMT) multi-call binary.

Usage: patch [OPTIONS] [ORIGFILE [PATCHFILE]]

        -p,--strip N            Strip N leading components from file names
        -i,--input DIFF         Read DIFF instead of stdin
        -R,--reverse            Reverse patch
        -N,--forward            Ignore already applied patches
        -E,--remove-empty-files Remove output files if they become empty

patch '-p0' --no-backup-if-mismatch -d '/app/vendor/brouwers/shortcodes' < '/tmp/589a3d0418aca.patch'
Executing command (CWD): patch '-p0' --no-backup-if-mismatch -d '/app/vendor/brouwers/shortcodes' < '/tmp/589a3d0418aca.patch'
patch: unrecognized option: no-backup-if-mismatch

BusyBox v1.24.2 (2016-11-01 12:56:05 GMT) multi-call binary.

Usage: patch [OPTIONS] [ORIGFILE [PATCHFILE]]

        -p,--strip N            Strip N leading components from file names
        -i,--input DIFF         Read DIFF instead of stdin
        -R,--reverse            Reverse patch
        -N,--forward            Ignore already applied patches
        -E,--remove-empty-files Remove output files if they become empty

patch '-p2' --no-backup-if-mismatch -d '/app/vendor/brouwers/shortcodes' < '/tmp/589a3d0418aca.patch'
Executing command (CWD): patch '-p2' --no-backup-if-mismatch -d '/app/vendor/brouwers/shortcodes' < '/tmp/589a3d0418aca.patch'
patch: unrecognized option: no-backup-if-mismatch

BusyBox v1.24.2 (2016-11-01 12:56:05 GMT) multi-call binary.

Usage: patch [OPTIONS] [ORIGFILE [PATCHFILE]]

        -p,--strip N            Strip N leading components from file names
        -i,--input DIFF         Read DIFF instead of stdin
        -R,--reverse            Reverse patch
        -N,--forward            Ignore already applied patches
        -E,--remove-empty-files Remove output files if they become empty

   Could not apply patch! Skipping. The error was: Cannot apply patch https://github.com/patrickbrouwers/Laravel-Shortcodes/compare/master...VeeeneX:master.patch

Reading /app/vendor/composer/installed.json
Reading ./composer.lock
Generating autoload files
@alcohol
Copy link
Member

alcohol commented Feb 8, 2017

First of all, you are talking about a feature that is not developed nor supported by Composer (we do not offer any kind of patching mechanism).

The errors presented however are quite clear. The arguments supplied to the patch binary are not supported by this version of patch. This is most likely the result of Alpine (the distro upon which our base image is based) which ships with BusyBox, and has a more limited version of the patch binary/command.

You will have to extend our base image and install the patch package for full support.

@alcohol alcohol closed this as completed Feb 8, 2017
@VeeeneX
Copy link
Author

VeeeneX commented Feb 8, 2017

Sure I agree :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants