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

The "-x" option does not exist. #192

Closed
craigh opened this issue Sep 19, 2023 · 36 comments
Closed

The "-x" option does not exist. #192

craigh opened this issue Sep 19, 2023 · 36 comments
Assignees
Labels

Comments

@craigh
Copy link

craigh commented Sep 19, 2023

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:

phplint:
  stage: test
  needs: []
  image: overtrue/phplint:latest
  variables:
      INPUT_PATH: "./"
      INPUT_OPTIONS: "-c .phplint.yml"
  script: echo '' #prevents ci yml parse error

my .phplint.yml:

path: ./src
jobs: 10
extensions:
    - php
exclude:
    - vendor
warning: true
memory-limit: -1
no-cache: true

my output in the pipeline

Running with gitlab-runner 16.3.0~beta.108.g2b6048b4 (2b6048b4)
  on green-2.saas-linux-small-amd64.runners-manager.gitlab.com/default ns46NMmJ, system ID: s_85d7af184313
  feature flags: FF_USE_IMPROVED_URL_MASKING:true, FF_RESOLVE_FULL_TLS_CHAIN:false

Resolving secrets
00:00

Preparing the "docker+machine" executor
00:07
Using Docker executor with image overtrue/phplint:latest ...
Pulling docker image overtrue/phplint:latest ...
Using docker image sha256:5f8f6a623cc79c280baa62930eecabb2d6c0a2cda58688b0f945915952e9a64a for overtrue/phplint:latest with digest overtrue/phplint@sha256:191bdfb1d350c38a7d98014bdff83122103f5dcb4ae22552e4d1cb1df9de3d28 ...

Preparing environment
00:01
Running on runner-ns46nmmj-project-15927696-concurrent-0 via runner-ns46nmmj-s-l-s-amd64-1695128617-90cdfe2e...

Getting source from Git repository
00:03
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/clerkbase/onboard-app/.git/
Created fresh repository.
Checking out e3d8436f as detached HEAD (ref is refs/merge-requests/1085/head)...
Skipping Git submodules setup
$ git remote set-url origin "${CI_REPOSITORY_URL}"

Restoring cache
00:13
Checking cache for 0_yarn-f6addb288c725b780b517883bd059972ea139036-non_protected...
Downloading cache from https://storage.googleapis.com/gitlab-com-runners-cache/project/15927696/0_yarn-f6addb288c725b780b517883bd059972ea139036-non_protected 
Successfully extracted cache
Checking cache for 1_composer-3c910146abac5175794d5c45560871a531ac11b9-non_protected...
Downloading cache from https://storage.googleapis.com/gitlab-com-runners-cache/project/15927696/1_composer-3c910146abac5175794d5c45560871a531ac11b9-non_protected 
Successfully extracted cache

Executing "step_script" stage of the job script
00:00
Using docker image sha256:5f8f6a623cc79c280baa62930eecabb2d6c0a2cda58688b0f945915952e9a64a for overtrue/phplint:latest with digest overtrue/phplint@sha256:191bdfb1d350c38a7d98014bdff83122103f5dcb4ae22552e4d1cb1df9de3d28 ...
                                   
  The "-x" option does not exist.  
                                   
lint [--exclude EXCLUDE] [--extensions EXTENSIONS] [-j|--jobs JOBS] [-c|--configuration CONFIGURATION] [--no-configuration] [--cache CACHE] [--no-cache] [-p|--progress PROGRESS] [--no-progress] [--log-json [LOG-JSON]] [--log-junit [LOG-JUNIT]] [-w|--warning] [--memory-limit MEMORY-LIMIT] [--ignore-exit-code] [--] [<path>...]

Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1

Please advise how to correct. thank you!

@llaville
Copy link
Collaborator

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 ?

@craigh
Copy link
Author

craigh commented Sep 21, 2023

@llaville thank you for responding 😄

I would do that, but I don't know how - especially this step:

Please mount your source code to /workdir in the container.

also I see this warning on that page that makes me wonder:

IMPORTANT : Docker image with latest tag use the PHP 8.2 runtime !

Would that also be true in the gitlab pipeline? Because we are using a php 8.1 image in our pipeline.

@llaville
Copy link
Collaborator

llaville commented Sep 21, 2023

@craigh
As explained by the doc, following syntax docker run --rm -t -v "${PWD}":/workdir overtrue/phplint:latest will mount the current local working directory (PWD) (suppose to be your source code project) in the container by the /workdir internal docker container dir.

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 !

@craigh
Copy link
Author

craigh commented Sep 21, 2023

Thank you again @llaville ❤️

From within my project dir, I did this:

craig@Craigs-MBP onboard-app % docker run --rm -t -v "":/workdir overtrue/phplint:latest ./ --exclude=vendor --no-configuration --no-cache
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
phplint 9.0.4 by overtrue and contributors.

Runtime       : PHP 8.2.6
Configuration : No config file loaded

................................................................................................ 97 / 110 ( 88%)
..............

Time: 4 secs, Memory: 4.0 MiB, Cache: 0 hit, 110 misses


 [OK] 110 files

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?

@craigh
Copy link
Author

craigh commented Sep 21, 2023

to check if it does not come from your GitLab CI platform ?

fyi - I am just using gitlab website. nothing custom/local

@llaville
Copy link
Collaborator

@craigh Could you run again with Docker CLI command by setting the APP_DEBUG env var like this :
craig@Craigs-MBP onboard-app % docker run --rm -t -v "":/workdir -e APP_DEBUG=true overtrue/phplint:latest ./ --exclude=vendor --no-configuration --no-cache

And copy/paste as answer the output please ? It will probably help us to investigate more.

@craigh
Copy link
Author

craigh commented Sep 22, 2023

@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! 🙇

craig@Craigs-MBP onboard-app % docker run --rm -t -v "":/workdir -e APP_DEBUG=true overtrue/phplint:latest ./ --exclude=vendor --no-configuration --no-cache
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
+ set -e
+ '[' true '==' true ]
+ id -u -n
+ echo '> You will act as user: appuser'
> You will act as user: appuser
+ composer config --global --list
+ echo '[repositories.packagist.org.type] composer
[repositories.packagist.org.url] https://repo.packagist.org
[process-timeout] 300
[use-include-path] false
[use-parent-dir] prompt
[preferred-install] dist
[notify-on-install] true
[github-protocols] [https, ssh]
[gitlab-protocol]
[vendor-dir] vendor (//vendor)
[bin-dir] {$vendor-dir}/bin (//vendor/bin)
[cache-dir] /home/appuser/.composer/cache
[data-dir] /home/appuser/.composer
[cache-files-dir] {$cache-dir}/files (/home/appuser/.composer/cache/files)
[cache-repo-dir] {$cache-dir}/repo (/home/appuser/.composer/cache/repo)
[cache-vcs-dir] {$cache-dir}/vcs (/home/appuser/.composer/cache/vcs)
[cache-ttl] 15552000
[cache-files-ttl] 15552000
[cache-files-maxsize] 300MiB (314572800)
[cache-read-only] false
[bin-compat] auto
[discard-changes] false
[autoloader-suffix]
[sort-packages] false
[optimize-autoloader] false
[classmap-authoritative] false
[apcu-autoloader] false
[prepend-autoloader] true
[github-domains] [github.com]
[bitbucket-expose-hostname] true
[disable-tls] false
[secure-http] true
[cafile]
[capath]
[github-expose-hostname] true
[gitlab-domains] [gitlab.com]
[store-auths] prompt
[archive-format] tar
[archive-dir] .
[htaccess-protect] true
[use-github-api] true
[lock] true
[platform-check] php-only
[home] /home/appuser/.composer'
[repositories.packagist.org.type] composer
[repositories.packagist.org.url] https://repo.packagist.org
[process-timeout] 300
[use-include-path] false
[use-parent-dir] prompt
[preferred-install] dist
[notify-on-install] true
[github-protocols] [https, ssh]
[gitlab-protocol]
[vendor-dir] vendor (//vendor)
[bin-dir] {$vendor-dir}/bin (//vendor/bin)
[cache-dir] /home/appuser/.composer/cache
[data-dir] /home/appuser/.composer
[cache-files-dir] {$cache-dir}/files (/home/appuser/.composer/cache/files)
[cache-repo-dir] {$cache-dir}/repo (/home/appuser/.composer/cache/repo)
[cache-vcs-dir] {$cache-dir}/vcs (/home/appuser/.composer/cache/vcs)
[cache-ttl] 15552000
[cache-files-ttl] 15552000
[cache-files-maxsize] 300MiB (314572800)
[cache-read-only] false
[bin-compat] auto
[discard-changes] false
[autoloader-suffix]
[sort-packages] false
[optimize-autoloader] false
[classmap-authoritative] false
[apcu-autoloader] false
[prepend-autoloader] true
[github-domains] [github.com]
[bitbucket-expose-hostname] true
[disable-tls] false
[secure-http] true
[cafile]
[capath]
[github-expose-hostname] true
[gitlab-domains] [gitlab.com]
[store-auths] prompt
[archive-format] tar
[archive-dir] .
[htaccess-protect] true
[use-github-api] true
[lock] true
[platform-check] php-only
[home] /home/appuser/.composer
+ composer config --global home
+ /bin/sh -c 'ls -l /home/appuser/.composer'
total 76
-rw-------    1 appuser  appgroup       142 Sep 22 12:14 auth.json
drwxr-sr-x    4 appuser  appgroup      4096 May 31 04:29 cache
-rw-r--r--    1 appuser  appgroup        62 May 31 04:29 composer.json
-rw-r--r--    1 appuser  appgroup     56938 May 31 04:29 composer.lock
-rw-------    1 appuser  appgroup        21 Sep 22 12:14 config.json
drwxr-sr-x    7 appuser  appgroup      4096 May 31 04:29 vendor
+ composer config --global home
+ /home/appuser/.composer/vendor/bin/phplint ./ '--exclude=vendor' --no-configuration --no-cache
phplint 9.0.4 by overtrue and contributors.

Runtime       : PHP 8.2.6
Configuration : No config file loaded

................................................................................................ 97 / 110 ( 88%)
..............

Time: 4 secs, Memory: 4.0 MiB, Cache: 0 hit, 110 misses


 [OK] 110 files

@llaville
Copy link
Collaborator

@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 😄

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 entrypoint.sh file that syntax was fixed in past by @overtrue !

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 ...

@craigh
Copy link
Author

craigh commented Sep 22, 2023

I'm not an expert of GitLab.

that makes two of us 😉

@llaville
Copy link
Collaborator

@craigh I've a BAD and GOOD news !

  • BAD first : I reproduced error on my local gitlab docker environment, but I don't know how to fix it by using docker image
  • GOOD new: I've a workaround that work like a charm under GitLab => uses the PHAR version

Here is an example of .gitlab-ci.yml that works !

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

@craigh
Copy link
Author

craigh commented Sep 27, 2023

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 overtrue/phplint:latest is faster than building a php image and then curling in a phar. Additionally, if I am just going to curl in a phar, I can do that in my original php image I am using in the pipeline. And even more, why not then simply add the lib to our dev req's and run it like the old way...

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

@llaville
Copy link
Collaborator

As I said above, I am not a gitlab expert, but I am guessing that utilizing a pre-built image like overtrue/phplint:latest is faster than building a php image and then curling in a phar.

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 overtrue/phplint:latest docker image.
I was not able to do it, but as I never let down, so I've found a workaround.

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.

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!

Thanks for your feedback. On my side I cannot do more things !

@llaville
Copy link
Collaborator

@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 :

  1. if it's a GitLab bug
  2. an issue coming from my fix to use docker image in rootless mode ([9.0.x] Docker usage may raise a permission denied  #182)

If you found an expert that may explain this situation, I'll be really happy !

Here is my try with .gitlab-ci.yml using docker image of phplint

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

phplintissues_-_jobs_88

@craigh
Copy link
Author

craigh commented Sep 28, 2023

Well, I get a new error with those changes:

Running with gitlab-runner 16.3.0~beta.108.g2b6048b4 (2b6048b4)
  on green-4.saas-linux-small-amd64.runners-manager.gitlab.com/default ntHFEtyX, system ID: s_8990de21c550
  feature flags: FF_USE_IMPROVED_URL_MASKING:true, FF_RESOLVE_FULL_TLS_CHAIN:false

Resolving secrets
00:00

Preparing the "docker+machine" executor
Using Docker executor with image overtrue/phplint:latest ...
Pulling docker image overtrue/phplint:latest ...
Using docker image sha256:5f8f6a623cc79c280baa62930eecabb2d6c0a2cda58688b0f945915952e9a64a for overtrue/phplint:latest with digest overtrue/phplint@sha256:191bdfb1d350c38a7d98014bdff83122103f5dcb4ae22552e4d1cb1df9de3d28 ...

Preparing environment
00:02
Running on runner-nthfetyx-project-15927696-concurrent-0 via runner-nthfetyx-s-l-s-amd64-1695901722-73d60ede...

Getting source from Git repository
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/clerkbase/onboard-app/.git/
Created fresh repository.
Checking out 5e717ecc as detached HEAD (ref is refs/merge-requests/1085/head)...
Skipping Git submodules setup
$ git remote set-url origin "${CI_REPOSITORY_URL}"

Restoring cache
Checking cache for 0_yarn-f6addb288c725b780b517883bd059972ea139036-non_protected...
Downloading cache from https://storage.googleapis.com/gitlab-com-runners-cache/project/15927696/0_yarn-f6addb288c725b780b517883bd059972ea139036-non_protected 
Successfully extracted cache
Checking cache for 1_composer-a8ad529844dfa83b63394e555c2df3a0969a2ad3-non_protected...
Downloading cache from https://storage.googleapis.com/gitlab-com-runners-cache/project/15927696/1_composer-a8ad529844dfa83b63394e555c2df3a0969a2ad3-non_protected 
Successfully extracted cache

Executing "step_script" stage of the job script
00:00
Using docker image sha256:5f8f6a623cc79c280baa62930eecabb2d6c0a2cda58688b0f945915952e9a64a for overtrue/phplint:latest with digest overtrue/phplint@sha256:191bdfb1d350c38a7d98014bdff83122103f5dcb4ae22552e4d1cb1df9de3d28 ...
$ composer install --no-scripts --no-progress --no-interaction --prefer-dist
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.
  Problem 1
    - Root composer.json requires PHP extension ext-xsl * but it is missing from your system. Install or enable PHP's xsl extension.
  Problem 2
    - lorenzo/pinky is locked to version 1.1.0 and an update of this package was not requested.
    - lorenzo/pinky 1.1.0 requires ext-xsl * -> it is missing from your system. Install or enable PHP's xsl extension.
  Problem 3
    - lorenzo/pinky 1.1.0 requires ext-xsl * -> it is missing from your system. Install or enable PHP's xsl extension.
    - twig/inky-extra v3.7.1 requires lorenzo/pinky ^1.0.5 -> satisfiable by lorenzo/pinky[1.1.0].
    - twig/inky-extra is locked to version v3.7.1 and an update of this package was not requested.
To enable extensions, verify that they are enabled in your .ini files:
    - /usr/local/etc/php/php.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-xsl` to temporarily ignore these required extensions.

Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 2

@llaville
Copy link
Collaborator

This problem is not related to our use case, but rather to your project.

Have a look on your console output

Executing "step_script" stage of the job script
00:00
Using docker image sha256:5f8f6a623cc79c280baa62930eecabb2d6c0a2cda58688b0f945915952e9a64a for overtrue/phplint:latest with digest overtrue/phplint@sha256:191bdfb1d350c38a7d98014bdff83122103f5dcb4ae22552e4d1cb1df9de3d28 ...
$ composer install --no-scripts --no-progress --no-interaction --prefer-dist
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.
  Problem 1
    - Root composer.json requires PHP extension ext-xsl * but it is missing from your system. Install or enable PHP's xsl extension.

You can check it with php -m on your script -> .gitlab-ci.yml entry, like that :

phplintissues_-_jobs_89

Extension xsl is not loaded, but PHPLint v9 works !

@craigh
Copy link
Author

craigh commented Sep 28, 2023

I don't think I understand. Is the phplint image running composer install in my repo? Why would it do that? Isn't phplint just statically linting my code? Why would it need my vendors? If so, shouldn't your php image include all possible modules just in case? Seems like mine wouldn't be the first repo to require xsl...

@llaville
Copy link
Collaborator

phplint did not run composer install or update.
so I suppose this instruction come from another step in your CI.

@llaville
Copy link
Collaborator

llaville commented Oct 2, 2023

Hello @overtrue
What do you think about this issue ?
I'd like to have your feedback.

@overtrue
Copy link
Owner

overtrue commented Oct 2, 2023

Hi @llaville @craigh

I see a problem from your communication:

Using docker image sha256:5f8f6a623cc79c280baa62930eecabb2d6c0a2cda58688b0f945915952e9a64a for overtrue/phplint:latest

Here it seems to be installed to an older version, I compared https://hub.docker.com/r/overtrue/phplint/tags and found that the latest sha256 is not the same, so does the following exist:

  1. gitlab runner is caching the docker image.
  2. a custom docker hub mirror is being used.

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, -x does not exist, which must be the result of installing an older version without this option.

BTW, if your project is PHP 8.2, it might help to set overtrue/phplint:8.2 to overtrue/phplint:8.1 instead of latest for the 8.1 mirror.

Looking forward to your feedback.

@llaville
Copy link
Collaborator

llaville commented Oct 3, 2023

Hi @llaville @craigh

Hi @overtrue

I see a problem from your communication:

Using docker image sha256:5f8f6a623cc79c280baa62930eecabb2d6c0a2cda58688b0f945915952e9a64a for overtrue/phplint:latest

Here it seems to be installed to an older version, I compared https://hub.docker.com/r/overtrue/phplint/tags and found that the latest sha256 is not the same, so does the following exist:

I disagree with you here because you don't check the right SHA256 !
You must read the second part, not the first one.

docker_image_sha256

If you compare digest, fingerprints are correct !

BTW, if your project is PHP 8.2, it might help to set overtrue/phplint:8.2 to overtrue/phplint:8.1 instead of latest for the 8.1 mirror.

It was a good idea. Thanks :)

Trying with this .gitlab-ci.yml contents :

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 :

docker_image_81

First approach to search on a better way. Thanks again @overtrue for your share.

BTW, as docker images overtrue/phplint:8.1 (v5) and overtrue/phplint:8.2 (v6) are not supposed to be maintained in future (at least by me) I don't recommand to use it.

I'll try to see what was wrong with v9, but I'm pretty sure not this is due to the Docker rootless solution.

@llaville
Copy link
Collaborator

llaville commented Oct 3, 2023

Good news, I've found origin that raise "-x" option does not exist.

Need more time to make more tests (especially non regression on other platforms), but a 9.0.5 should be publish sooner

@llaville
Copy link
Collaborator

llaville commented Oct 4, 2023

NOTE

This issue affect only PHPLint v9 (overtrue/phplint:latest docker image).
Other versions (v6 => overtrue/phplint:8.2, v5 => overtrue/phplint:8.1) are not impacted

@llaville
Copy link
Collaborator

llaville commented Oct 4, 2023

@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.
On my side (locally with GitLab CE and gitlab-runner 16.4.0 (4e724e03) -- docker executor) I've found any new issues !

@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

  • Docker image overtrue/phplint:rc Digest:sha256:32d94022491641aa9f7d0f526aec3bd3fdbd3f1c889c02cd7d80e899d93a14d5 run fine with GitLab and Locally usage

  • GitHub usage is still under heavy regression tests

@llaville
Copy link
Collaborator

llaville commented Oct 4, 2023

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.

@overtrue
Copy link
Owner

overtrue commented Oct 5, 2023

@craigh please take a try, Thanks

@llaville
Copy link
Collaborator

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
Copy link

thakilla commented Oct 2, 2024

Hi there,

Getting the same "-x" error when adding it to our gitlab pipeline, using the latest image. I tested your "rc" docker image, which seems to work fine 👍

screenshot

Any chance to get this fix merged into upcoming/latest versions?

@llaville llaville reopened this Oct 7, 2024
@llaville
Copy link
Collaborator

llaville commented Oct 7, 2024

@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.

llaville added a commit that referenced this issue Oct 7, 2024
@llaville
Copy link
Collaborator

llaville commented Oct 7, 2024

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

 ===[ test: phplint (ghcr.io/llaville/phplint:latest, docker) ]===

  RUN  '/usr/local/bin/php' '-d error_reporting=E_ALL' '-d display_errors=On' '-d memory_limit=-1' '-l' '/builds/phplint/src/Console/Application.php' '/builds/phplint/tests/fixtures/syntax_error.php' '/builds/phplint/tests/fixtures/syntax_warning.php'
  OUT  No syntax errors detected in /builds/phplint/src/Console/Application.php
  ERR  PHP Parse error:  syntax error, unexpected end of file in /builds/phplint/tests/fixtures/syntax_error.php on line 4
  OUT  Parse error: syntax error, unexpected end of file in /builds/phplint/tests/fixtures/syntax_error.php on line 4

  OUT  Errors parsing /builds/phplint/tests/fixtures/syntax_error.php
  OUT  Warning: declare(encoding=...) ignored because Zend multibyte feature is turned off by settings in /builds/phplint/tests/fixtures/syntax_warning.php on line 12

  OUT  No syntax errors detected in /builds/phplint/tests/fixtures/syntax_warning.php
  ERR  PHP Warning:  declare(encoding=...) ignored because Zend multibyte feature is turned off by settings in /builds/phplint/tests/fixtures/syntax_warning.php on line 12

  RES  255 Command did not run successfully
[  OK  ] src/Console/Application.php                                 1 / 107 (  0%)
[ ERR  ] tests/fixtures/syntax_error.php                             2 / 107 (  1%)
[ WARN ] tests/fixtures/syntax_warning.php                           3 / 107 (  2%)

phplint 9.5.0-dev by overtrue and contributors.

Runtime       : PHP 8.3.12
Configuration : /builds/phplint/.phplint.yml

┌──────────────────┬──────────────────┐
│ Name             │ Value            │
├──────────────────┼──────────────────┤
│ path             │ ["./"]           │
├──────────────────┼──────────────────┤
│ configuration    │ ".phplint.yml"   │
│ no-configuration │ false            │
│ exclude          │ ["vendor"]       │
│ extensions       │ ["php"]          │
│ jobs             │ 10               │
│ no-cache         │ false            │
│ cache            │ ".phplint.cache" │
│ no-progress      │ false            │
│ progress         │ "printer"        │
│ output           │ null             │
│ format           │ ["console"]      │
│ warning          │ true             │
│ memory-limit     │ -1               │
│ ignore-exit-code │ false            │
│ bootstrap        │ ""               │
└──────────────────┴──────────────────┘


Time: 2 secs, Memory: 4.0 MiB, Cache: 104 hits, 3 misses, Process: 1

 [ERROR] 107 files, 2 errors


There was 2 errors:
1. /builds/phplint/tests/fixtures/syntax_error.php:4
    1| <?php
    2|
    3| print($a)

 unexpected end of file in line 4
2. /builds/phplint/tests/fixtures/syntax_warning.php:12
     9|  * with this source code in the file LICENSE.
    10|  */
    11|
  > 12| declare(encoding="utf8");

  declare(encoding=...) ignored because Zend multibyte feature is turned off by settings in line 12

  ‣ phplint: Failure in 4 seconds

@llaville
Copy link
Collaborator

llaville commented Oct 7, 2024

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.

@llaville
Copy link
Collaborator

llaville commented Oct 7, 2024

@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
Are you agree ?

@overtrue
Copy link
Owner

overtrue commented Oct 7, 2024

@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

Are you agree ?

👌

@llaville
Copy link
Collaborator

llaville commented Oct 7, 2024

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
Copy link

thakilla commented Oct 7, 2024

Awesome, thanks for your time / effort.

I tested it in a php 8.2 and 8.3 project. Gitlab Version v17.3.3-ee.
No problems so far 👍

Bildschirmfoto 2024-10-07 um 19 47 38
Bildschirmfoto 2024-10-07 um 20 03 17

@llaville
Copy link
Collaborator

llaville commented Oct 8, 2024

@thakilla Thanks for your quick answer (I appreciate a lot !)

Version 9.5.0 is on way and will be released very soon now.

@llaville
Copy link
Collaborator

llaville commented Oct 8, 2024

Release 9.5.2 is available.

Same as 9.5.0 but with internal GitHub Workflows fixed (due to PHP 8.1 support dropped).

@llaville llaville closed this as completed Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants