Skip to content

Update Windows development instructions #3770

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

Merged
merged 1 commit into from
Mar 28, 2025
Merged

Update Windows development instructions #3770

merged 1 commit into from
Mar 28, 2025

Conversation

amolenaar
Copy link
Member

@amolenaar amolenaar commented Feb 22, 2025

PR Type

What kind of change does this PR introduce?

  • Bug fix
  • Feature
  • Chore (refactoring, formatting, local variables, other cleanup)
  • Documentation content changes

What is the new behavior?

I checked the windows instructions. Made a few minor changes (e.g. python versions).

One thing I noticed is that I only need to install pycairo from gvsbuild. PyGObject works fine, at least on my setup.

It also works if I disallow installing the precompiled binaries for pycairo:

poetry config --local installer.no-binary pycairo
poetry install

Maybe those are alternatives to force-installing the builds made with GVSBuild. We can also add this bit of configuration in a poetry.toml file. Is that file supposed to be checked in?

BTW. I do not see any instructions on installing compilers. Is that done automatically nowadays?

@amolenaar amolenaar requested a review from danyeaw February 22, 2025 19:09
@danyeaw
Copy link
Member

danyeaw commented Feb 25, 2025

Hi @amolenaar, I think you are right, we probably don't need to use the Gvsbuild generated wheels at all, because Gaphor has this shim in place:
https://github.com/gaphor/gaphor/blob/main/gaphor/windowsshim.py

I would like to get rid of this shim by building Windows Wheels since asking every user of PyGObject to create a load DLL shim isn't a great experience, but that shouldn't prevent us from simplifying the dev environment instructions. We'll probably need to test what the minimum things needed to pip install the sdist for PyGObject and pycairo.

The no-binary is needed for pycairo because they are publishing statically linked wheels of pycairo with cairo only and no GTK.

@amolenaar
Copy link
Member Author

I would like to get rid of this shim by building Windows Wheels since asking every user of PyGObject to create a load DLL shim isn't a great experience

Not only that. It'll require every user of PyGObject to have a C compiler installed as well. Creating a wheel is also tricky business, since we need GLib and GIRepository fot PyGObject to work. Also, we need them as DLL's.

So, having pycairo built from source can indeed simplify the Windows development experience.

Shall I change the docs accordingly? Do we need the instructions for MSVC back in place?

@danyeaw
Copy link
Member

danyeaw commented Feb 27, 2025

Hi @amolenaar, I wonder if there is a hybrid approach which may be what you are suggesting:

  1. Download GTK compiled with Gvsbuild zip and extract it
  2. Set up some environment variables
  3. Install minimum dependencies like MSVC so that you can build PyGObject and pycairo from source

@amolenaar
Copy link
Member Author

That should work, I suppose.

That's simpler than having to install 2 local wheels every time you did a poetry install.

We used to have instructions for setting up MSVC in our docs. Should we put it back?

@danyeaw
Copy link
Member

danyeaw commented Feb 27, 2025

@amolenaar, yes, I think so. Then I'm going to make it my mission to finish this build wheels for PyGObject project :)

@amolenaar
Copy link
Member Author

@amolenaar, yes, I think so. Then I'm going to make it my mission to finish this build wheels for PyGObject project :)

It won't be easy, due to the dependency on GLib, GObject and GIRepository. But there must be a way. But then, having a statically linked pycairo doesn't help either.

Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @amolenaar!

@danyeaw danyeaw merged commit cc92b52 into main Mar 28, 2025
24 checks passed
@danyeaw danyeaw deleted the window-instructions branch March 28, 2025 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants