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

fix: provide sqlite 3.45 for drupal11, fixes #6110 #6137

Merged
merged 2 commits into from May 1, 2024

Conversation

rfay
Copy link
Member

@rfay rfay commented Apr 28, 2024

The Issue

Drupal 11 added an arbitrary sqlite3 version constraint that is hard to meet with Debian Bookworm

How This PR Solves The Issue

Install it using debs from Debian 13 Trixie

Manual Testing Instructions

  • Install drupal 11 site
  • ddev exec sqlite3 --version should show 3.45.1

Automated Testing Overview

It's a sad location, but I added a test in TestDdevFullSiteSetup for drupal 11 that is specific to this case. I'm open to better suggestions. It could have its own test, but that seemed even worse.

Related Issue Link(s)

@github-actions github-actions bot added bugfix dependencies Pull requests that update a dependency file labels Apr 28, 2024
@rpkoller
Copy link
Collaborator

works. quickly followed the quickstart for d11

ddev config (manually entered using web and drupal) 
ddev composer create drupal/recommended-project:11.x-dev@dev
ddev config --update
ddev restart
ddev . sqlite3 --version
3.45.1 2024-01-30 16:01:20 e876e51a0ed5c5b3126f52e532044363a014bc594cfefa87ffb5b82257ccalt1 (64-bit)

and .ddev/.webimagebuild/dockerfile contains:

### Drupal 11+ requires a miniumum sqlite3 version (3.45 currently)
ARG TARGETPLATFORM
ENV SQLITE_VERSION=3.45.1
RUN mkdir -p /tmp/sqlite3 && \
wget -O /tmp/sqlite3/sqlite3.deb https://ftp.debian.org/debian/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETPLATFORM##linux/}.deb && \
wget -O /tmp/sqlite3/libsqlite3.deb https://ftp.debian.org/debian/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETPLATFORM##linux/}.deb && \
apt install -y /tmp/sqlite3/*.deb && \
rm -rf /tmp/sqlite3

on line 24 to 31. so looks good.

@rfay rfay marked this pull request as ready for review April 29, 2024 14:11
@rfay rfay requested a review from a team as a code owner April 29, 2024 14:11
@rfay rfay requested a review from stasadev April 29, 2024 14:11
@penyaskito
Copy link
Member

Have been reading the discussions and It's quite unfortunate d11 picked that version. Specially since we will need to track any security advisory in sqlite, as updating that one becomes manual with this PR.

drupalVersion, err := GetDrupalVersion(app)
if err == nil && drupalVersion == "11" {
extraWebContent = extraWebContent + "\n" + fmt.Sprintf(`
### Drupal 11+ requires a miniumum sqlite3 version (3.45 currently)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks as clean as it can be 🥇

// for setting requirements.
// It can only work if there is configured Drupal8+ code
func getDrupalVersion(app *DdevApp) (string, error) {
func GetDrupalVersion(app *DdevApp) (string, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if exposing this is "irreversible" now. Not sure if we have a "public" api. Even if we know this works, wondering if that implies requiring more specific tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just globally available.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, wondering if we have a "ddev as a library" contract where anything that is exposed won't be hidden/renamed later and we consider it public api.

E.g. in https://github.com/ddev/ddev/pull/6118/files (as go doesn't have optional args), I thought maybe could be better to just change the signature and require the "optional" defaultTo flag.

This might become more relevant if we decide to build a TUI wrapping ddev instead of replacing our current ddev app.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never been ambitious enough to worry about that. In this case of a TUI, it would not really be a wrapper I wouldn't think, but integrated into DDEV. Not sure.

Copy link
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, all good 👍

pkg/ddevapp/config.go Outdated Show resolved Hide resolved
rfay and others added 2 commits May 1, 2024 11:10
Co-authored-by: Stanislav Zhuk <stasadev@gmail.com>
@rfay rfay merged commit a96ab26 into ddev:master May 1, 2024
9 checks passed
@rfay rfay deleted the 20240428_sqlite_3_45 branch May 1, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants