-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
The "-x" option does not exist. #192
Comments
Could you try to run it locally with docker CLI (like https://github.com/overtrue/phplint/blob/main/docs/usage/docker.md) to check if it does not come from your GitLab CI platform ? |
@llaville thank you for responding 😄 I would do that, but I don't know how - especially this step:
also I see this warning on that page that makes me wonder:
Would that also be true in the gitlab pipeline? Because we are using a php 8.1 image in our pipeline. |
@craigh If you want to detect new PHP 8.2 feature as error, because you're running PHP 8.1 in your pipeline, I recommand you to rebuild the docker image (latest tag, by whatever you want) with the https://github.com/overtrue/phplint/blob/main/Dockerfile#L2 docker image file and use PHP_VERSION=8.1 Otherwise PHP 8.2 is compatible with PHP 8.1, and new specific 8.2 feature won't be detected, of course, as errors. Hope it will help ! |
Thank you again @llaville ❤️ From within my project dir, I did this:
So, it looks like it runs properly on local. Now I just need to get the pipeline configured correctly. I don't care about erroring for php 8.2. I just want to get it to work 😄 Can you help with the gitlab pipeline config? |
fyi - I am just using gitlab website. nothing custom/local |
@craigh Could you run again with Docker CLI command by setting the APP_DEBUG env var like this : And copy/paste as answer the output please ? It will probably help us to investigate more. |
@llaville see below for what you requested. I'm not clear on how this helps though. My problem is not on my local but more simply - cannot get the job to run on my gitlab pipeline 😄 thanks for your continued help! 🙇
|
I know that this attempt seems useless for you, but as your issue is almost the same as #116 , I wanted to check if we will try to raise error into the Now, this way was check we can investigate on other direction. BTW, I'm not an expert of GitLab. I'll try to prepare an environment to test it on my platform later ... |
that makes two of us 😉 |
@craigh I've a BAD and GOOD news !
Here is an example of phplint:
stage: test
needs: []
image:
name: php:8.2-cli-alpine
variables:
INPUT_PATH: "./"
INPUT_OPTIONS: "-vvv"
before_script:
- apk add --no-cache curl
- curl -Ls https://github.com/overtrue/phplint/releases/latest/download/phplint.phar -o /usr/local/bin/phplint
- chmod +x /usr/local/bin/phplint
script:
- /usr/local/bin/phplint $INPUT_PATH $INPUT_OPTIONS Don't forget to change variables (INPUT_PATH and INPUT_OPTIONS) Awaiting your feedback to close this issue |
Greetings @llaville and thank you again for your continued work! I haven't tried this yet, because I have concerns about this solution in principle. Because gitlab pipeline minutes cost money, I am looking for ways to decrease the time spent building and executing our pipelines. As I said above, I am not a gitlab expert, but I am guessing that utilizing a pre-built image like My original intention was to utilize the prebuilt-image as a time and money saver and to reduce clutter in our repo. I don't see this workaround as meeting that intention. So, imo, this ticket shouldn't be closed because this solution doesn't actually solve the problem of running the script via a pre-built image, but rather provides a workaround. I very much appreciate the time you have already spent on this! Since you were able to reproduce the error in your gitlab image, but it seems to work with the image locally, the problem seems to be with the way gitlab is running the entry script vs. how it would be done locally. That is the bug that needs to be addressed here. cc: @OGProgrammer |
As you already know, I'm not a gitlab expert too. I've spent few hours to discover it (CE version with runner under Docker locally) and try to find origin of issue, using the I'm using the official PHP 8.2 CLI Alpine image (see https://hub.docker.com/_/php/tags?page=1&name=8.2-cli-alpine), and just add the curl tool to be able to download the PHAR version of PHPLint 9. You are free to use whatever PHP image you want, because we need at least one to run the PHAR. If you build your own PHP image, I suggest to include the PHPLint tool, that will avoid cost to download the PHAR via curl.
Thanks for your feedback. On my side I cannot do more things ! |
@craigh By reading the official GitLab doc (https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#override-the-entrypoint-of-an-image) I've an idea and tried it with a good result, but I don't know :
If you found an expert that may explain this situation, I'll be really happy ! Here is my try with phplint:
stage: test
needs: []
image:
name: overtrue/phplint:latest
entrypoint: [""]
variables:
INPUT_PATH: "./"
INPUT_OPTIONS: "-vvv"
script:
- echo '' #prevents ci yml parse error
- '/home/appuser/.composer/vendor/bin/phplint $INPUT_PATH $INPUT_OPTIONS' And the results in picture |
Well, I get a new error with those changes:
|
This problem is not related to our use case, but rather to your project. Have a look on your console output
You can check it with Extension xsl is not loaded, but PHPLint v9 works ! |
I don't think I understand. Is the phplint image running |
phplint did not run composer install or update. |
Hello @overtrue |
I see a problem from your communication:
Here it seems to be installed to an older version, I compared
If so, try clearing the cache and running again. I'm probably less familiar with gitlab than you two, and I don't use it at all. In general, BTW, if your project is PHP 8.2, it might help to set Looking forward to your feedback. |
Hi @overtrue
I disagree with you here because you don't check the right SHA256 ! If you compare
It was a good idea. Thanks :) Trying with this phplint:
stage: test
needs: []
image:
name: overtrue/phplint:8.1
#entrypoint: [""]
variables:
INPUT_PATH: "./"
INPUT_OPTIONS: "-vvv"
script:
- echo '' #prevents ci yml parse error Gave such results : First approach to search on a better way. Thanks again @overtrue for your share. BTW, as docker images I'll try to see what was wrong with v9, but I'm pretty sure not this is due to the Docker rootless solution. |
Good news, I've found origin that raise Need more time to make more tests (especially non regression on other platforms), but a 9.0.5 should be publish sooner |
NOTE
|
@craigh If you want to test RC version (of upcoming 9.0.5), please try with docker image https://hub.docker.com/layers/overtrue/phplint/rc/images/sha256-32d94022491641aa9f7d0f526aec3bd3fdbd3f1c889c02cd7d80e899d93a14d5?context=explore Help and Feedback will be greatly appreciated. @overtrue I'm still working on regression with GitHub runs (on my private repo), but any help will be greatly appreciated (if you've some free time). In summary
|
Final docker image to use is https://hub.docker.com/layers/overtrue/phplint/rc/images/sha256-d3d7434c1d7489f912c7f06827969721dfaf028f7142b689e62e5d4f22c9d87d?context=explore This version solve conflict with GitHub Actions environment @craigh, @overtrue Awaiting your feeback now ! Won't do anything more until receive. |
@craigh please take a try, Thanks |
No feedbacks received in a reasonable period. I'll close this issue and consider that GitLab is not supported. If you really want to have such feature, you're free to re-open this report with a helpfull feedback. |
@thakilla Ok I'll reimplement the solution, I've provided 1 year ago. Hope you'll give me some feedback when it'll be available. I'll keep you aware. But I told it (for the Community) it's the last try for me to investigate free time without waiting answers that didn't came back. |
Tested with gcil (launch .gitlab-ci.yml jobs locally) on a fresh Docker version built locally and tagged privately on my repo (for test purpose only). Output gave something like
|
For Info: I already known the act to run GitHub Actions locally, but I didn't know yet until today that there is an alternative for GitLab. |
@overtrue As PHP 8.1 will reach End-Of-Life of active support when PHP 8.4.0 (stable) will be available, I've took the decision to raise PHP minimum requirement to 8.2 for upcoming release 9.5.0 |
👌 |
Final version (minus changelog) 9.5.0 is available on repo (branch 9.5) and docker image was published : @thakilla If you want to test it again before I release the stable version 9.5.0 tomorrow. |
@thakilla Thanks for your quick answer (I appreciate a lot !) Version 9.5.0 is on way and will be released very soon now. |
Release 9.5.2 is available. Same as 9.5.0 but with internal GitHub Workflows fixed (due to PHP 8.1 support dropped). |
Sorry to litter your repo with a support request. I am aware of older issues with the same issues, but could not resolve.
I get the error
The "-x" option does not exist.
when running the linter.I am using gitlab CI with a symfony-based project with a standard symfony file structure. (e.g. project_dir/src/...)
My
.gitlab-ci.yml
job:my
.phplint.yml
:my output in the pipeline
Please advise how to correct. thank you!
The text was updated successfully, but these errors were encountered: