After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 737341 - Changed behavior of g_win32_get_package_installation_directory_of_module()
Changed behavior of g_win32_get_package_installation_directory_of_module()
Status: RESOLVED DUPLICATE of bug 739835
Product: glib
Classification: Platform
Component: win32
2.42.x
Other Windows
: Normal critical
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-25 09:11 UTC by Bakhtiar Hasmanan
Modified: 2015-08-29 18:04 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bakhtiar Hasmanan 2014-09-25 09:11:35 UTC
Changes in glib\gwin32.c at g_win32_get_package_installation_directory_of_module() (version 2.41.3 till current) cause it returns path of interpreter (python.exe) instead of cleaned up hmodule path.

If added printouts such:
...
gchar *
g_win32_get_package_installation_directory_of_module (gpointer hmodule)
{
  gchar *filename;
  gchar *retval;
  gchar *p;
  wchar_t wc_fn[MAX_PATH];

  /* NOTE: it relies that GetModuleFileNameW returns only canonical paths */
  if (!GetModuleFileNameW (hmodule, wc_fn, MAX_PATH))
    return NULL;

  filename = g_utf16_to_utf8 (wc_fn, -1, NULL, NULL, NULL);
  printf(filename);
  if ((p = strrchr (filename, G_DIR_SEPARATOR)) != NULL)
    *p = '\0';

  retval = g_strdup (filename);

  do
    {
      p = strrchr (retval, G_DIR_SEPARATOR);
      printf(retval);
      if (p == NULL)
        break;

      *p = '\0';

      if (g_ascii_strcasecmp (p + 1, "bin") == 0 ||
          g_ascii_strcasecmp (p + 1, "lib") == 0)
        break;
    }
  while (p != NULL);

  if (p == NULL)
    {
      g_free (retval);
      retval = filename;
    }
  else
    g_free (filename);

#ifdef G_WITH_CYGWIN
  /* In Cygwin we need to have POSIX paths */
  {
    gchar tmp[MAX_PATH];

    cygwin_conv_to_posix_path (retval, tmp);
    g_free (retval);
    retval = g_strdup (tmp);
  }
#endif
  printf (retval);
  return retval;
}
...

returns:
C:\Python34\Lib\site-packages\gnome\libgirepository-1.0-1.dll
C:\Python34\Lib\site-packages\gnome
C:\Python34\Lib\site-packages
C:\Python34\Lib
C:\Python34

It show that initial hmodule path is correct but inside the loop it keep cut till C:\python34

C:\Python34\Lib\site-packages\gnome in inside PATH environment, doesnt have "bin" subfulder but have "lib" subfolder and is the expected retval.

This bug reproduced in python mode. In windows this causes GI fail to find relative typelibs repo. So this bug is critical.
Comment 1 George Kiagiadakis 2015-08-29 18:04:02 UTC

*** This bug has been marked as a duplicate of bug 739835 ***