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

wip-mingw #2

Open
Kreijstal opened this issue Mar 16, 2025 · 11 comments
Open

wip-mingw #2

Kreijstal opened this issue Mar 16, 2025 · 11 comments

Comments

@Kreijstal
Copy link

wip-mingw did compile and I got very far, very good job! Thank you so much for your work. Right now we get this compiler error

locale-categories.h: In function 'get_current_locale_settings':
syscalls.h:34:11: error: implicit declaration of function 'scm_async_tick' [-Wimplicit-function-declaration]
   34 |           scm_async_tick ();                    \
      |           ^~~~~~~~~~~~~~
i18n.c:309:5: note: in expansion of macro 'SCM_SYSCALL'
  309 |     SCM_SYSCALL (locale_name = setlocale (LC_ ## _name, NULL)); \       
      |     ^~~~~~~~~~~
locale-categories.h:24:1: note: in expansion of macro 'SCM_DEFINE_LOCALE_CATEGORY'
   24 | SCM_DEFINE_LOCALE_CATEGORY (COLLATE)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~

I believe it might be because gcc warnings became errors with gcc14? not sure.

@Kreijstal
Copy link
Author

Kreijstal commented Mar 16, 2025

solved it by adding

#include "libguile/async.h"
on libguile/syscalls.h

But then I get this error

loader.c: In function 'scm_bootstrap_loader':
loader.c:825:15: error: implicit declaration of function 'getpagesize'; did you mean 'getdtablesize'? [-Wimplicit-function-declaration]
  825 |   page_size = getpagesize ();
      |               ^~~~~~~~~~~
      |               getdtablesize
make[3]: *** [Makefile:3359: libguile_3.0_la-loader.lo] Error 1
make[3]: Leaving directory '/home/topkek/git/guile/libguile'
make[2]: *** [Makefile:2643: all] Error 2
make[2]: Leaving directory '/home/topkek/git/guile/libguile'
make[1]: *** [Makefile:2072: all-recursive] Error 1
make[1]: Leaving directory '/home/topkek/git/guile'
make: *** [Makefile:1958: all] Error 2

while solving that error there are incompatibilities with gnulib and msys2

stime.c:159:17: error: passing argument 1 of 'gettimeofday' from incompatible pointer type [-Wincompatible-pointer-types]
  159 |   gettimeofday (&tv, NULL);
      |                 ^~~
      |                 |
      |                 struct rpl_timeval *
E:/msys64/ucrt64/include/sys/time.h:42:26: note: expected 'struct timeval * restrict' but argument is of type 'struct rpl_timeval *'
   42 | int __cdecl gettimeofday(struct timeval *__restrict__,
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

it confuses include/sys/time.h from ucrt64 msys2 and lib/sys/time.h from gnulib

@lyrra
Copy link
Owner

lyrra commented Mar 16, 2025

Thanks for your reports! I've fixed those in new commits and force-pushed.
Also thanks for investigating the root-cause, I'll update the commits with that info which is useful for future rebases.

If you find anything else, you're welcome to create PR's and I'll merge them.

@Kreijstal
Copy link
Author

@lyrra feel free to check #3 I think it goes far. It does not complete the installation yet, but its close!

@Kreijstal
Copy link
Author

Kreijstal commented Mar 17, 2025

We have managed to build it, how did you fix the repl that does not display the print message anymore

topkek@win11 UCRT64 ~/git/guile
# ./libguile/guile
---- x0 ----
---- x1 sig: 2 ----
---- xA ----
GNU Guile 3.0.8.135-6187fe2-dirty
Copyright (C) 1995-2022 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> (+ 1 1) 
$1 = 2

(+ 1 1) 
$2 = 2
(print "there is not prompt anymore") 
;;; <stdin>:4:1: warning: possibly unbound variable `print'
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Unbound variable: print

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
(write "there is not prompt anymore") 
"there is not prompt anymore"(+ 1 1) 
$3 = 2
(write "as you can see, It does not write a prompt anymore, big sad\n") 
"as you can see, It does not write a prompt anymore, big sad\n"

it should print scheme@(guile-user)> after an instruction is done, no?

also

(use-modules (ice-9 readline))
While compiling expression:
In procedure dlopen: file "guile-readline.dll", message "error 126: The specified module could not be found.\r\n"
(readline-activate)

@lyrra
Copy link
Owner

lyrra commented Mar 17, 2025

I've only used the libguile stuff to run guile scripts in an mingw environment. The REPL and readline could probably be errors that always was there.
Perhaps we should test the latest release not rebased, and see if it is an regression.

@lyrra
Copy link
Owner

lyrra commented Mar 22, 2025

I'm looking into the causes why the repl wont show, but more importantly, why during compile, some scheme files wont be compiled , get errors like " no such language cps".

BTW, have you seen https://github.com/spk121/guile-portability

@Kreijstal
Copy link
Author

No I havent thank you

@spk121
Copy link
Contributor

spk121 commented Mar 22, 2025

Entering a new prompt. Type ,bt' for a backtrace or ,q' to continue.
(write "there is not prompt anymore")
"there is not prompt anymore"(+ 1 1)
$3 = 2
(write "as you can see, It does not write a prompt anymore, big sad\n")
"as you can see, It does not write a prompt anymore, big sad\n"


it should print `scheme@(guile-user)>` after an instruction is done, no?

That one might be if you're using version of Windows Terminal before v1.20 without this fix:
microsoft/terminal#16299

also

(use-modules (ice-9 readline))
While compiling expression:
In procedure dlopen: file "guile-readline.dll", message "error 126: The specified module could not be found.\r\n"
(readline-activate)

This one has to do with how Guile moved away from libltdl and did its own version of DLL dlopening. When it did, it stopped automatically searching for major revisions in DLLs, like guile-readline-1.dll vs guile-readline.dll There is a patch I'm going to push into the main tree hopefully soon. You can see a draft here spk121/guile@ddcdfe0

@Kreijstal
Copy link
Author

I see you are implementing both msys2/cygwin and msys2's cygwin. do you use the msys2 patches

@spk121
Copy link
Contributor

spk121 commented Mar 23, 2025

I have a prospective fix for the REPL not showing. I pushed it back into Guile's main branch

Windows 11: for fport input from the console, ignore terminal returns

I've not yet evaluated msys's patches or Lilypond's patches since first I needed the 32-bit Guile on MinGW to not be broken. Hopefully it is working now.

@lyrra
Copy link
Owner

lyrra commented Mar 23, 2025

Thanks for the update! I've rebased the wip-mingw branch in this repo ontop of savannah main.

So, the branch wip-mingw in this repo consist of the following stack:

+---------------------------+
|  our make-shift commits   |
+---------------------------+
| savannah wip-mingw        |
+---------------------------+
| savannah main             |
+---------------------------+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants