Build in MingW fails under very specific circumstances - What to do? #3914
              
                Unanswered
              
          
                  
                    
                      theCapypara
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 1 comment
-
| 
         Use https://github.com/marketplace/actions/debugging-with-tmate for debugging.  | 
  
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Sorry for the bad title, but this is a hairy issue:
I'm trying to compile
cairocffiwith Python 3.11 for Msys2 Mingw. This used to work in the past, however they switched to the new packaging structure usingpyproject.toml(before they usedsetup.py.The build fails in
distutils/_msvccompiler.pywhere it shouldn't even end up in afaik. (distutils.errors.DistutilsPlatformError: --plat-name must be one of ('win32', 'win-amd64', 'win-arm32', 'win-arm64')).The issue and problem description is here, but I'll summarize my findings below:
Kozea/cairocffi#213
try_compiletry_compilein setuptools tries to get the default compiler via distutils, which uses sys.platform and somehow* ends up thinking the MSVC version of Python is used and returns that compilerDoes anybody have any idea where the bug is here? I guess the way
cffitries to determine if MSVC is used is already kinda dumb, but I think there's a bug in setuptools and/or distutils here somewhere. From what I can tell by reading the code, I think it somehow must end up manipulatingsys.platformor a related variable, because otherwise I don't know how this would happen. Also everything worked back whencairocffiwas still usingsetup.py!I sadly don't have access to a physical Windows machine, and debugging via GitHub actions isn't really possible, so if anybody got any idea, that'd be great!
*edit: Actually the platform and osname can be passed in, so it might be set somewhere else.
Beta Was this translation helpful? Give feedback.
All reactions