Skip to content

[Fix] Issues with ramsey/uuid when installing? #17

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

Closed
smoopins opened this issue May 31, 2020 · 11 comments · Fixed by #31
Closed

[Fix] Issues with ramsey/uuid when installing? #17

smoopins opened this issue May 31, 2020 · 11 comments · Fixed by #31

Comments

@smoopins
Copy link

Hey folks, not a bug, but a compatibility issue downstream from this package.

This is likely a newbie issue more than anything, but if you're using Laravel 7 (in my case 7.13) it requires ramsey/uuid ^3|^4".

However, opencensus/opencensus (a dependency of this package) has its ramsey/uuid dependency set to "~3".

Thus, you need to manually downgrade ramsey/uuid directly in your project PRIOR to requiring gluedev/laravel-stackdriver or you too could wind up in the dependency-hell I just escaped from.

Do this by running composer require ramsey/uuid "^3". Then you can proceed on and run composer require gluedev/laravel-stackdriver.

Again, this dependency tracing may be second nature to others... but it just gobbled up about 90 minutes of my time. Thus, I hope this helps others.

@DiederikvandenB DiederikvandenB pinned this issue Oct 12, 2020
@DiederikvandenB DiederikvandenB changed the title Dependency hell with Laravel 7 [Fixed] Issues with ramsey/uuid when installing? Oct 12, 2020
@DiederikvandenB DiederikvandenB changed the title [Fixed] Issues with ramsey/uuid when installing? [Fix] Issues with ramsey/uuid when installing? Oct 12, 2020
@JulianMar
Copy link

Thanks for your suggestion!
This Package will not work with Laravel 8 because it requires ramsey/uuid:^4.0

@cerw
Copy link

cerw commented Jan 27, 2021

Any workaround on this?

@DiederikvandenB
Copy link
Contributor

This is an issue with the opencencus package. They seem to not be in a rush when it comes to releasing new versions:
census-instrumentation/opencensus-php#253
census-instrumentation/opencensus-php#268

Maybe there's some way to circumvent this through composer.json, or someone would have to fork the opencencus package.

@JulianMar
Copy link

yes the only way is to fork the project and setup composer.json to use your fork.
I used this guide and it worked for me

@DiederikvandenB
Copy link
Contributor

So a new release was finally pushed, but unfortunately the PR for updating ramsey/uuid still goes unnoticed:
census-instrumentation/opencensus-php#261

@cerw
Copy link

cerw commented Feb 4, 2021

For now, I forked and made it work with ramsey/uuid v4 , not ideal but it works for now.

        {
            "type": "vcs",
            "url": "[email protected]:nanosolutions/laravel-stackdriver.git"
        },
        {
            "type": "vcs",
            "url": "[email protected]:nanosolutions/opencensus-php.git"
        },
        {
            "type": "vcs",
            "url": "[email protected]:nanosolutions/opencensus-php-exporter-stackdriver.git"
        }

@bhaidar
Copy link

bhaidar commented May 26, 2021

Hey @cerw Can you share the steps on how to upgrade the composer and use this package in Laravel 8?Thanks

@bhaidar
Copy link

bhaidar commented May 26, 2021

Thanks for your suggestion!
This Package will not work with Laravel 8 because it requires ramsey/uuid:^4.0

Hey

yes the only way is to fork the project and setup composer.json to use your fork.
I used this guide and it worked for me

Hey @JulianMar

In this case, we have 3 packages:

  • laravel-stackdriver
  • opencensus
  • opencensus-exporter-stackdriver
  1. I bumped the version of ramsey/uuid inside opencensus and pushed to my own fork.
  2. Added the "repositories" section to opencensus-exporter-stackdriver and changed the version of the opencensus package used as "dev-master"
  3. Add the "repositories" section to laravel-stackdriver and changed the versions of the opencensus to "dev-master" and also the same thing with openensus/-exporter-stackdriver.

In my Laravel app, I made the gluedev/laravel-stackdriver with version "dev-master" together with a "repositories" section to my own forked version of the package.

When I try to run "composer update", I get this:

Problem 1
    - opencensus/opencensus-exporter-stackdriver dev-master requires opencensus/opencensus ~0.5 -> satisfiable by opencensus/opencensus[v0.5.0, v0.5.1, v0.5.2, v0.6.0].
    - You can only install one version of a package, so only one of these can be installed: opencensus/opencensus[dev-master, v0.5.0, v0.5.1, v0.5.2, v0.6.0].
    - gluedev/laravel-stackdriver dev-master requires opencensus/opencensus dev-master -> satisfiable by opencensus/opencensus[dev-master].
    - gluedev/laravel-stackdriver dev-master requires opencensus/opencensus-exporter-stackdriver dev-master -> satisfiable by opencensus/opencensus-exporter-stackdriver[dev-master].
    - Root composer.json requires gluedev/laravel-stackdriver dev-master -> satisfiable by gluedev/laravel-stackdriver[dev-master].

@cerw
Copy link

cerw commented May 27, 2021

Hey @cerw Can you share the steps on how to upgrade the composer and use this package in Laravel 8?Thanks

Hello,

See example of one of projects:

{
    "name": "*******",
    "type": "project",
    "description": "*",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "proprietary",
    "authors": [
        {
            "name": "Nano Solutions Pty Ltd",
            "email": "[email protected]",
            "homepage": "https://nanosolutions.io",
            "role": "Developer"
        }
    ],
    "require": {
        "php": "^7.3 || ^8.0",
        "ext-json": "*",
        "bugsnag/bugsnag-laravel": "^2.20",
        "doctrine/dbal": "^2.11",
        "erusev/parsedown": "^1.7",
        "facade/ignition": "^2.5",
        "fideloper/proxy": "^4.4",
        "fruitcake/laravel-cors": "^2.0",
        "gluedev/laravel-stackdriver": "dev-develop",
        "guzzlehttp/guzzle": "^7.0.1",
        "htmlmin/htmlmin": "^8.0",
        "kalnoy/nestedset": "^5.0",
        "laravel/framework": "^8",
        "laravel/horizon": "^5.6",
        "laravel/legacy-factories": "^1.1",
        "laravel/slack-notification-channel": "^2.2",
        "laravel/tinker": "^2.5",
        "laravel/ui": "^3.0",
        "league/flysystem-cached-adapter": "^1.1",
        "maatwebsite/excel": "dev-main",
        "predis/predis": "^1.1",
        "simplehtmldom/simplehtmldom": "^2.0@RC",
        "spatie/laravel-activitylog": "^3.16",
        "spatie/laravel-medialibrary": "^9.0",
        "spatie/laravel-tail": "^4.3",
        "stevebauman/purify": "^3.0",
        "superbalist/laravel-google-cloud-storage": "^2.2"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.5",
        "beyondcode/laravel-dump-server": "^1.5",
        "enlightn/security-checker": "^1.8",
        "ergebnis/composer-normalize": "^2.13",
        "fakerphp/faker": "^1.9.1",
        "jakub-onderka/php-console-highlighter": "^0.4.0",
        "laravel/dusk": "^6.8",
        "mockery/mockery": "^1.4.2",
        "nano/docs": "dev-master",
        "nunomaduro/collision": "^5.0",
        "php-parallel-lint/php-parallel-lint": "^1.1",
        "php-webdriver/webdriver": "^1.8",
        "phpro/grumphp": "^1.0",
        "phpunit/phpunit": "^9.3.3"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "[email protected]:nanosolutions/Laravel-Excel.git"
        },
        {
            "type": "vcs",
            "url": "[email protected]:nanosolutions/laravel-stackdriver.git"
        },
        {
            "type": "vcs",
            "url": "[email protected]:nanosolutions/opencensus-php.git"
        },
        {
            "type": "vcs",
            "url": "[email protected]:nanosolutions/opencensus-php-exporter-stackdriver.git"
        }
    ],
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

@bhaidar
Copy link

bhaidar commented May 27, 2021

Thanks @cerw

Not only you need to add repositories section to opencensus-php-exporter-stackdriver and laravel-stackdriver, but also in the project using laravel-stackdriver?

Thanks

@bhaidar
Copy link

bhaidar commented May 27, 2021

Thanks @cerw I managed to make it work.

I had to do the following:

  • Fork & Bump ramsey/uuid on opencensus
  • Fork & add repositories section on opencensus-php-exporter-stackdriver
  • Fork & add repositories section on laravel-stackdriver (develop is the main branch not master)
  • In my main app, I use "gluedev/laravel-stackdriver": "dev-develop", and added the three forked repositories all together in the app composer.json file.

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

Successfully merging a pull request may close this issue.

5 participants