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

Building gtk fails with a too long string (>65536 chars) [VisualCode 2019/v16] #827

Open
F-Loyer opened this issue Jan 28, 2023 · 5 comments

Comments

@F-Loyer
Copy link

F-Loyer commented Jan 28, 2023

I have tried gvsbuild build --vs-ver 16 --vs-install-path C:\DiskuvOCaml\BuildTools gtk3. Since I have Visual Code 2019 which is proposed by the Diskuv project (an Windows Ocaml port).

I have the following errors:

[365/885] Generating gtk/gtkresources_c with a custom command
Un prétraitement xml-stripblanks a été demandé, mais XMLLINT n’est pas défini et xmllint n’est pas dans le chemin PATH
[371/885] Compiling C object gtk/gtk-3-...p/meson-generated_.._gtkresources.c.obj
FAILED: gtk/gtk-3-vs16.dll.p/meson-generated_.._gtkresources.c.obj
[...]
gtk/gtkresources.c(4105): fatal error C1091: limite du compilateur : la longueur de la chaîne dépasse de 65535 octets
[380/885] Compiling C object gtk/gtk-3-...eson-generated_.._gtktypebuiltins.c.obj
ninja: build stopped: subcommand failed.

Since the compiler is limited to 65536 characters strings, I guess I should process the file to replace "\000\001\002..." by 0, 1, 2 or somehing like this.

@danyeaw
Copy link
Member

danyeaw commented Jan 28, 2023

Hi @F-Loyer, do you have long paths enabled in Windows?

@F-Loyer
Copy link
Author

F-Loyer commented Jan 28, 2023

It is not about the path, but the compilator doesn't like some long strings inside the .cfile. (See https://learn.microsoft.com/en-us/cpp/cpp/compiler-limits?view=msvc-170)

I have tried to remplace the string by a list or number... but get the following error:

gtk/gtkresources.c(15612): fatal error C1060: espace du tas insuffisant pour le compilateur

The heap space is not suffisient for the compiler. I note the progress... the error is produced at the line 15612... and not 4105... But we need to handle 10 times more lines !

The error is covered here https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/fatal-error-c1060?view=msvc-170, but with an x64 system, I am surprised by this error.

@danyeaw
Copy link
Member

danyeaw commented Jan 28, 2023

Do you have the Diskuv OCaml setup instructions that you are following so that we can try to reproduce this? I haven't seen this issue before, so there must be something unique with your setup.

@F-Loyer
Copy link
Author

F-Loyer commented Jan 29, 2023

I have followed https://diskuv-ocaml.gitlab.io/distributions/dkml/# (and use the Diskuv installer). But, the Visual Studio 2019 is installed automatically in a fancy directory, but this installation is made by the Visual Studio Installer.

I don't think the compiler installation is wrong (the 65535 characters limit is documented by Microsoft).

The issue can come from the C:\gtk-build\build\x64\release\gtk3\gtk\gtkresources.c generation. Mine is 175637 lines long !! The ressource is 2809657 bytes long in a unique array. Perhaps something has happenned when generating this file.

@F-Loyer
Copy link
Author

F-Loyer commented Feb 4, 2023

I finally solved my issue, using VS2022. The C:\gtk-build\build\x64\release\gtk3\gtk\gtkresources.c is the same, then I guess the older compiler has a known and documented limitation.

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

2 participants