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

WIP: Patches for clean Fedora RPM builds that pass unit tests #123

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Commits on May 15, 2022

  1. Don't fail silently in VersionInfo(), print useful message

    Having version.hpp throw an exception when built against a malformed
    version number (due to, eg, not having the git tag available in an
    automated package build from source bundle) results in _init_ failing
    during an otherwise apparently successful dlopen(), as well as the
    netgen-mesher executable crashing before hitting main().
    
    This patch both forces an abort and prints a helpful message alerting
    the builder/user that something went wrong instead of handing over
    either a coredump or a weirdly malfunctioning library with no apparent
    cause.  Hopefully this will avoid a repeat of automated Fedora builds
    shipping nonfunctional Netgen RPMs for several years!
    xiphmont committed May 15, 2022
    Configuration menu
    Copy the full SHA
    e9eae56 View commit details
    Browse the repository at this point in the history
  2. CMake enhancements for automated external package building

    Add explicit defaults where missing for clarity.
    
    Support passing in NETGEN_GIT_VERSION for use when building, eg, RPM
    packages using rpkg, which requires building from an untagged source
    bundle, that is, not directly from a git checkout.
    
    Add option to choose build against internal or external Pybind11; add
    cmake module to find and configure against system Pybind.
    
    re-add versioning of shared library files.
    
    Add section for GCC-specific options setting (right now, to turn off
    harmless warnings).
    
    Warn if pybind11_stubgen is not found.
    
    Adjust stubgen paths to work when build is not in-place in the source tree.
    xiphmont committed May 15, 2022
    Configuration menu
    Copy the full SHA
    b82796e View commit details
    Browse the repository at this point in the history
  3. Alter name use of 'netgen' and 'netgen-mesher'

    The name of the 'netgen' executable collides with an older UNIX pcb
    trace routing application also named 'netgen'.  Fedora, for this
    reason, renames this mesher package to 'netgen-mesher' and the
    executable, likewise, to 'netgen-mesher'.  I propose the same change
    here.
    
    Ironically though, the current python module is already named
    'netgen-mesher', which complicates loading of the module as 'netgen',
    often resulting in it being unfindable.  For this reason, I similarly
    reverse the usage, renaming the python module from 'netgen-mesher' to
    'netgen'.
    xiphmont committed May 15, 2022
    Configuration menu
    Copy the full SHA
    5d0e69c View commit details
    Browse the repository at this point in the history
  4. Adjust python module path in __init__, add checks to pytest

    Adjust path setup of the python modules in __init__ such that it's
    possible to run pytests from a mock root during package build/test.
    
    Also add checks to pytest/CMakelists.txt to make sure pytest abd check
    are present instead of failing with an inscrutible traceback if
    they're not installed or usable.
    xiphmont committed May 15, 2022
    Configuration menu
    Copy the full SHA
    97d3c1c View commit details
    Browse the repository at this point in the history
  5. Fix nullptr deref in archive

    Hardened toolchains (eg, mainline Fedora) no longer tolerate null
    derefs that were silently trapped/ignored in earlier versions.  This
    eliminates a nullptr deref in archive.hpp that was failing several
    unit tests (and causing crashes) when trying to manipulate
    default-constructed archive objects.
    xiphmont committed May 15, 2022
    Configuration menu
    Copy the full SHA
    5ee4e43 View commit details
    Browse the repository at this point in the history
  6. Correct deletion of non-allocated memory in ngarray

    A default-constructed (or just empty) ngarray will have 'ownmem' set
    despite not having an allocated data array.  Destructor would then
    trigger an abort.
    xiphmont committed May 15, 2022
    Configuration menu
    Copy the full SHA
    6ba4a6e View commit details
    Browse the repository at this point in the history
  7. Two nullptr deref fixes in table

    Don't delete memory that wasn't allocated.
    
    Similarly, we can't deref the first element of an array that was never
    allocated.
    xiphmont committed May 15, 2022
    Configuration menu
    Copy the full SHA
    ae87c70 View commit details
    Browse the repository at this point in the history
  8. Type corrections in rw_cgns

    Several occurrences of int -> cgsize_t
    xiphmont committed May 15, 2022
    Configuration menu
    Copy the full SHA
    6f5eae8 View commit details
    Browse the repository at this point in the history
  9. Export additional classes to provide typeinfo visibility

    Add DLL_HEADER to Surface, Primitive, and STLTopology in order to make
    typeinfo available to link stage (otherwise, link fails with GNU ld).
    xiphmont committed May 15, 2022
    Configuration menu
    Copy the full SHA
    2da94c3 View commit details
    Browse the repository at this point in the history
  10. Numerous changes to python bindings for clean stub generation

    I'm uncertain about earlier/alternate versions, but the current
    version of mainline pybind11_stubgen requires a number of changes in
    the python binding cpp files to succeed:
    
    __repr__ implementation added for some basic types
    
    Added default descriptions via py::arg_v variant syntax for those
    cases where a __repr__ implementation made no sense (eg, for a default
    sonstructor of a complex type)
    
    Moved class declarations to precede first use in arguments/returns
    
    Added trailing default arguments, so that mandatory args did not
    follow optional args (without resorting to kwargs trickery).
    xiphmont committed May 15, 2022
    Configuration menu
    Copy the full SHA
    6159d89 View commit details
    Browse the repository at this point in the history
  11. Add a fedora package spec and setup

    Build all Netgen RPMs from cli via:
    rpkg local --spec package/fedora/netgen-mesher-bleed.spec
    from the toplevel source directory
    xiphmont committed May 15, 2022
    Configuration menu
    Copy the full SHA
    da386ea View commit details
    Browse the repository at this point in the history