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

build failed on Win11 while building gdk-pixbuf #1378

Open
VanderBieu opened this issue Jul 2, 2024 · 17 comments
Open

build failed on Win11 while building gdk-pixbuf #1378

VanderBieu opened this issue Jul 2, 2024 · 17 comments

Comments

@VanderBieu
Copy link

VanderBieu commented Jul 2, 2024

[155/156] Generating thumbnailer/thumbnailer with a custom command (wrapped by meson to set PATH)
FAILED: thumbnailer/gdk-pixbuf-thumbnailer.thumbnailer
"C:\Users\xxx\pipx\venvs\gvsbuild\Scripts\python.exe" "C:\gtk-build\tools\meson-1.4.1\meson.py" "--internal" "exe" "--unpickle" "C:\gtk-build\build\x64\release\gdk-pixbuf_gvsbuild-meson\meson-private\meson_exe_python.exe_dc59616020dbae91748eb1bd69d2c1f610444015.dat"
while executing ['C:\Users\xxx\pipx\venvs\gvsbuild\Scripts\python.exe', 'C:/gtk-build/build/x64/release/gdk-pixbuf/build-aux/gen-thumbnailer.py', '--printer', 'C:/gtk-build/build/x64/release/gdk-pixbuf/_gvsbuild-meson/thumbnailer/gdk-pixbuf-print-mime-types.exe', '--pixdata', 'C:/gtk-build/build/x64/release/gdk-pixbuf/_gvsbuild-meson/gdk-pixbuf/gdk-pixbuf-pixdata.exe', '--loaders', 'gdk-pixbuf/loaders.cache', '--bindir', 'C:/gtk-build/gtk/x64/release/bin', '../thumbnailer/gdk-pixbuf-thumbnailer.thumbnailer.in', 'thumbnailer/gdk-pixbuf-thumbnailer.thumbnailer']
--- stdout ---

--- stderr ---

ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "C:\Users\xxx\pipx\venvs\gvsbuild\Lib\site-packages\gvsbuild\utils\builder.py", line 527, in build
if self.__build_one(p):
^^^^^^^^^^^^^^^^^^^
File "C:\Users\xxx\pipx\venvs\gvsbuild\Lib\site-packages\gvsbuild\utils\builder.py", line 663, in __build_one
skip_deps = proj.build()
^^^^^^^^^^^^
File "C:\Users\xxx\pipx\venvs\gvsbuild\Lib\site-packages\gvsbuild\projects\gdk_pixbuf.py", line 54, in build
Meson.build(self)
File "C:\Users\xxx\pipx\venvs\gvsbuild\Lib\site-packages\gvsbuild\utils\base_builders.py", line 56, in build
self.builder.exec_ninja(params="install", working_dir=ninja_build)
File "C:\Users\xxx\pipx\venvs\gvsbuild\Lib\site-packages\gvsbuild\utils\builder.py", line 985, in exec_ninja
self.__execute(
File "C:\Users\xxx\pipx\venvs\gvsbuild\Lib\site-packages\gvsbuild\utils\builder.py", line 1041, in __execute
subprocess.check_call(args, cwd=working_dir, env=env, shell=True)
File "C:\Users\xxx\miniconda3\envs\gtk\Lib\subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'ninja install' returned non-zero exit status 1.
Error: gdk-pixbuf build failed

@VanderBieu
Copy link
Author

by the way i used gvsbuild build gtk4 --from-scratch command to build

@danyeaw
Copy link
Member

danyeaw commented Jul 3, 2024

Hi @VanderBieu, I notice that you are running Gvsbuild with pipx which is great. I also noticed that one of the last lines shows a minconda env, do you know why the build is picking up that environment as well?

@VanderBieu
Copy link
Author

VanderBieu commented Jul 3, 2024

Hi @VanderBieu, I notice that you are running Gvsbuild with pipx which is great. I also noticed that one of the last lines shows a minconda env, do you know why the build is picking up that environment as well?

I installed pipx in that environment. But I managed to use pipx globally. Could that be source of this problem?

@VanderBieu
Copy link
Author

Hi @VanderBieu, I notice that you are running Gvsbuild with pipx which is great. I also noticed that one of the last lines shows a minconda env, do you know why the build is picking up that environment as well?

I managed to get rid of the miniconda env. However I still get this failure which popped by system python.

@daliyou
Copy link

daliyou commented Jul 30, 2024

I have also a failure of building gdk-pixbuf on win10, as following. Could you please indicate me the reasons and solutions? I also asked gdk-pixbuf developers. The manager suggests discuss here. Thanks

-- Installing: C:/gtk-build/build/x64/release/libpng-rel/lib/libpng/libpng16-relwithdebinfo.cmake

(tar) Exporting gdk-pixbuf
Building project gdk-pixbuf (2.42.12)
[1/3] Generating gdk-pixbuf/loaders.cache with a custom command (wrapped by meson to set PATH, to capture output)
FAILED: gdk-pixbuf/loaders.cache
"C:\Users\youdali\AppData\Local\Programs\Python\Python312\python.exe" "C:\gtk-build\tools\meson-1.4.1\meson.py" "--internal" "exe" "--unpickle" "C:\gtk-build\build\x64\release\gdk-pixbuf_gvsbuild-meson\meson-private\meson_exe_gdk-pixbuf-query-loaders_16cdceb611d2fa0909d0e380855d877266fee48a.dat"
while executing ['C:\gtk-build\build\x64\release\gdk-pixbuf\_gvsbuild-meson\gdk-pixbuf\gdk-pixbuf-query-loaders.exe']
--- stderr ---

ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "C:\Users\youdali\AppData\Local\Programs\Python\Python312\Lib\site-packages\gvsbuild\utils\builder.py", line 540, in build
if self.__build_one(p):

@danyeaw
Copy link
Member

danyeaw commented Jul 30, 2024

Hi everyone, I need help reproducing this, which means I need way more information on your setup and the commands you used to try to build GTK. What steps did you take, what else do you have installed on your system, and what did you try to build? This isn't failing for me or on the CI/CD.

@daliyou
Copy link

daliyou commented Jul 31, 2024

@danyeaw thanks. What I did is following the steps using Chocolatey (https://github.com/wingtk/gvsbuild). The enclosed is my version of the installations.
v5
v1
v2
v3
v4

@daliyou
Copy link

daliyou commented Jul 31, 2024

@danyeaw The following is the building process. Thank you.
w5
w1
w2
e1
e2

The chinese characters in the warning message means: cannot locate the input point 'deflateSetHeader' in dynamic link database.

@danyeaw
Copy link
Member

danyeaw commented Jul 31, 2024

Thanks @daliyou! I've seen issues in the past that we have resolved for builds failing due to locale set. Would it be possible to switch your computer to English in order to try to isolate the build failure?

@daliyou
Copy link

daliyou commented Jul 31, 2024

@danyeaw I have to sorry, I cannot completely change my Win 10 home language to English, even I tried different English version.
The error: cannot locate the input point 'deflateSetHeader' in dynamic link database, is still in Chinese. But the following character are in English, location line 1 character 1
image

@danyeaw
Copy link
Member

danyeaw commented Aug 3, 2024

I tried changing my computer's Language to Chinese Simplified, unfortunately, I still wasn't able to reproduce this still. Do you know why you are getting this deflateSetHeader error?

@daliyou
Copy link

daliyou commented Aug 5, 2024

@danyeaw Thanks for oyur efforts. I did know the exact reasons. Two possible points are my system reason and I used pip to installed gvsbuild instead of pipx. Pipx did not work on my PC.

@Daltonu
Copy link

Daltonu commented Aug 20, 2024

Is there a solution? I have the same problem and I am very distressed.

@danyeaw
Copy link
Member

danyeaw commented Aug 20, 2024

Hi @Daltonu, do you have an Asian locale set on your computer as well?

@Daltonu
Copy link

Daltonu commented Aug 22, 2024

Drag "C:\gtk-build\build\x64\release\zlib\zlib1.dll" or "C:\gtk-build\gtk\x64\release\bin\zlib1.dll" to "C:\Windows\System32".

According to README.md, I used WinGet and installed Git, MSYS2, Visual Studio 2022, and Python.
I tried many ways and spent a lot of time to solve the pop-up problem.
I'm investigating the cause step by step.

1.Problem with environment variables
I have two Microsoft Visual Studio 2022 on my computer. The first one is what I already have, and it is installed on the D drive. The second one is Microsoft.VisualStudio.2022.BuildTools installed via WinGet, and it is installed on the C drive.
A pop-up error appears. Look up for the PowerShell command line.I found that the cl.exe in the D drive was called, but the cl.exe in the C drive was not called.
I modified the environment variables, putting the compiler path of the C drive in front and the compiler path of the D drive in the back. I re-ran the ”gvsbuild build gtk4“ command, and the compiler of the D drive was still called.
So, I deleted both Microsoft Visual Studio 2022, including the registry. If the registry is retained, the command line will still use the path of drive D after my second installation.
I installed Microsoft.VisualStudio.2022.BuildTools using WinGet, and now I only have this one Microsoft Visual Studio 2022 on my computer. I re-ran the "gvsbuild build gtk4" command, and now the compiler on the C drive is called.
But unfortunately, the pop-up error still exists.

2.Build errors due to locale settings
After watching your previous answer, I tried this step.
I upgraded my system to win11 Pro, changed the language from Chinese to English, and changed the regional settings.
But the pop-up error still exists.

3.Try to solve "Error: gdk-pixbuf build failed"
I tried to solve the problem from here "Error: gdk-pixbuf build failed". But the gdk-pixbuf I found online was irrelevant information.

4.Try to solve”无法定位程序输入点 deflateSetHeader 于动态链接库 C:\gtk-build\gtk\x64\release\bin\gio-2.0-0.dll 上。“
This is the Chinese prompt of the pop-up window, which translates to "Unable to locate the procedure entry point deflateSetHeader in the dynamic link library C:\gtk-build\gtk\x64\release\bin\gio-2.0-0.dll."
From this sentence, it is easy to observe two key words: deflateSetHeader and gio-2.0-0.dll.
I used Everything software to find gio-2.0-0.dll.
"C:\gtk-build\build\x64\release\glib-base_gvsbuild-meson\gio\gio-2.0-0.dll" 1796KB
"C:\gtk-build\gtk\x64\release\bin\gio-2.0-0.dll" 1796KB
I moved them to "C:\Windows\System32" and "C:\Windows\SysWOW64". One is for 32-bit dlls and the other is for 64-bit dlls.
Note, there is no gio-2.0-0.dll file in these two 32-bit and 64-bit dll storage paths.
Re-run the command, but the pop-up window error still appears.
1
2
3
I searched deflateSetHeader online and found that zlib1.dll appeared frequently under this search term.
I used the Everything software to query zlib1.dll again.
"C:\Windows\System32\zlib1.dll" 77KB
"C:\gtk-build\build\x64\release\zlib\zlib1.dll" 89KB
"C:\gtk-build\gtk\x64\release\bin\zlib1.dll" 89KB
4
5
6
So I deleted the 77KB zlib1.dll and replaced it with the 89KB zlib1.dll.
7
Re-ran the command and it succeeded.
8

Finally, although I solved the pop-up problem, there are still some problems that confuse me.
1.At which step in the program will this pop-up window appear?
2.Why do some people not have this problem, but others do?
I think that different KBs mean different versions, and different configurations for different people may lead to different versions of zlib1.dll.
There will be no pop-up window problem if the version is high, but the problem will occur like mine if the version is low.
3.If people give a lot of feedback about this issue, can we write an automated script to configure a specific version of zlib1.dll during the build?
4.What is zlib1.dll?
I need to take the time to learn more about it.

@danyeaw
Copy link
Member

danyeaw commented Aug 23, 2024

Hi @Daltonu, it looks like you spent quite a bit of effort troubleshooting this, so thanks for all your effort! I know it can be frustrating if things aren't working.

zlib1.dll is the zlib compression library compiled for Windows. There is more information about the DLL version here: https://zlib.net/DLL_FAQ.txt. In Gvsbuild, we are building it with the zlib project.

@Daltonu

This comment has been minimized.

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

4 participants