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

Rework archive names and version numbering; generate archives through Meson #200

Merged
merged 5 commits into from
Dec 7, 2023

Commits on Dec 6, 2023

  1. Generate bdist archive entirely through Meson

    Include support for building Linux and macOS tar.xz archives.  Change the
    filename of the Windows ZIP to fully spell out the OS and CPU
    architecture, and to place the version number before the platform name.
    Add a machine file property specifying the platform name for use in the
    archive filename.
    
    By generating the archive inside Meson, we can avoid running
    `meson install` and copying files out of the resulting directory tree.
    Remove install configuration for artifacts we've generated.
    
    Since we're not installing, we need to handle operations that Meson would
    normally perform at install time, such as updating RPATHs (in
    postprocess-binary.py), creating compatibility symlinks to libraries (in
    write-bdist.py), and copying the import library (in
    write-import-library.py).  We also need to extract the external headers
    from the OpenSlide subproject, which is supported via the existing
    openslide-bdist.patch.
    
    Signed-off-by: Benjamin Gilbert <[email protected]>
    bgilbert committed Dec 6, 2023
    Configuration menu
    Copy the full SHA
    d454607 View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2023

  1. Generate sdist archive with meson dist

    Reuse existing Meson functionality, rather than manually maintaining a
    list of files to include in the archive.  As a consequence, rather than
    shipping a nested compressed tarball for each dependency, ship the actual
    unpacked source trees.
    
    Meson supports tar.xz, tar.gz, and ZIP.  It's no longer necessary for the
    sdist archive format to be natively supported by Windows, since Windows
    builds now always use a Linux container.  ZIP is less efficient because
    each file is compressed individually, so avoid it.  tar.xz would be ideal,
    but PyPI requires tar.gz, and it would be nice to reuse the same sdist
    archive when we add support for Python wheels.  The source archive
    shouldn't be used too often, so avoid generating both tar.gz and tar.xz
    archives and accept the lower compression ratio.
    
    Embed the currently configured version number in the generated source
    archive.  When building from a source archive, allow overriding the
    version in the usual way; otherwise append "-local" to the embedded
    version, if missing, to make it clear that the resulting bdist is a
    rebuild.  This prevents builds of old sdists from using a version derived
    from the current date.
    
    Normally, each platform build only enables the dependencies needed for
    that platform.  The Windows build currently enables all dependencies, but
    that may not always be true.  Add a Meson option that enables all
    dependencies, for use when generating sdist archives, so they all end up
    in the tarball.
    
    When working from an unpacked sdist archive, avoid purging subproject
    sources, since those are now canonical.
    
    Closes: openslide#159
    Signed-off-by: Benjamin Gilbert <[email protected]>
    bgilbert committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    c8c9c06 View commit details
    Browse the repository at this point in the history
  2. Redo versioning scheme

    The "-" in the current versioning scheme (for builds other than official
    releases) isn't compatible with Python package versioning:
    
        https://packaging.python.org/en/latest/specifications/version-specifiers/
    
    This will matter when we're releasing Python wheels.  Also, datestamps
    don't make it especially clear what's changed since the last release.
    
    Define an openslide-bin version consisting of the OpenSlide version
    number, plus a fourth component which represents the openslide-bin package
    release and starts from 1.  For builds other than official releases,
    append "+" followed by a suffix, which normally consists of a datestamp
    plus ".local" but can be overridden with the "-x" option.  Nightly builds
    will use a datestamp plus ".nightly".
    
    Update the version embedding mechanism for sdist archives to embed the
    suffix (or lack of one) instead of the complete version string.
    
    Add a `version` subcommand to report the calculated version string,
    optionally with the specified suffix.
    
    Fixes: openslide#193
    Signed-off-by: Benjamin Gilbert <[email protected]>
    bgilbert committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    c18933e View commit details
    Browse the repository at this point in the history
  3. Calculate OpenSlide version suffix automatically

    Confusingly, we now have two suffixes: the one appended to the version
    number in artifact names (`+<datestamp>.local`) and the one appended to
    the OpenSlide version number (7 characters of the OpenSlide commit hash).
    build.sh can calculate the latter by examining the override directory,
    rather than requiring CI to pass it in, so do that to simplify.
    
    Signed-off-by: Benjamin Gilbert <[email protected]>
    bgilbert committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    a46b81f View commit details
    Browse the repository at this point in the history
  4. workflows: remove a couple references to Windows

    We're about to add other platforms.
    
    Signed-off-by: Benjamin Gilbert <[email protected]>
    bgilbert committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    5cbea74 View commit details
    Browse the repository at this point in the history