wingtk / gvsbuild

GTK stack for Windows
GNU General Public License v2.0
454 stars 170 forks source link

Adwaita-icon-theme issues. #356

Closed mhertz closed 4 years ago

mhertz commented 4 years ago

Sorry have no logs right now, but can provide them later and submit, but just wanted to get this reported and then update later if needed, but should be easily reproducible, atleast in many runs for me.

After rebuilding newest gvsbuild with gtk3 and adwaita-icon-theme, I have issues with certain icons e,g, the title-bar close-window button and some in a toolbar, you can see example in this post of mine by the pics posted: https://forum.deluge-torrent.org/viewtopic.php?f=12&t=55463&start=400#p231570 (Pic 1 and 2 have a strange couple of toolbar icons, and pic 2 have the strange window close button at top right, and pic 3 is normal toolbar-buttons with previous gvsbuild's adwaita-icon-theme 3.34.3).

I could see the issue with the close-button had that strange icon under the icon png file window-close-symbolic-symbolic.png under it's 16x16\ui icon dir, but same adwaita-icon-theme package version on linux had the correct X png in that icon file.

I then today tried update to newest version(3.36.1), with same result, and then reverted back to 3.34.3 as before the update in gvsbuild, and then the icons where normal again, but there's still an issue I never reported, about during the building then alot of missing png's are listed as not found, but installs through anyway without error. It has always done that for me, and I run as admin just in case, because I read in that gtk3 patch file for icon-cache that it might need admin rights. I also then see that all the action folders and png's in them, are missing from all the folders of sizes 8x8 and up, and is only in scalable folder, whereas on linux is everywhere practically. It was also those that where reported missing during building as remember seeing action in names scrolling past.

As said using next-newest version as in gvsbuild today, doesn't do this, and neither the actual newest, but both replaces correct icon files with wrong ones in certain icons, as per pics in previous link, hence I patch gvsbuild to downgrade by reverting your added commit, as atleast not looking strange in what I use it for, though I cannot make toolbar icons bigger, as those icons are missing in 3.34.3 and so hicolor fallback icons used instead.

So currently I cannot get adwaita-icon theme to build properly with any version tested out of three.

Let me know if you need more info.

Thanks in advance.

mhertz commented 4 years ago

I just gathered full debug-logs(sorry for not including initially).

First log is from running gvsbuild unmodified, hence getting wrong icons in some files: http://s000.tinyupload.com/index.php?file_id=57430170301108797047

Second log is a modified gvsbuild, to revert the last update to adwaita-icon-theme, so revert to v3.34.3, and which misses a lot of icon files under action folders, and here's log for that: http://s000.tinyupload.com/index.php?file_id=75009620152830012730

In that last log, all the missing files are listed, but I only included the first:

Converting symbolic SVG icons to PNG...
    Converting symbolic SVG icons to 16x16 PNG...
    Can't save file C:\gtk-build\gtk\x64\release\share\icons\Adwaita\16x16\actions\action-unavailable-symbolic.symbolic.png: Error opening file ?C:\gtk-build\gtk\x64\release\share\icons\Adwaita\16x16\actions\action-unavailable-symbolic.symbolic.png?: No such file or directory

The first log though is fine on that part, though as said has other issues, but this is the working part here, that fails above:

Converting symbolic SVG icons to PNG...
    Converting symbolic SVG icons to 16x16 PNG...
    Converting symbolic SVG icons to 24x24 PNG...
    Converting symbolic SVG icons to 32x32 PNG...
    Converting symbolic SVG icons to 48x48 PNG...
    Converting symbolic SVG icons to 64x64 PNG...
    Converting symbolic SVG icons to 96x96 PNG...

Again, this quoted part is an outdated issue, and the current issue is differen't, but just shown to make light of that there is some issues for some time with that adwaita-icon-theme and/or gvsbuild, and also that reverting the commit simply, is not either a complete fix, as solves one problem but gives another, though for me works better in my use-case and hence, revert it locally in mean time.

I'm btw on win10, py3.8.2(but same with py3.7.6 before) and msvc-2017.

Thanks again!

Edit: Tested upgrading to latest non-rust librsvg, 2.40.21, but building with that gives no change in wrong icons for the adwaita-icon-theme included currently in gvsbuild. I originally tried latest librsvg, which first failed for the patch not applying as changed lines. Then after deleting the patch-part from projects.py, then it failed in a msvc related line, but that was also before I found out that rust was needed. I'll try with that also at a later time, and report back. I also tried with downgrading adwaita-icon-theme to previous used one and still using said updated non-rust librsvg, but same issue there also with missing pngs and action folders, while having correct icons, but only in one size, also as before.

Edit2: librsvg latest version also errors out with msvc build failure while having installed rust msvc x64 tool chain. Though using msvc 2017, and think I read somewhere that 2019 buildtools was needed, but not tried yet though, and don't know if that's the issue even. Honestly it's no big deal for me personally, as now have gone over to installing a working mingw64 build of adwaita-icon-theme from msys2/pacman instead(same version even) and just copy over it's contents into gvsbuild's output folder, untill issue fixed, but if I find a working solution in meantime myself, then I'll of-course post it here.

Edit3: Still fails with msvc-2019 and rust, with latest librsvg. I mean, librsvg fails build, and not even getting to build adwaita-icon-theme in this and last edit.

mhertz commented 4 years ago

Just wanted to say that I made some edits to my previous post with further info.

Also, I honestly didn't understand much about how building rust projects actually worked in gvsbuild, as searching 'gvsbuild rust' didn't gave much relevant info, regarding instructions or explenations of how worked, but after reading through the older commit logs, then I finally understood that locally installed rust isn't even used, and so instead you have to specifically specify 'cargo' as added dep to librsvg, when changing projects.py to build newest librsvg version, and so made previous mentioned changes to projects.py and tried now building newest librsvg(2.48.4) and adwaita-icon-theme(just the version from gvsbuild, unmodified).

However, still fails sadly, with librsvg failing to build with error of not being able to find librsvg.symbols, which I checked isn't there neither, as error states, though also before that, then it's stated that config.h isn't found, which also sound important/relevant. Under the build dir, there's folders for vs12, 14 and 15, so I guessed using 15 should be fine, and i'm again as said, using msvc 2017, py3.8.2 and on win10. Here's log of failing project librsvg latest version:

Building project librsvg (2.48.4)
Checking for 'C:\gtk-build\build\x64\release\librsvg\build\win32\vs15\librsvg.sln'
Debug: running msbuild build\win32\vs15\librsvg.sln /p:UseEnv=True /p:Configuration=release /nologo /p:Platform=x64 /p:PythonPath="C:\Python\Python38" /p:PythonDir="C:\Python\Python38" /v:normal /p:WindowsTargetPlatformVersion="10.0.18362.0", cwd=C:\gtk-build\build\x64\release\librsvg, path+=None
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 5/1/2020 1:29:20 PM.
Project "C:\gtk-build\build\x64\release\librsvg\build\win32\vs15\librsvg.sln" on node 1 (default targe
ts).
ValidateSolutionConfiguration:
  Building solution configuration "release|x64".
Project "C:\gtk-build\build\x64\release\librsvg\build\win32\vs15\librsvg.sln" (1) is building "C:\gtk-
build\build\x64\release\librsvg\build\win32\vs15\rsvg.vcxproj" (2) on node 1 (default targets).
PrepareForBuild:
  Creating directory "C:\gtk-build\build\x64\release\librsvg\build\win32\vs15\Release\x64\obj\rsvg\".
  Creating directory "C:\gtk-build\build\x64\release\librsvg\build\win32\vs15\Release\x64\bin\".
  Creating directory "C:\gtk-build\build\x64\release\librsvg\build\win32\vs15\Release\x64\obj\rsvg\rsv
  g.tlog\".
InitializeBuildStatus:
  Creating "C:\gtk-build\build\x64\release\librsvg\build\win32\vs15\Release\x64\obj\rsvg\rsvg.tlog\uns
  uccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
  Copying config.h...
  The system cannot find the file specified.
  Generating rsvg.def...
  Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27038 for x64
  Copyright (C) Microsoft Corporation.  All rights reserved.

  rsvg.symbols
c1 : fatal error C1083: Cannot open source file: '..\..\..\rsvg.symbols': No such file or directory [C
:\gtk-build\build\x64\release\librsvg\build\win32\vs15\rsvg.vcxproj]
Done Building Project "C:\gtk-build\build\x64\release\librsvg\build\win32\vs15\rsvg.vcxproj" (default
targets) -- FAILED.

Done Building Project "C:\gtk-build\build\x64\release\librsvg\build\win32\vs15\librsvg.sln" (default t
argets) -- FAILED.

Build FAILED.

"C:\gtk-build\build\x64\release\librsvg\build\win32\vs15\librsvg.sln" (default target) (1) ->
"C:\gtk-build\build\x64\release\librsvg\build\win32\vs15\rsvg.vcxproj" (default target) (2) ->
(CustomBuild target) ->
  c1 : fatal error C1083: Cannot open source file: '..\..\..\rsvg.symbols': No such file or directory
[C:\gtk-build\build\x64\release\librsvg\build\win32\vs15\rsvg.vcxproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.65
Traceback (most recent call last):
  File "C:\gtk-build\github\gvsbuild\gvsbuild\utils\builder.py", line 480, in build
    if self.__build_one(p):
  File "C:\gtk-build\github\gvsbuild\gvsbuild\utils\builder.py", line 606, in __build_one
    skip_deps = proj.build()
  File "C:\gtk-build\github\gvsbuild\gvsbuild\projects.py", line 1217, in build
    self.exec_msbuild_gen(r'build\win32', 'librsvg.sln', add_pars='/p:UseEnv=True')
  File "C:\gtk-build\github\gvsbuild\gvsbuild\utils\base_project.py", line 231, in exec_msbuild_gen
    self.exec_msbuild(cmd, configuration, add_path)
  File "C:\gtk-build\github\gvsbuild\gvsbuild\utils\base_project.py", line 114, in exec_msbuild
    self.exec_vs('msbuild ' + cmd + ' /p:Configuration=' + configuration + ' %(msbuild_opts)s', add_path=add_path)
  File "C:\gtk-build\github\gvsbuild\gvsbuild\utils\base_project.py", line 109, in exec_vs
    self.builder.exec_vs(cmd, working_dir=self._get_working_dir(), add_path=add_path)
  File "C:\gtk-build\github\gvsbuild\gvsbuild\utils\builder.py", line 853, in exec_vs
    self.__execute(self.__sub_vars(cmd), working_dir=working_dir, add_path=add_path, env=self.vs_env)
  File "C:\gtk-build\github\gvsbuild\gvsbuild\utils\builder.py", line 930, in __execute
    subprocess.check_call(args, cwd=working_dir, env=env, shell=True)
  File "C:\Python\Python38\lib\subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'msbuild build\win32\vs15\librsvg.sln /p:UseEnv=True /p:Configuration=release /nologo /p:Platform=x64 /p:PythonPath="C:\Python\Python38" /p:PythonDir="C:\Python\Python38" /v:normal /p:WindowsTargetPlatformVersion="10.0.18362.0"' returned non-zero exit status 1.
* Removing librsvg dependents ...
* > Removing adwaita-icon-theme for librsvg ...
* Removing adwaita-icon-theme dependents ...

Patch used:

diff -ur a/gvsbuild/projects.py b/gvsbuild/projects.py
--- a/gvsbuild/projects.py  2020-04-20 18:10:24.526745700 +0200
+++ b/gvsbuild/projects.py  2020-05-01 12:34:44.258081600 +0200
@@ -1190,12 +1190,9 @@
     def __init__(self):
         Project.__init__(self,
             'librsvg',
-            archive_url = 'http://ftp.acc.umu.se/pub/GNOME/sources/librsvg/2.40/librsvg-2.40.20.tar.xz',
-            hash = 'cff4dd3c3b78bfe99d8fcfad3b8ba1eee3289a0823c0e118d78106be6b84c92b',
-            dependencies = ['libcroco', 'cairo', 'pango', 'gdk-pixbuf', 'gtk3'],
-            patches = [
-                'vs2019-support.patch'
-                ],
+            archive_url = 'http://ftp.acc.umu.se/pub/GNOME/sources/librsvg/2.48/librsvg-2.48.4.tar.xz',
+            hash = '28b63af85ced557383d3d3ece6e1f6938720dee1ecfa40d926bf1de4747c956e',
+            dependencies = ['libcroco', 'cairo', 'pango', 'gdk-pixbuf', 'gtk3', 'cargo'],
             )
         if Project.opts.enable_gi:
             self.add_dependency('gobject-introspection')

Of-course I don't even know if lack of newer librsvg is the culprit to my actual issue, which isn't librsvg, but adwaita-icon-theme, as title suggest, but just didn't have any other ideer's, as tried 3 different adwaita-icon-theme versions already without success(builds fine, but has various issues), as stated previously(using librsvg from gvsbuild unmodified).

dean-82 commented 4 years ago

I am seeing the same issue on Windows 10 using Python 3.7.3.

mhertz commented 4 years ago

There's been issues for along time with this evidently, as just saw an older gvsbuild done by other person, with adwaita-icon-theme 3.32.0, and exhibiting issues like encountered here i.e the older issue of no action folders/icons.

As said, meanwhile, you can add it to your --skip command in gvsbuild and install it from msys2 as mingw package and copy into your built gvsbuild afterwards, as workaround.

webfolderio commented 4 years ago

Same problem, win 10, msvc 2017

I download and installed pre-build package from here: https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer

Problem gone after copying share\icons to gtk\Win32\release

mhertz commented 4 years ago

Sorry still no actual solution, other than old workaround of using from otherplace as previously posted, but just wanted to add that It seems the issue is that we use the old non-rust librsvg, as gentoo was having seemingly likeminded issue and in the fixed bug-ticket posted:

"x11-themes/adwaita-icon-theme: add warning when building against old librsvg

Building with old non-rust librsvg will result in broken symbolic PNG files
being generated at buildtime, and many broken scalable icons at runtime.
However hard requiring a newer librsvg would enter a big de-keywording
cascade for architectures without rust - so warn instead for now and prefer
broken-looking icons instead of losing it completely for these architectures,
at least for the time being."

Source: https://bugs.gentoo.org/734602

guruDanny67 commented 4 years ago

Using the new librsvg built with rust fixes the issue.