glFusion / glfusion

glFusion CMS - Advanced Content Management with Style
https://www.glfusion.org
GNU General Public License v2.0
14 stars 15 forks source link

git clone error: unable to create symlink private/vendor/bin/doctrine-dbal: File name too long #512

Closed walterrowe closed 2 years ago

walterrowe commented 2 years ago

This is odd.

$ git clone https://github.com/glFusion/glfusion.git glfusion-new

Cloning into 'glfusion-new'...
remote: Enumerating objects: 115741, done.
remote: Counting objects: 100% (8661/8661), done.
remote: Compressing objects: 100% (3258/3258), done.
remote: Total 115741 (delta 5460), reused 8241 (delta 5155), pack-reused 107080
Receiving objects: 100% (115741/115741), 92.24 MiB | 23.64 MiB/s, done.
Resolving deltas: 100% (83775/83775), done.

error: unable to create symlink private/vendor/bin/doctrine-dbal: File name too long

Checking out files: 100% (5652/5652), done.

fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

It looks like there is something dirty in the repo.

palmin commented 2 years ago

Looking at the blob for private/vendor/bin/doctrine-dbal it has mode=12000 which makes it a symlink but instead of containing the filename of the link target it contains actual file content.

I have attached how I drill down from the HEAD commit through tree objects to doctrine-dbal.

ander@pAir glfusion % cat .git/refs/heads/master 
ecd6fca5b419962b17b4bc4e2d68f23ece36bb07

ander@pAir glfusion % git cat-file -p ecd6fca5b419962b17b4bc4e2d68f23ece36bb07
tree 360eebb5e0347d7e21d23cff3b06b9a3e8987d95
parent 383f08f5f90a037b2e305465ca11e37bb5c1c94c
parent 3133a95818ed814b3372b79eadd219412aa76ea5
author mark <mark@glfusion.org> 1645969780 -0600
committer mark <mark@glfusion.org> 1645969780 -0600

glFusion v2.0.0 Release

ander@pAir glfusion % git cat-file -p 360eebb5e0347d7e21d23cff3b06b9a3e8987d95
100644 blob 4d48fc8e8ebd71ccca8e5d528de7e7da0da0b9a3    .dockerignore
100644 blob a59db253175e0851c12876bfe8262c4bdbd34338    .gitignore
100644 blob 766556be428f24f88b23fb2e53ca7dc0b8a8a149    CHANGELOG.md
100644 blob 661afde2f43626c5a2187becccdf59ec3ea967b3    CONTRIBUTING.md
100644 blob 21d5e56eca1569ed40304b8398e6b05e2a650279    Dockerfile
100644 blob 2b5aba9d2269cab56e7b1e4b9a4f9831df140272    LICENSE
100644 blob 9df6c73068a36e81c929246412180fa661c9afb1    README.md
100644 blob 6d28ce1b1f062e77165dbf0052247602f3307e1e    SECURITY.md
100644 blob 359a5b952d49f3592571e2af081510656029298e    VERSION
100644 blob ccd570529288532bead9c179500e39b54a3f62d3    docker-compose.yml
040000 tree 9ed9bbc905a03e93a967839861a49c1e79616ffd    docker
040000 tree c93367e9bc0774b8b551a10b6a72c9ad286ba763    private
040000 tree 84c31629f53d5fad383da7d4e30e75ab5d5a309a    public_html

ander@pAir glfusion % git cat-file -p c93367e9bc0774b8b551a10b6a72c9ad286ba763
040000 tree b5292a79c8211974aec2187197ac008771289360    backups
040000 tree 5bf025617fcf1e6e82a7f398d9ba9b27377d6e6e    classes
100644 blob 4eeb01417f69a4ff003d24cc92a2a8ae17c19681    composer.json
100644 blob 31a069c33577640d8e9d1e240b20c1f0b62aaa8b    composer.lock
040000 tree a25c1188a63ce2f0e84c7862670e9e30d43004d5    data
100644 blob 1c4b5ef5295e00b932405e7b0f16378bd7cf39da    db-config.php.dist
100644 blob d6aaaa6150fe048af12bd6d83d813289e1da08e6    emailglfusionstories
040000 tree c90437c5055a2a61fc4e504394339835581e65d2    language
040000 tree 9d9bd0ede4b672e908b7bf1e7836acf2a50dc0d0    lib
040000 tree e7ed95fea1a3141420f04b3982a3c4e311ee1e0f    logs
040000 tree 4e41f50980c0a7ebfbfb260f972b621279a3f9f4    plugins
040000 tree ba2e2e901dafd03926bb2372dda950527d7b5ecf    sql
040000 tree 5c08bc8279c9639255a8ae782ddfa6ca20411c19    system
040000 tree f27e93db778a294d393ab9a79c25e929e5bd7531    vendor

ander@pAir glfusion % git cat-file -p f27e93db778a294d393ab9a79c25e929e5bd7531
100644 blob 6f45a7a8e503bc645a141ba09c82cc5280488bbd    autoload.php
040000 tree 6a27ec2ca525c6610156b875e65b6f48a0372f8f    aziraphale
040000 tree 39c9b0786073c929804b10a32feb1dba6e0fabe8    bin
040000 tree d75a7e6c3aaa088f45922eeda4a20965e660b3d3    composer
040000 tree 466067d65d86d548aa56222cbd889c4b732edb8d    doctrine
040000 tree 1c5370fb3d144a8f5e7cafc91cc10efaa2259123    eluceo
040000 tree 133aea2c10b0f1098a01e5c1c5070f6469da166c    ezyang
040000 tree 12d19ae8c7ad2e1438435192eaec5edc24b65fe7    filp
040000 tree 0d34cdf76bc63e69b53a88723b43df5bcb560aa3    html2text
040000 tree 5df80778648a775073887615ab41c72ec6d34c96    james-heinrich
040000 tree 29551425d74deadf26b1df9116c8bad1b4c4182c    misd
040000 tree 43eee85255342e948a63ac489f1b97bc460c4cb0    monolog
040000 tree 696acc29babdf9ba241d5cb5891d949a96fd9197    openpsa
040000 tree e6d9bd7b4771810250d79d92027e24f9aca1b6ac    phpclasses
040000 tree 3d151190ee1cfa8240f4dd5f1adec9f8f6298dd3    phpfastcache
040000 tree 713aadac3d387c8c5a3870fc925c1eece6e210d7    phpmailer
040000 tree 0b6c859f365ee7885fe4aaf3f10b19cf370aaf8c    phpxmlrpc
040000 tree af37caf22e50bf5ca38fc26587ce078b71649c2a    psr
040000 tree 7810c31524001c1158792fb360467ed804bb16af    robthree
040000 tree 8df08dc90fc74feb54e58b79f5467a5f2dc200c3    simplepie
040000 tree 5f3d44ef463fae10627ca1a85ebaa750928aba7f    splitbrain

ander@pAir glfusion % git cat-file -p 39c9b0786073c929804b10a32feb1dba6e0fabe8
120000 blob 4a2986088e21b62e3626517f38c0c80d463c7119    doctrine-dbal

ander@pAir glfusion % git cat-file -p 4a2986088e21b62e3626517f38c0c80d463c7119
#!/usr/bin/env php
<?php

/**
 * Proxy PHP file generated by Composer
 *
 * This file includes the referenced bin path (../doctrine/dbal/bin/doctrine-dbal)
 * using a stream wrapper to prevent the shebang from being output on PHP<8
 *
 * @generated
 */

namespace Composer;

$GLOBALS['_composer_bin_dir'] = __DIR__;
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';

if (PHP_VERSION_ID < 80000) {
    if (!class_exists('Composer\BinProxyWrapper')) {
        /**
         * @internal
         */
        final class BinProxyWrapper
        {
            private $handle;
            private $position;
            private $realpath;

            public function stream_open($path, $mode, $options, &$opened_path)
            {
                // get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
                $opened_path = substr($path, 17);
                $this->realpath = realpath($opened_path) ?: $opened_path;
                $opened_path = $this->realpath;
                $this->handle = fopen($this->realpath, $mode);
                $this->position = 0;

                return (bool) $this->handle;
            }

            public function stream_read($count)
            {
                $data = fread($this->handle, $count);

                if ($this->position === 0) {
                    $data = preg_replace('{^#!.*\r?\n}', '', $data);
                }

                $this->position += strlen($data);

                return $data;
            }

            public function stream_cast($castAs)
            {
                return $this->handle;
            }

            public function stream_close()
            {
                fclose($this->handle);
            }

            public function stream_lock($operation)
            {
                return $operation ? flock($this->handle, $operation) : true;
            }

            public function stream_tell()
            {
                return $this->position;
            }

            public function stream_eof()
            {
                return feof($this->handle);
            }

            public function stream_stat()
            {
                return array();
            }

            public function stream_set_option($option, $arg1, $arg2)
            {
                return true;
            }

            public function url_stat($path, $flags)
            {
                $path = substr($path, 17);
                if (file_exists($path)) {
                    return stat($path);
                }

                return false;
            }
        }
    }

    if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) {
        include("phpvfscomposer://" . __DIR__ . '/..'.'/doctrine/dbal/bin/doctrine-dbal');
        exit(0);
    }
}

include __DIR__ . '/..'.'/doctrine/dbal/bin/doctrine-dbal';
mark0263 commented 2 years ago

I've taken the file out - let's see if that solves it.

walterrowe commented 2 years ago

The git clone worked.

$ git clone https://github.com/glFusion/glfusion.git glfusion-new
Cloning into 'glfusion-new'...
remote: Enumerating objects: 115745, done.
remote: Counting objects: 100% (8665/8665), done.
remote: Compressing objects: 100% (3219/3219), done.
remote: Total 115745 (delta 5470), reused 8280 (delta 5198), pack-reused 107080
Receiving objects: 100% (115745/115745), 92.20 MiB | 22.57 MiB/s, done.
Resolving deltas: 100% (83785/83785), done.
Checking out files: 100% (5651/5651), done.
mark0263 commented 2 years ago

Fixed the errant file.