Open padiazg opened 6 years ago
Handled to compile in a Docker/Alpine container. Here is my github repo: https://github.com/padiazg/harbour-alpine
There is two files that had to modify, because of dependencies:
arc4.c: comiler complains about sysctl, after searching a lot found some info and decide to coment line 53. Please somebody tell me if this is correct, or what would be the right approach.
mysql.c: Alpine lacks mysql packages, so I used MariaDB, but there is a constant named MYSQL_PORT, so I added this to solve it.
#if !defined(MYSQL_PORT )
#if defined( MARIADB_PORT )
#define MYSQL_PORT MARIADB_PORT
#endif
#endif
In the examples
folder there are two tests, bmmysql
works without a problem, but sddmy
that used RDD fails with segmentation fault.
Working on test some other functionalities that are of my interest, postgres and CGI for example.
Some further comments on arc4.c problem: https://github.com/harbour/core/pull/180
Possible patch:
--- a/src/rtl/arc4.c
+++ b/src/rtl/arc4.c
@@ -50,7 +50,9 @@
/* XXX: Check and possibly extend this to other Unix-like platforms */
#if ( defined( HB_OS_BSD ) && ! defined( HB_OS_DARWIN ) ) || \
( defined( HB_OS_LINUX ) && ! defined ( HB_OS_ANDROID ) && ! defined ( __WATCOMC__ ) )
-# define HAVE_SYS_SYSCTL_H
+# if ( ! defined( HB_OS_LINUX ) || ( defined( __GLIBC__ ) || defined( __UCLIBC__ ) ) )
+# define HAVE_SYS_SYSCTL_H
+# endif
# define HAVE_DECL_CTL_KERN
# define HAVE_DECL_KERN_RANDOM
# if defined( HB_OS_LINUX )
@alcz No need to test for HB_OS_LINUX - already checked line above. Checking for GBLIC/UCLIBC works as well.
I have just tested that on Alpine. Works.
It is checked above together with HB_OS_BSD. I wouldn't want to change anything for such systems. They are rather non-GNU, but there is also Debian GNU/kFreeBSD.
Still my patch would touch BSD, i've edited it now, after your note. Need to make some build tests on other distros.
@padiazg It might not fix Alpine builds but works. You can use ubuntu images as build environment and then run compiled binary on Alpine (using Docker multi-stage builds).
https://docs.docker.com/develop/develop-images/multistage-build/
Example: https://github.com/felixd/docker-harbour-example/blob/master/restful-34/Dockerfile https://github.com/felixd/docker-harbour-example/blob/master/.travis.yml
Check: https://github.com/felixd/docker-harbour - based right now on ubuntu:latest https://github.com/felixd/docker-harbour-example
I don't know about Alpine builds... but I have Alpine 3.17 installed native (no containers) on one of my laptops and Harbour/Core compiles and installs ok if the required dev libraries are installed. It is also true for GNUCobol...
I don't know about Alpine builds... but I have Alpine 3.17 installed native (no containers) on one of my laptops and Harbour/Core compiles and installs ok if the required dev libraries are installed. It is also true for GNUCobol...
I have wrote that back in 2019. Things might have change since that time. Thanks for pointing that.
Hi, just want to know if anyone already tried to make an Alpine Build.