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

composer.lock is always read from home directory instead tests #1028

Open
chiragvels opened this issue May 24, 2024 · 3 comments
Open

composer.lock is always read from home directory instead tests #1028

chiragvels opened this issue May 24, 2024 · 3 comments
Labels
question Further information is requested triage Need triage

Comments

@chiragvels
Copy link

Hi,

I am in the process of updating my code to use the latest version of the library. To ensure that the current working environment continues to function properly, I created another directory and installed the latest version of the library with Composer in this new directory. For this, I made multiple composer.json files in different directories so that my structure looks like this:

/my-project
    /application
    /vendor
    composer.json
    /tests
        /vendor
        composer.json

And autoload the vendor using:

require_once '/tests/vendor/autoload.php'

Now, When I tried to build an instance of the GoogleAdsClient object, I received the following error:

The grpc extension installed by Composer has a greater version than that installed by PECL. Upgrade the PECL extension to avoid issues caused by the version difference. For linux, run "sudo pecl install grpc".

To ensure I have the correct version of grpc, I checked with composer show and found that the version installed by PECL is greater than the one installed by Composer.

When I closely checked the Dependencies.php under Util, I noticed it was checking the composer.lock from the /my-project (the home directory of the project).

How can I tell the library to read files from /tests instead of the home directory /my-project?

Thanks,

@chiragvels chiragvels added question Further information is requested triage Need triage labels May 24, 2024
@fiboknacky
Copy link
Member

I believe we cannot do that yet with the current version of the GoogleAdsClientBuilder class.
I'm considering allowing for bypassing that check (with users' own risks) when creating the GoogleAdsClient.

@chiragvels
Copy link
Author

Hi @fiboknacky ,

Thanks for considering this, If you can guide how I can do as of now?

Thanks,

@fiboknacky
Copy link
Member

The quick fix for now is to comment out everything in getGrpcComposerVersion except for the last line return null;. That will make the client library skip comparing versions between composer.lock and the system package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested triage Need triage
Projects
None yet
Development

No branches or pull requests

2 participants