Menu

#1497 Windows Configure/make related bug

Next_Nightly
applied
nobody
None
Bug_Report
6 days ago
2024-08-12
No

The MSys2 UCRT64 package gives a false failure message when installing an cbplugin.

Patch below

--- a/src/sdk/configmanager.cpp (revision 13538)
+++ b/src/sdk/configmanager.cpp (working copy)
@@ -1497,7 +1497,7 @@
     if (plugin_path_global.IsEmpty())
     {
         if (platform::windows)
-            ConfigManager::plugin_path_global = app_path + _T("/../lib/codeblocks/plugins");
+            ConfigManager::plugin_path_global = app_path + _T("\\..\\lib\\codeblocks\\plugins");
         else if (platform::macosx)
             ConfigManager::plugin_path_global = data_path_global + _T("/plugins");
         else

Discussion

  • Miguel Gimenez

    Miguel Gimenez - 2024-08-13

    Can you post the failure message?

     
  • Tim Stahlhut

    Tim Stahlhut - 2024-08-14
    [Window Title]
    Warning
    
    [Main Instruction]
    One or more plugins were not installed successfully:
    
    [Content]
    H:\devel\cb_projects\repos\GitBlocks\GitBlocks-UCRT64.cbplugin
    
    
    [OK]
    
     
  • Miguel Gimenez

    Miguel Gimenez - 2024-08-14

    I do not use MSYS, can you replace the block from line 1496 to 1519 with this?

        if (plugin_path_global.IsEmpty())
        {
            if (platform::windows)
    #ifdef CB_AUTOCONF
                ConfigManager::plugin_path_global = app_path + _T("/../lib/codeblocks/plugins");
    #else
                ConfigManager::plugin_path_global = app_path + _T("\\..\\lib\\codeblocks\\plugins");
    #endif
            else if (platform::macosx)
                ConfigManager::plugin_path_global = data_path_global + _T("/plugins");
            else
            {
    #ifdef __WXGTK__
                // It seems we can not longer rely on wxStandardPathsBase::Get().GetPluginsDir(),
                // because its behaviour has changed on some systems (at least Fedora 14 64-bit).
                // So we create the pathname manually
                ConfigManager::plugin_path_global = ((const wxStandardPaths&)wxStandardPaths::Get()).GetInstallPrefix() + _T("/lib/codeblocks/plugins");
                // first assume, we use standard-paths
                if (!wxDirExists(ConfigManager::plugin_path_global) && wxIsPlatform64Bit())
                {
                    // if standard-path does not exist and we are on 64-bit system, use lib64 instead
                    ConfigManager::plugin_path_global = ((const wxStandardPaths&)wxStandardPaths::Get()).GetInstallPrefix() + _T("/lib64/codeblocks/plugins");
                }
    #endif // __WXGTK__
            }
        }
    
     
  • Tim Stahlhut

    Tim Stahlhut - 2024-08-14

    Delete past statement; I have decided it might/should work. I will try it when I have time.

     

    Last edit: Tim Stahlhut 2024-08-24
  • Tim Stahlhut

    Tim Stahlhut - 2024-08-14

    You could change to testing the native path separator instead; that should work. But, I have no idea what use case you are trying to avoid breaking. See wxFILE_SEP_PATH

    Example it was tested and does still fix my problem.

    --- a/src/sdk/configmanager.cpp (revision 13538)
    +++ b/src/sdk/configmanager.cpp (working copy)
    @@ -1497,7 +1497,11 @@
         if (plugin_path_global.IsEmpty())
         {
             if (platform::windows)
    +#if (wxFILE_SEP_PATH == wxFILE_SEP_PATH_UNIX)
                 ConfigManager::plugin_path_global = app_path + _T("/../lib/codeblocks/plugins");
    +#else
    +            ConfigManager::plugin_path_global = app_path + _T("\\..\\lib\\codeblocks\\plugins");
    +#endif
             else if (platform::macosx)
                 ConfigManager::plugin_path_global = data_path_global + _T("/plugins");
             else
    
     

    Last edit: Tim Stahlhut 2024-08-14
  • Tim Stahlhut

    Tim Stahlhut - 2024-08-14

    The problem is caused by comparing two paths to the plugin DLL one uses "\" and the other uses both "/" and "\" so it fails and cause the error/warning message.

     

    Last edit: Tim Stahlhut 2024-08-14
  • Tim Stahlhut

    Tim Stahlhut - 2024-08-24

    Going to try patch posted and see if it works; I think I failed to understand the or logic because now it looks to me that it will fix the issue. And, now it looks like it will not fix the issue. I hoping testing builds and I get good results.

    Tim S.

     

    Last edit: Tim Stahlhut 2024-08-24
  • Tim Stahlhut

    Tim Stahlhut - 2024-08-24

    Patch that I am trying it takes a while for me to build CB and then the plugin I am testing.

    Tim S.

    --- a/src/sdk/configmanager.cpp
    +++ b/src/sdk/configmanager.cpp
    @@ -1493,11 +1493,14 @@ void ConfigManager::InitPaths()
         else
             ConfigManager::data_path_global = UnixFilename(data_path_global);
    
    -#ifdef CB_AUTOCONF
         if (plugin_path_global.IsEmpty())
         {
             if (platform::windows)
    +#ifdef CB_AUTOCONF
                 ConfigManager::plugin_path_global = app_path + _T("/../lib/codeblocks/plugins");
    +#else
    +            ConfigManager::plugin_path_global = app_path + _T("\\..\\lib\\codeblocks\\plugins");
    +#endif
             else if (platform::macosx)
                 ConfigManager::plugin_path_global = data_path_global + _T("/plugins");
             else
    @@ -1516,7 +1519,6 @@ void ConfigManager::InitPaths()
     #endif // __WXGTK__
             }
         }
    -#endif
    
         wxString dataPathUser = ConfigManager::config_folder + wxFILE_SEP_PATH + _T("share");
     #ifdef __linux__
    
     
  • Tim Stahlhut

    Tim Stahlhut - 2024-08-24

    Miguel patch fails to fix issue tested using MSys2 ucrt64 enviroment.

     
  • Miguel Gimenez

    Miguel Gimenez - 2024-08-24

    Thanks for testing.

     
  • Miguel Gimenez

    Miguel Gimenez - 6 days ago
    • status: open --> applied
     
  • Miguel Gimenez

    Miguel Gimenez - 6 days ago

    Applied in [r13575].

     

    Related

    Commit: [r13575]


Log in to post a comment.