Skip to content
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

Build wheels using vcpkg for Linux/MacOS #55

Merged
merged 69 commits into from
Mar 18, 2022
Merged

Conversation

brendan-ward
Copy link
Member

Based off #49

uses: pypa/[email protected]
env:
# should be automatically detected?
GDAL_INCLUDE_PATH: "/usr/local/include"
Copy link
Member

Choose a reason for hiding this comment

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

I don't think those will be automatically detected, because vcpkg does not a "system-wide" install AFAIK (so I would find it strange that this gets installed in /usr/local/include, but no idea for linux; on windows this is installed in a vcpkg specific directory)

Copy link
Member

Choose a reason for hiding this comment

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

According to https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#environment-variables, it is actually in /usr/local where vcpkg itself gets installed, but not fully sure where exactly it would install binaries.

Copy link
Member Author

Choose a reason for hiding this comment

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

These were placeholders from my more manual attempt at building GDAL; will be watching the GH Action to see where these get placed...

pyproject.toml Outdated

[tool.cibuildwheel.linux.environment]
GDAL_INCLUDE_PATH = "/vcpkg/packages/gdal_x64-linux/include"
GDAL_LIBRARY_PATH = "/vcpkg/packages/gdal_x64-linux/lib"
Copy link
Member

Choose a reason for hiding this comment

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

If works similar as on windows, the path might also be something like /vcpkg/installed/x64-linux/lib

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, that looks to be it.

@brendan-ward
Copy link
Member Author

Well, after much hacking about to get vcpkg working with cache (missed a few simple and obvious things), it looks like we actually need to install vcpkg and do the entire build within the Linux docker container used for cibuildwheel (docs).

@brendan-ward brendan-ward marked this pull request as ready for review March 17, 2022 17:00
@brendan-ward brendan-ward changed the title Build wheels using vcpkg for Linux / MacOS Build wheels using vcpkg for MacOS Mar 17, 2022
@brendan-ward
Copy link
Member Author

I think this is ready to squash & merge. Linux builds are dropped from here and will be added via #57.

I made a few minor tweaks to Windows builds to get wheel tests to pass and fix name of test job.

@martinfleis
Copy link
Member

Do you know the behaviour of macos-10.15 x86_64 wheel on macOS 11 and 12 (with Intel)? Does it work, does it need to be renamed and then it works... 10.15 is from 2019, we should make sure that the wheel works on recent versions of the OS, putting M1 versions aside for a moment.

If it has not been tested, I can try that on my partner's laptop.

@brendan-ward
Copy link
Member Author

Even though we're only building on macos-10.15, we are still testing against that as well as macos-11, so I think we're OK.

@jorisvandenbossche
Copy link
Member

@brendan-ward you removed the workflow file for Linux, but not all other changes for Linux (the env variables, the triplet file, the dockerfile). Now, I think it is also OK to actually leave the Linux support in here (in the end all the relevant discussion is also here). The current version is already creating valid, working wheels, they are only manylinux_2_27 wheels instead of the more compatible 2_17 (2014) wheels.
And then we can keep #57 specifically for making them 2_17 (2014) compatible.

(or otherwise remove everything linux related)

@brendan-ward
Copy link
Member Author

Yeah, forgot those.

I had interpreted #57 as replacing the Linux infrastructure we had in this branch? I assumed we would merge this, then merge #57, so we'd end up having the full suite available. Then once all are in, we could do another PR to consolidate the build yml files...

@brendan-ward brendan-ward changed the title Build wheels using vcpkg for MacOS Build wheels using vcpkg for Linux/MacOS Mar 18, 2022
@jorisvandenbossche
Copy link
Member

To be clear, I am also fine with merging Mac support separately, it was just that now it was a bit in between.

I had interpreted #57 as replacing the Linux infrastructure we had in this branch? I

My original intention was just to experiment with the custom zlib port, and doing that separately to not mess up this PR because I had no idea whether it would work. It only turned out to be working very nicely from the first try :)

Now, keeping that separate might still have value, so that the zlib port is a nicely focused PR, so that it makes it easier to understand later what we did there.

MANIFEST.in Outdated
@@ -2,4 +2,7 @@ include versioneer.py
include pyogrio/_version.py
include pyogrio/*.pyx pyogrio/*.pxd
exclude pyogrio/*.c
include LICENSE
include pyproject.toml
exclude MANIFEST.in
Copy link
Member

Choose a reason for hiding this comment

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

I am going to change this back (I think it is a left-over from some experimentation to get the tests working?), as my understanding is that this should not influence wheels but only sdist. This might still be a valid change for the sdist (didn't check that here), but then let's do that in a separate PR focused on sdist.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's fine; I added that while trying to get the pytest tests working, based on adapting what we have in pygeos. Certainly fine to deal with it in later PR.

@jorisvandenbossche
Copy link
Member

I tried to clean up a few things, but not with that much of success (the github caching didn't seem to work with a direct docker buildx call, so reverted back to the docker-build-push action, and we can't define global and platform specific env variables at the same time in pyproject.toml).

But so if we do the consolidation in a follow up PR, I think this is indeed ready to merge.

@jorisvandenbossche jorisvandenbossche merged commit ef71bba into main Mar 18, 2022
@jorisvandenbossche jorisvandenbossche deleted the vcpkg_linux_macos branch March 18, 2022 14:55
@jorisvandenbossche
Copy link
Member

OK, merged this! Will open a follow-up to consolidate in a single file, and update #57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants