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

Unable to install the pdo_firebird extension on arm64 (Alpine Linux) #465

Open
rdrenth opened this issue Nov 25, 2021 · 11 comments · May be fixed by #496
Open

Unable to install the pdo_firebird extension on arm64 (Alpine Linux) #465

rdrenth opened this issue Nov 25, 2021 · 11 comments · May be fixed by #496
Labels
waiting for external maintainer We are waiting for the maintainer of a 3rd party tool

Comments

@rdrenth
Copy link

rdrenth commented Nov 25, 2021

Running the command install-php-extensions pdo_firebird fails on aarch64 / arm64 architecture and distro alpine with php version 7.4

The full output of this is:

 > [5/5] RUN chmod +x /usr/local/bin/install-php-extensions &&     install-php-extensions pdo_firebird:
#8 0.187 install-php-extensions v.1.4.2
#8 1.343 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/aarch64/APKINDEX.tar.gz
#8 1.764 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/aarch64/APKINDEX.tar.gz
#8 2.067 fetch https://dl-4.alpinelinux.org/alpine/v3.11/community/aarch64/APKINDEX.tar.gz
#8 2.480 OK: 275 MiB in 154 packages
#8 3.451 ### INSTALLING REQUIRED PACKAGES ###
#8 3.451 # Packages to be kept after installation:
#8 3.451 # Packages to be used only for installation: m4 perl autoconf dpkg dpkg-dev libmagic file binutils libatomic libgphobos isl22 mpfr4 mpc1 gcc musl-dev libc-dev g++ perl-error perl-git git-perl icu icu-dev make ncurses-dev re2c
#8 3.595 (1/25) Installing m4 (1.4.18-r2)
#8 3.728 (2/25) Installing perl (5.32.1-r0)
#8 4.060 (3/25) Installing autoconf (2.71-r0)
#8 4.102 (4/25) Installing binutils (2.35.2-r2)
#8 4.200 (5/25) Installing dpkg (1.20.9-r0)
#8 4.240 (6/25) Installing dpkg-dev (1.20.9-r0)
#8 4.283 (7/25) Installing libmagic (5.40-r1)
#8 4.326 (8/25) Installing file (5.40-r1)
#8 4.346 (9/25) Installing libatomic (10.3.1_git20210424-r2)
#8 4.374 (10/25) Installing libgphobos (10.3.1_git20210424-r2)
#8 4.452 (11/25) Installing isl22 (0.22-r0)
#8 4.500 (12/25) Installing mpfr4 (4.1.0-r0)
#8 4.530 (13/25) Installing mpc1 (1.2.1-r0)
#8 4.554 (14/25) Installing gcc (10.3.1_git20210424-r2)
#8 5.341 (15/25) Installing musl-dev (1.2.2-r3)
#8 5.451 (16/25) Installing libc-dev (0.7.2-r3)
#8 5.468 (17/25) Installing g++ (10.3.1_git20210424-r2)
#8 6.008 (18/25) Installing perl-error (0.17029-r1)
#8 6.030 (19/25) Installing perl-git (2.32.0-r0)
#8 6.057 (20/25) Installing git-perl (2.32.0-r0)
#8 6.078 (21/25) Installing icu (67.1-r2)
#8 6.110 (22/25) Installing icu-dev (67.1-r2)
#8 6.169 (23/25) Installing make (4.3-r0)
#8 6.194 (24/25) Installing ncurses-dev (6.2_p20210612-r0)
#8 6.220 (25/25) Installing re2c (2.1.1-r0)
#8 6.256 Executing busybox-1.33.1-r6.trigger
#8 6.265 OK: 511 MiB in 179 packages
#8 6.458 OK: 511 MiB in 179 packages
#8 6.476 ### INSTALLING BUNDLED MODULE pdo_firebird ###
#8 9.605 checking whether make sets $(MAKE)... yes
#8 9.614 checking build system type... builds/make.new/config/config.guess: unable to guess system type
#8 9.688
#8 9.688 This script, last modified 2005-12-23, has failed to recognize
#8 9.688 the operating system you are using. It is advised that you
#8 9.688 download the most up to date version of the config scripts from
#8 9.688
#8 9.688   http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
#8 9.688 and
#8 9.688   http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
#8 9.688
#8 9.688 If the version you run (builds/make.new/config/config.guess) is already up to date, please
#8 9.688 send the following data and any information you think might be
#8 9.688 pertinent to <[email protected]> in order to provide the needed
#8 9.688 information to handle your system.
#8 9.688
#8 9.688 config.guess timestamp = 2005-12-23
#8 9.688
#8 9.688 uname -m = aarch64
#8 9.688 uname -r = 5.10.47-linuxkit
#8 9.688 uname -s = Linux
#8 9.688 uname -v = #1 SMP PREEMPT Sat Jul 3 21:50:16 UTC 2021
#8 9.688
#8 9.688 /usr/bin/uname -p =
#8 9.688 /bin/uname -X     =
#8 9.688
#8 9.688 hostinfo               =
#8 9.688 /bin/universe          =
#8 9.688 /usr/bin/arch -k       =
#8 9.688 /bin/arch              = aarch64
#8 9.688 /usr/bin/oslevel       =
#8 9.688 /usr/convex/getsysinfo =
#8 9.688
#8 9.688 UNAME_MACHINE = aarch64
#8 9.688 UNAME_RELEASE = 5.10.47-linuxkit
#8 9.688 UNAME_SYSTEM  = Linux
#8 9.688 UNAME_VERSION = #1 SMP PREEMPT Sat Jul 3 21:50:16 UTC 2021
#8 9.690 configure: error: cannot guess build type; you must specify one

Any idea if this can be made so it works on arm64 aswell?

@mlocati
Copy link
Owner

mlocati commented Jan 10, 2022

I don't have an arm64 device at hand.
Could you tell me when this error occurs?
In order to know that, you can mimic what the install-php-extension script does: that is, could you run these commands and tell me which one fails?

apk update

apk add $PHPIZE_DEPS icu-dev ncurses-dev

curl -sSLf https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2 | tar xj -C /tmp

cd /tmp/Firebird-2.5.9.27139-0

sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h

./configure --with-system-icu

make -s btyacc_binary gpre_boot libfbstatic libfbclient

cp gen/firebird/lib/libfbclient.so /usr/lib/

ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2

cd - >/dev/null

CFLAGS='-I/tmp/Firebird-2.5.9.27139-0/src/jrd -I/tmp/Firebird-2.5.9.27139-0/src/include -I/tmp/Firebird-2.5.9.27139-0/src/include/gen' docker-php-ext-configure pdo_firebird

docker-php-ext-install pdo_firebird

@mlocati mlocati added the waiting for feedback Waiting for user feedback label Jan 10, 2022
@rdrenth
Copy link
Author

rdrenth commented Jan 11, 2022

Thanks already for taking the time to look at this.

I've executed the commands 1 by 1 using the php:7.4-alpine image and the command that fails is ./configure --with-system-icu.

The output of that is pretty much the same as above:

checking whether make sets $(MAKE)... yes
checking build system type... builds/make.new/config/config.guess: unable to guess system type

This script, last modified 2005-12-23, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
and
  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub

If the version you run (builds/make.new/config/config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <[email protected]> in order to provide the needed
information to handle your system.

config.guess timestamp = 2005-12-23

uname -m = aarch64
uname -r = 5.10.76-linuxkit
uname -s = Linux
uname -v = #1 SMP PREEMPT Mon Nov 8 11:22:26 UTC 2021

/usr/bin/uname -p =
/bin/uname -X     =

hostinfo               =
/bin/universe          =
/usr/bin/arch -k       =
/bin/arch              = aarch64
/usr/bin/oslevel       =
/usr/convex/getsysinfo =

UNAME_MACHINE = aarch64
UNAME_RELEASE = 5.10.76-linuxkit
UNAME_SYSTEM  = Linux
UNAME_VERSION = #1 SMP PREEMPT Mon Nov 8 11:22:26 UTC 2021
configure: error: cannot guess build type; you must specify one

I'm not sure this can be fixed with the 2.5.9 version, as I don't see the used asset in amd64 version, only for CS and SS there are amd64 versions at: https://github.com/FirebirdSQL/firebird/releases/tag/R2_5_9

@mlocati mlocati removed the waiting for feedback Waiting for user feedback label Jan 11, 2022
@mlocati
Copy link
Owner

mlocati commented Jan 11, 2022

#496 could probably fix this issue.
@rdrenth could you check that in your arm device?

It should be as easy as running:

curl -fLo install-php-extensions https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/f5ca99772104a792888dcf5d526d5e29afd4acd4/install-php-extensions
chmod +x install-php-extensions
export CI=1
./install-php-extensions pdo_firebird

@mlocati mlocati added the waiting for feedback Waiting for user feedback label Jan 11, 2022
@rdrenth
Copy link
Author

rdrenth commented Jan 12, 2022

I've executed the commands as provided, but the result is pretty much the same.

### INSTALLING BUNDLED MODULE pdo_firebird ###
Downloading and compiling Firebird v3.0.8
checking whether make sets $(MAKE)... yes
checking build system type... builds/make.new/config/config.guess: unable to guess system type

This script, last modified 2010-08-21, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

If the version you run (builds/make.new/config/config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <[email protected]> in order to provide the needed
information to handle your system.

config.guess timestamp = 2010-08-21

uname -m = aarch64
uname -r = 5.10.76-linuxkit
uname -s = Linux
uname -v = #1 SMP PREEMPT Mon Nov 8 11:22:26 UTC 2021

/usr/bin/uname -p =
/bin/uname -X     =

hostinfo               =
/bin/universe          =
/usr/bin/arch -k       =
/bin/arch              = aarch64
/usr/bin/oslevel       =
/usr/convex/getsysinfo =

UNAME_MACHINE = aarch64
UNAME_RELEASE = 5.10.76-linuxkit
UNAME_SYSTEM  = Linux
UNAME_VERSION = #1 SMP PREEMPT Mon Nov 8 11:22:26 UTC 2021
configure: error: cannot guess build type; you must specify one

@mlocati
Copy link
Owner

mlocati commented Jan 12, 2022

It seems that aarch64 isn't supported by firebird 3.

I tried to compile firebird 4 on Alpine Linux v3.15.
The configure command succeeds (and it should succeed for you too since it comes with a more recent version of config.guess that supports aarch64), but the compilation fails with this error:

can't format message 17:3 -- message file /tmp/src/firebird/gen/Release/firebird/firebird.msg not found
g++ -I/tmp/src/firebird/src/include/gen -I/tmp/src/firebird/src/include -I/tmp/src/firebird/extern/re2   -I/tmp/src/firebird/extern/libtommath -I/tmp/src/firebird/extern/libtomcrypt/src/headers -ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -DAMD64 -pipe -MMD -fPIC -fmessage-length=0 -O3 -fno-omit-frame-pointer -fno-rtti -std=c++11 -Wno-invalid-offsetof -Wno-class-memaccess    -c /tmp/src/firebird/temp/Release/gpre/std/gpre_meta.cpp -o /tmp/src/firebird/temp/Release/gpre/std/gpre_meta.o
can't format message 17:0 -- message file /tmp/src/firebird/gen/Release/firebird/firebird.msg not found
Could not find acceptable ICU library
-Missing entrypoint ucnv_open in ICU library
-Error loading ICU library version 69.0
can't format message 17:120 -- message file /tmp/src/firebird/gen/Release/firebird/firebird.msg not found
can't format message 17:0 -- message file /tmp/src/firebird/gen/Release/firebird/firebird.msg not found
Could not find acceptable ICU library
-Missing entrypoint ucnv_open in ICU library
-Error loading ICU library version 69.0
make[3]: *** [Makefile:441: metadata.fdb] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:470: msg.timestamp] Error 1
can't format message 17:0 -- message file /tmp/src/firebird/gen/Release/firebird/firebird.msg not found
Could not find acceptable ICU library
-Missing entrypoint ucnv_open in ICU library
-Error loading ICU library version 69.0
make[3]: *** [Makefile:461: security.fdb] Error 1
can't format message 12:256 -- message file /tmp/src/firebird/gen/Release/firebird/firebird.msg not foundCould not find acceptable ICU library
can't format message 12:256 -- message file /tmp/src/firebird/gen/Release/firebird/firebird.msg not found    Missing entrypoint ucnv_open in ICU library
can't format message 12:256 -- message file /tmp/src/firebird/gen/Release/firebird/firebird.msg not found    Error loading ICU library version 69.0
can't format message 12:256 -- message file /tmp/src/firebird/gen/Release/firebird/firebird.msg not foundcan't format message 12:33 -- message file /tmp/src/firebird/gen/Release/firebird/firebird.msg not found
can't format message 12:169 -- message file /tmp/src/firebird/gen/Release/firebird/firebird.msg not foundcan't format message 12:83 -- message file /tmp/src/firebird/gen/Release/firebird/firebird.msg not found
make[3]: *** [Makefile:451: help.fdb] Error 1
make[3]: Leaving directory '/tmp/src/firebird/gen'
make[2]: *** [Makefile:292: master_process] Error 2
make[2]: Leaving directory '/tmp/src/firebird/gen'
make[1]: *** [Makefile:91: firebird] Error 2
make[1]: Leaving directory '/tmp/src/firebird/gen'
make: *** [Makefile:6: firebird] Error 2

(even if the script installs icu-libs 69.1-r1, icu (69.1-r1 and icu-dev 69.1-r1)

We should report these issues to the Firebird maintainers...

@rdrenth
Copy link
Author

rdrenth commented Jan 17, 2022

It seems there is some work being done in this PR regarding M1 support: FirebirdSQL/firebird#7073

@rdrenth
Copy link
Author

rdrenth commented Feb 14, 2022

Looks like Firebird v4.0.2 will add support for it, but it's not yet released: FirebirdSQL/firebird#7041 (comment)

@mlocati mlocati added waiting for external maintainer We are waiting for the maintainer of a 3rd party tool and removed waiting for feedback Waiting for user feedback labels Feb 17, 2022
@rdrenth
Copy link
Author

rdrenth commented Sep 16, 2022

@mlocati Firebird v4.0.2 is finally released: https://github.com/FirebirdSQL/firebird/releases/tag/v4.0.2 and it comes with "Firebird port for Apple M1 architecture".

Can we attempt to make this work? If you need me to test / try anything, let me know. Thanks!

@mlocati mlocati changed the title Unable to install the pdo_firebird extension on arm64 Unable to install the pdo_firebird extension on arm66 (Alpine Linux) Sep 16, 2022
@mlocati mlocati changed the title Unable to install the pdo_firebird extension on arm66 (Alpine Linux) Unable to install the pdo_firebird extension on arm64 (Alpine Linux) Sep 16, 2022
@mlocati
Copy link
Owner

mlocati commented Sep 16, 2022

@rdrenth I've just tried to build firebird 4.0.2 on Alpine, without luck:

$ mkdir -p /tmp/src
$ cd /tmp/src
$ curl -sSL -o - \
    https://github.com/FirebirdSQL/firebird/releases/download/v4.0.2/Firebird-4.0.2.2816-0.i686.tar.gz \
    | tar xz
$ cd Firebird-4.0.2.2816-0.i686
$ ./install.sh -silent

ps: unrecognized option: w
BusyBox v1.35.0 (2022-08-01 15:14:44 UTC) multi-call binary.

Usage: ps [-o COL1,COL2=HEADER] [-T]

Show list of processes

        -o COL1,COL2=HEADER     Select columns for display
        -T                      Show threads

[omissis, repeated 7 times ]

Please install required library 'tommath' before firebird, after it repeat firebird install

So, we have two problems here:

  1. the firebird install script doesn't seem compatible with Alpine Linux
  2. installing firebird 4 requires the tommath system library, which isn't available on Alpine

@rdrenth
Copy link
Author

rdrenth commented Sep 19, 2022

Thanks for your continued effort with this issue, I'd say we're kind of out of options to make this work and we should close the issue.

@mlocati
Copy link
Owner

mlocati commented Sep 19, 2022

If you need it, you should file an issue at https://github.com/FirebirdSQL/firebird/issues to ask them to support Alpine Linux...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for external maintainer We are waiting for the maintainer of a 3rd party tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants