-
Notifications
You must be signed in to change notification settings - Fork 28
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
Generate bdist ZIP members via Meson #199
Merged
Merged
Conversation
This file contains 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
We're about to use that name for something else. Signed-off-by: Benjamin Gilbert <[email protected]>
It's convenient for Meson to also know the version number. Meson can retrieve the version number from a command, so implement one that reads an environment variable set by build.sh, with an autogenerated fallback in case Meson is invoked directly. Then have build.sh read the default version number from the same command, rather than calculating it independently. Signed-off-by: Benjamin Gilbert <[email protected]>
Meson knows what subprojects we're using in this build, which will vary by platform. Rather than syncing that information back into build.sh, just generate VERSIONS.md from Meson. For overridden subprojects that are Git repos, get the version string from `git describe`. Meson already has the compiler version string, so use that rather than fetching it from the compiler. For Binutils we still need to fetch the version string directly. Detect the linker command in Meson (specified in the cross file, with a fallback to PATH) and pass it via an environment variable so we don't need an explicit command-line argument. Also add support for detecting the Clang version for macOS. Give up on maintaining some sort of logical order for the dependency list, and sort alphabetically. The order was always fairly arbitrary. Meson passes the MESONINTROSPECT env var to many external command invocations, giving the correct invocation of `meson introspect`. However, this doesn't happen for custom targets, so collect the value via a run_command() invocation and then pass it to the custom target. Set build_always_stale to ensure we don't package an out-of-date VERSIONS.md. Bump the minimum Meson version for `meson introspect --compilers` support. Signed-off-by: Benjamin Gilbert <[email protected]>
mypy assumes argparse.Namespace object attributes have type Any, but the types of arguments often matter for typechecking the program as a whole. Add a TypedArgs base class which can be subclassed to hold a typed field for each command-line argument, with validation wrappers that verify that the argument configuration passed to parser.add_argument() matches the corresponding field type. Also add a pre-commit check to ensure argparse isn't invoked directly. Signed-off-by: Benjamin Gilbert <[email protected]>
The latter is supported by Meson >= 1.1.0, which we're now requiring. Signed-off-by: Benjamin Gilbert <[email protected]>
Create split debuginfo and check exported symbols in Meson rather than in the build.sh wrapper. Support all three platforms. Link to debuginfo using a bare filename rather than an absolute path, causing gdb to enable directory search semantics for finding the debuginfo. On Linux and macOS, also update the slidetool and JNI RPATHs to match the bdist directory layout. To do this, the Meson custom_target needs to be able to find the slidetool executable in the build directory. Backport an OpenSlide commit to store the exe object in a Meson variable. Also add a Meson rule to copy openslide.jar to the artifacts directory, so build.sh only has to look for output artifacts in one place. Signed-off-by: Benjamin Gilbert <[email protected]>
Built import libraries cannot normally be referenced via a Meson object; they're just a side effect of building a DLL. Add a custom target that copies the OpenSlide import library to a new location and returns a reference that can be used as an input to other artifacts. Use that copy when building the bdist ZIP. Signed-off-by: Benjamin Gilbert <[email protected]>
Meson knows what subprojects we're using in this build, which will vary by platform. Rather than syncing that information back into build.sh, generate the licenses directory from Meson. Set build_always_stale to ensure we don't package an out-of-date licenses directory. Signed-off-by: Benjamin Gilbert <[email protected]>
DCO signed off ✔️All commits have been signed off. You have certified to the terms of the Developer Certificate of Origin, version 1.1. In particular, you certify that this contribution has not been developed using information obtained under a non-disclosure agreement or other license terms that forbid you from contributing it under the GNU Lesser General Public License, version 2.1. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Generate
VERSIONS.md
and thelicenses
directory as Meson artifacts. Meson knows which subprojects are enabled in the current build. When we add additional platforms, they'll have different dependencies, so Meson is in a better position to produce these files.Give up on maintaining some sort of logical order for the dependency list, and sort
VERSIONS.md
alphabetically. The order was always fairly arbitrary.Move postprocessing of native binaries into Meson, adding support for Linux and macOS. Link to debuginfo using a bare filename rather than an absolute path, causing gdb to enable directory search semantics for finding the debuginfo. On Linux and macOS, also update the slidetool and JNI RPATHs to match the bdist directory layout.
For convenience, wrap the OpenSlide import library as a Meson object, and set the Meson project version from the
pkgver
.