msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.25k stars 1.21k forks source link

[mingw-w64-make] Is it possible to bring back Guile support? #3298

Open mbakhterev opened 6 years ago

mbakhterev commented 6 years ago

It is much more easier and efficient to automate complex build processes with embedded Guile procedures than with GNU Make's own internal language. Is it possible to enable Guile support again?

irakhlin commented 6 years ago

I don't believe that guile currently builds for mingw64 due to a long standing issue with the guile package itself. https://github.com/msys2/MINGW-packages/issues/699

Alexpux commented 6 years ago

@irakhlin try to build both 32 and 64 yourself

vzh commented 4 years ago

Hi there, There was reported on the guile-user mailing list that the following branch should work: http://git.savannah.gnu.org/cgit/guile.git/log/?h=wip-mingw-guile-2.2 There are several patches for MinGW there.

Alexpux commented 4 years ago

@vzh I will not build package from git, only release versions

vzh commented 4 years ago

OK, thank you! I'll ask guile devs if they have any plans on releasing it.

spk121 commented 4 years ago

@vzh @Alexpux Yeah, that mingw guile git branch is mine, so I suppose it is up to me to see if I can get those patches past the maintainers and into mainline. I'll see what I can do.

gjanssens commented 4 years ago

@spk121 Have you made some progress in mainlining your patches ? It would really be helpful to have a mingw guile package.

spk121 commented 3 years ago

The upcoming 3.0.6 release should support MinGW out of the box at least at some level. The unthreaded, 32-bit build will definitely work, though it won't pass the test suite 100% due to missing features. We're hoping to get the 64-bit build and the threaded build fixed by 3.0.6 as well, but, it is TBD.

alex-tee commented 3 years ago

Guile 3.0.7 is out. is it possible to re-add guile support with this release?

Biswa96 commented 3 years ago

Are we asking for mingw-w64-guile package here? Or somehow adding guile in make 😕

alex-tee commented 3 years ago

I personally just want libguile (so a mingw-w64-guile package), but the guile base package is also stuck at version 2 and could use an update (if possible)

jcalve commented 3 years ago

I tried to compile 3.0.7, master, and a branch named "wip-mingw", the furthest I got was on the later with ./configure --enable-mini-gmp --disable-networking but it still fails after a while...

Biswa96 commented 1 year ago

I have sent an email in guile mailing list here https://lists.gnu.org/archive/html/guile-devel/2022-10/msg00019.html. If things go well I can try to add mingw-w64-guile package.

Biswa96 commented 1 year ago

Some updates.

  1. With gethostname(), the build fails with the error:

    ld.exe: .libs/libguile_3.0_la-posix.o: in function `scm_gethostname':
    libguile/posix.c:2379: undefined reference to '__imp_gethostname_used_without_requesting_gnulib_module_gethostname'

    Some info about that in here https://lists.gnu.org/archive/html/bug-gnulib/2010-09/msg00265.html

  2. If I disable the gethostname() check with this diff

--- a/configure.ac
+++ b/configure.ac
@@ -565,7 +565,7 @@ AC_CHECK_DECLS([_NL_NUMERIC_GROUPING], [], [], [[#include <langinfo.h>]])
 #       only with `_XOPEN_SOURCE' or some such.
 #
 AC_CHECK_HEADERS([crypt.h netdb.h pthread.h pthread_np.h sys/param.h sys/resource.h sys/file.h sys/mman.h])
-AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass sethostname gethostname)
+AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass sethostname)
 AC_CHECK_DECLS([sethostname, hstrerror, cuserid])

 # crypt() may or may not be available, for instance in some countries there

guile.exe itself fails with the errors

mmuetzel commented 1 year ago

For the first error, you might need to add gethostname to the list of gnulib modules (gl_MODULES) in m4/gnulib-cache.m4. After that, you might need to run autogen.sh to regenerate the files.

Edit: Noticed a bit late that autogen.sh isn't part of the tarball. (I wonder why.) I was looking at the git repository: http://git.savannah.gnu.org/cgit/guile.git/tree/autogen.sh But afaict, all that script actually does is running autoreconf -fi.

Biswa96 commented 1 year ago

I have tried that but same build error with gethostname.

mmuetzel commented 1 year ago

Sorry. That was a bit more involved than I initially thought. I regenerated the gnulib files including the gethostname module from the same commit they used to get their gnulib files the last time (rev 8f4538a53d64054ae2fc8b86c0f87c418c6176e6). (First patch.) With that, compilation still failed pretty early on because of a missing header. (Second patch.) But even with those patches, it still doesn't work for me.

Just wanted to share the patches in case you are more successful: guile-patches.zip

spk121 commented 1 year ago

Hi. The only version of Guile that I've built successfully on MinGW recently is MSys2 MinGW 32. From the latest commit in the 'main' branch of the upstream repo, the configure line that works is ./configure CFLAGS="-g -Wall -O1" --enable-lto=no --without-threads --enable-jit=no --enable-mini-gmp -C

So it is 32-bit only, unthreaded.

The 64-bit build remains broken because of long == 4 bytes, when guile expects long == 8 bytes. There are some patches, but, nothing moved into the main tree