Skip to content

ENH: Meson pybind11 build#1343

Merged
galabovaa merged 29 commits intoERGO-Code:latestfrom
HaoZeke:mesonPybind11
Jul 16, 2023
Merged

ENH: Meson pybind11 build#1343
galabovaa merged 29 commits intoERGO-Code:latestfrom
HaoZeke:mesonPybind11

Conversation

@HaoZeke
Copy link
Copy Markdown
Contributor

@HaoZeke HaoZeke commented Jul 2, 2023

Needs #1336. Closes #1321, #1320, and #1022. The wheels should be built correctly (i.e. built with cibuildwheel and repaired by auditwheel, delocate and delvewheel) for manylinux, musllinux, windows (arm_64), and macos (both arm64 and x86_64) [as seen here] so it should fix the existing broken wheel issues, that is it:

@galabovaa this will be hard to review in its current state, but after #1336 is merged and I rebase onto latest, the change-set will contain just the Python changes and it will be easier to review. @eli-schwartz had some great comments on the original PR.

The windows issues were known problems discussed upstream as well:

But for users consuming wheels from PyPI or building locally it isn't an issue.

@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 17:38 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 21:49 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 21:49 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 21:49 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 21:49 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 21:49 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 21:49 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 21:49 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 21:49 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 2, 2023 21:49 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 3, 2023 16:47 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 3, 2023 16:47 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 3, 2023 16:47 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 3, 2023 16:47 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 3, 2023 16:47 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 3, 2023 16:47 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 3, 2023 16:47 — with GitHub Actions Inactive
@HaoZeke HaoZeke temporarily deployed to pypi July 3, 2023 16:47 — with GitHub Actions Inactive
@HaoZeke
Copy link
Copy Markdown
Contributor Author

HaoZeke commented Jul 5, 2023

@galabovaa , I think this is ready for review, (the Julia docs is a separate issue, failing on master too) and I think its good to go.

Comment thread .gitignore Outdated
Comment on lines +1 to +28
# Created by https://www.toptal.com/developers/gitignore/api/meson
# Edit at https://www.toptal.com/developers/gitignore?templates=meson

### Meson ###
# subproject directories
/subprojects/*
!/subprojects/*.wrap

# Meson Directories
meson-logs
meson-private

# Meson Files
meson_benchmark_setup.dat
meson_test_setup.dat
sanitycheckcpp.cc # C++ specific
sanitycheckcpp.exe # C++ specific

# Ninja
build.ninja
.ninja_deps
.ninja_logs

# Misc
compile_commands.json

# End of https://www.toptal.com/developers/gitignore/api/meson
# #################
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This almost entirely looks buggy, so I don't know what toptal.com's rationale here is.

/subprojects/* is reasonable enough -- meson subprojects will be downloaded there so you only want to check in .wrap files. Appropriately, it is rooted in /.

The rest are all files that are created inside of the build directory. Excluding any one of them -- or even a bunch of them -- is missing the point that it fails to gitignore every possible *.o file, or your *.so / *.dll outputs, or many many other things generated as part of a build.

... it's also redundant due to https://mesonbuild.com/FAQ.html#how-do-i-ignore-the-build-directory-in-my-vcs since this is one of the Quality of Life advantages of using meson; you do not need to gitignore the build directory at all.

That maybe should be fixed somewhere in this generator tool.

Comment thread pyproject.toml Outdated
"pyomo>=6.0",
"wheel>=0.2",
]
requires = ["pybind11", "meson-python"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Due to the use of forcefallback, the pybind11 requirement here is installed but not used -- meson doesn't bother checking for the pybind11-config script installed by the pybind11 wheel into the pip / python -m build isolated build venv. It goes straight to initializing pybind11 as a meson subproject and retrieves the pybind11 declare_dependency() object.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah neat, I didn't realize that. Updated :)

Comment thread highspy/meson.build Outdated
HaoZeke and others added 2 commits July 8, 2023 02:54
Co-authored-by: eli-schwartz <eli-schwartz@users.noreply.github.com>
Co-authored-by: eli-schwartz <eli-schwartz@users.noreply.github.com>
@HaoZeke
Copy link
Copy Markdown
Contributor Author

HaoZeke commented Jul 15, 2023

@galabovaa does this look alright?

@eli-schwartz
Copy link
Copy Markdown
Contributor

Looks fine to me from a meson perspective.

@galabovaa
Copy link
Copy Markdown
Contributor

Looks good to me! Merging in latest. Thank you for the time and effort you spent on this.

I will now try to build highspy for all platforms with meson locally.

@alspadoni
Copy link
Copy Markdown

This is great guys! When will the next release of highspy be uploaded on pypi with all these fixes?

@jajhall
Copy link
Copy Markdown
Member

jajhall commented Jul 31, 2023

I don't know, but it might not be long now that @galabovaa is back from holiday

@AdeelK93
Copy link
Copy Markdown

Hi I'd love to see this on pypi! I'm building from source and working off an open PR on python-mip. Getting working wheels on pypi would make it a lot easier to use this excellent solver!

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.

6 participants