ddev / ddev-contrib

Contrib space for DDEV services, tools, snippets, and approaches.
Apache License 2.0
162 stars 162 forks source link

feat ref #223: fixes the error installing sqlsrv #224

Open robertoperuzzo opened 1 year ago

robertoperuzzo commented 1 year ago

Fixes issue #223:

The New Solution/Problem/Issue/Bug:

Using the previous Dockerfile I get the following error

❯ ddev debug refresh
failed to solve: executor failed running [/bin/sh -c pecl -d php_suffix=8.1 install sqlsrv]: exit code: 1
...
...
...
#22 18.22 /bin/sed: can't read /usr/lib/x86_64-linux-gnu/libltdl.la: No such file or directory
#22 18.22 libtool:   error: '/usr/lib/x86_64-linux-gnu/libltdl.la' is not a valid libtool archive
#22 18.22 make: *** [Makefile:250: sqlsrv.la] Error 1
#22 18.23 ERROR: `make' failed
...
...

It seems something related to version 2.3.11 of unixodbc.

How this PR Solves The Problem:

Forcing the unixodbc version 2.3.7

Manual Testing Instructions:

  1. Copy the Dockerfile in .ddev/web-build/
  2. run ddev php --info | grep pdo_sqlsrv

You should get

/etc/php/8.1/cli/conf.d/20-pdo_sqlsrv.ini,
pdo_sqlsrv
pdo_sqlsrv support => enabled
pdo_sqlsrv.client_buffer_max_kb_size => 10240 => 10240
pdo_sqlsrv.log_severity => 0 => 0
pdo_sqlsrv.report_additional_errors => 1 => 1
pdo_sqlsrv.set_locale_info => 2 => 2

Related Issue Link(s):

rfay commented 1 year ago

I haven't manually tested, but hope @drupal-daffie will take a look

rfay commented 1 year ago

Actually, what I'd love to have you do is turn this into a ddev-get add-on and then maintain it, so we wouldn't find out things like this by accident. https://ddev.readthedocs.io/en/latest/users/extend/additional-services/#creating-an-additional-service-for-ddev-get

Would you consider doing that?

robertoperuzzo commented 1 year ago

Actually, what I'd love to have you do is turn this into a ddev-get add-on and then maintain it, so we wouldn't find out things like this by accident. https://ddev.readthedocs.io/en/latest/users/extend/additional-services/#creating-an-additional-service-for-ddev-get

Would you consider doing that?

It sounds good. I'm going to read the add-on documentation and try do create the new add-on.

robertoperuzzo commented 1 year ago

@rfay I created this repo for the ddev add-on https://github.com/robertoperuzzo/ddev-sqlsrv

robertoperuzzo commented 1 year ago

@rfay I created this repo for the ddev add-on https://github.com/robertoperuzzo/ddev-sqlsrv

I have to fix the README and the tests.

rfay commented 1 year ago

Awesome!

You'll probably want to change this PR to a "Go to the maintained add-on instead" notice.

rfay commented 11 months ago

Let's get this in and please just add a reference to your maintained add-on. Thanks so much!

robertoperuzzo commented 11 months ago

Let's get this in and please just add a reference to your maintained add-on. Thanks so much!

I'm sorry but I didn't understand what _"add a reference to your maintained add-on"_ means.

rfay commented 11 months ago

Just update ddev-contrib here to point to ddev/ddev-sqlsrv and point out that the existing recipe here isn't the authoritative one any more.

drupal-daffie commented 11 months ago

I have not test the code, but all the changes look good to me. The PHP specific version stuff was a real pain in the ass.