-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
ENH: Vendor meson for multi-target build support #24379
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
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
BLD: build with our numpy fork of meson
- Loading branch information
commit 4d05cd1ef67f6c9b4f0bb63d69d388f7651c62bf
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
import sys | ||
import pathlib | ||
|
||
from mesonpy import ( | ||
build_sdist, | ||
build_wheel, | ||
build_editable, | ||
get_requires_for_build_sdist, | ||
get_requires_for_build_wheel, | ||
get_requires_for_build_editable, | ||
) | ||
|
||
|
||
# The numpy-vendored version of Meson. Put the directory that the executable | ||
# `meson` is in at the front of the PATH. | ||
curdir = pathlib.Path(__file__).parent.resolve() | ||
meson_executable_dir = str(curdir.parent.parent / 'entrypoint') | ||
os.environ['PATH'] = meson_executable_dir + os.pathsep + os.environ['PATH'] | ||
|
||
# Check that the meson git submodule is present | ||
meson_import_dir = curdir.parent.parent / 'meson' / 'mesonbuild' | ||
if not meson_import_dir.exists(): | ||
raise RuntimeError( | ||
'The `vendored-meson/meson` git submodule does not exist! ' + | ||
'Run `git submodule update --init` to fix this problem.' | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
import re | ||
import sys | ||
import pathlib | ||
|
||
|
||
# The numpy-vendored version of Meson | ||
meson_dir = str(pathlib.Path(__file__).resolve().parent.parent / 'meson') | ||
sys.path.insert(0, meson_dir) | ||
|
||
from mesonbuild.mesonmain import main | ||
import mesonbuild | ||
if not 'vendored-meson' in mesonbuild.__path__[0]: | ||
# Note: only the print statement will show most likely, not the exception. | ||
# If this goes wrong, it first fails inside meson-python on the `meson | ||
# --version` check. | ||
print(f'picking up the wrong `meson`: {mesonbuild.__path__}') | ||
raise RuntimeError('incorrect mesonbuild module, exiting') | ||
|
||
if __name__ == '__main__': | ||
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) | ||
sys.exit(main()) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.