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

ext-pdo_sqlite is not really installable #121

Open
Ocramius opened this issue Aug 16, 2022 · 12 comments
Open

ext-pdo_sqlite is not really installable #121

Ocramius opened this issue Aug 16, 2022 · 12 comments
Labels
Bug Something isn't working

Comments

@Ocramius
Copy link
Member

Bug Report

Q A
Version(s) 1.13.0

Summary

Given following composer.json:

{
    "require": {
        "php": "~8.1.0",
        "ext-pdo_sqlite": "*"
    }
}

CI fails with:


Run laminas/laminas-continuous-integration-action@v1
/usr/bin/docker run --name ghcriolaminaslaminascontinuousintegration1_e9f03a --label 94859b --workdir /github/workspace --rm -e INPUT_JOB -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/event-sourcing-workshop/event-sourcing-workshop":"/github/workspace" ghcr.io/laminas/laminas-continuous-integration:1  "{\"command\":\"./vendor/bin/phpcs -q --report=checkstyle | cs2pr\",\"php\":\"8.1\",\"extensions\":[\"pdo_sqlite\",\"sqlite3\"],\"ini\":[],\"dependencies\":\"locked\",\"ignore_platform_reqs_8\":false,\"ignore_php_platform_requirement\":false,\"additional_composer_arguments\":[]}"
Received job: {"command":"./vendor/bin/phpcs -q --report=checkstyle | cs2pr","php":"8.1","extensions":["pdo_sqlite","sqlite3"],"ini":[],"dependencies":"locked","ignore_platform_reqs_8":false,"ignore_php_platform_requirement":false,"additional_composer_arguments":[]}
Marking PHP 8.1 as configured default
Cloning repository
Cloning into '.'...
Checking out ref feature/working-prototype
Switched to a new branch 'feature/working-prototype'
Branch 'feature/working-prototype' set up to track remote branch 'feature/working-prototype' from 'origin'.
Installing packaged extensions: php8.1-pdo_sqlite php8.1-sqlite3 

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Get:1 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease [10.5 kB]
Get:2 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease [23.9 kB]
Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:4 http://archive.ubuntu.com/ubuntu focal InRelease
Get:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:6 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 Packages [203 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:8 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 Packages [175 kB]
Get:9 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [2087 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2542 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [1571 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1176 kB]
Get:13 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [888 kB]
Fetched 9012 kB in 3s (2992 kB/s)
Reading package lists...
Building dependency tree...
Reading state information...
30 packages can be upgraded. Run 'apt list --upgradable' to see them.

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package php8.1-pdo_sqlite

This is obviously an edge case, but even specifying extensions in .laminas-ci.json doesn't help, as the default behavior still stays active

@Ocramius Ocramius added the Bug Something isn't working label Aug 16, 2022
@boesing
Copy link
Member

boesing commented Aug 16, 2022

I remember that I somewhere had some kind of mapping for these cases... 🤔

@boesing
Copy link
Member

boesing commented Aug 16, 2022

https://github.com/laminas/laminas-continuous-integration-action/blob/9376275b657d69ec7bbe72fb4b94b88e4724a42f/scripts/extensions.sh#L53

That was somehow removed but only relates to sqlsrv and not to sqlite.
Does that extension actually exist or should it be ext-sqlite instead in combination with ext-pdo?

@Ocramius
Copy link
Member Author

In composer, ext-pdo_sqlite means "PDO with Sqlite driver", which is kinda weird :|

@boesing
Copy link
Member

boesing commented Aug 16, 2022

Mh, could you try to actually add pdo + sqlite to your .laminas-ci.json in the extensions list?
Afaik, sury provides some magic to actually deliver these via dedicated packages.

@Ocramius
Copy link
Member Author

I tried adding pdo and sqlite3 (sqlite doesn't exist)

@boesing
Copy link
Member

boesing commented Aug 16, 2022

Does that work or is the sqlite plugin for pdo missing afterwards? 🤔

@Ocramius
Copy link
Member Author

When installing sqlite3, PDO also gets PDO-Sqlite 🤷

@boesing
Copy link
Member

boesing commented Aug 16, 2022

That was what I was expecting.

So maybe we should add some kind of "rules" for this.
Something like:

  • parse extensions with pdo_(.*)
  • if exists, add pdo to the extensions list we do provide to the container
  • add special handlings for sqlite (so require sqlite3)
  • ignore those without special handlings

This will at least avoid the CI container from failing. Is there a list of all these pdo_* combinations?

@boesing
Copy link
Member

boesing commented Aug 16, 2022

@Ocramius
Copy link
Member Author

Consider that it's not in the required dependencies though: https://github.com/laminas/laminas-db/blob/da6d5a49ac4f200da61b3a59096bf2717fbaf928/composer.json#L33-L43

@boesing
Copy link
Member

boesing commented Aug 16, 2022

Correct, I just try to find solutions here.
I don't care if its the requirement of a package - if packages do not explicitly require extensions but provide some via .laminas-ci.json, that would be fine for me.

Imho, the container should convert extensions to the appropriate namings of the packages. As of now, we are lucky that sury usually names packages exactly the same as they're named in PECL. Sadly, thats not the case for those pdo_* extensions.
So we should rename it within the container like:

if (string_starts_with($extension, 'pdo_')) {
    $extension = str_replace('_', '-', $extension);
}

Do we have other ideas or should we create a bug ticket within the container action?

@Ocramius
Copy link
Member Author

Totally missed this again, sorry. In practice, I ended up moving away from the laminas CI setup in https://github.com/Ocramius/event-sourcing-workshop/ for now.

That said, I think we may need an explicit map of require to PECL/APT packages here: there is no clear rule on what needs to be installed.

For instance, installing Sqlite3 + PDO means having ext-pdo_sqlite 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants