Commit Graph

35 Commits

Author SHA1 Message Date
Marcin Serwin ad04f4ead9 hdf5: don't throw if the pkg-config doesn't support --list-all 2025-03-20 09:23:28 -07:00
Eli Schwartz f5da446bb9
dependencies: hdf5: mark configtool dependency not-found for cmake build
When hdf5 is built with cmake instead of autotools, it makes a number of
weird changes. What we care about in particular is that h5cc exists but
doesn't work -- it happily ignores -show and tries to compile stuff,
then leaves us with a dependency that has no libraries, and fails when
running `ninja`.

See: #12748
2024-01-31 21:40:14 -05:00
Dylan Baker e991c4d454 Use SPDX-License-Identifier consistently
This replaces all of the Apache blurbs at the start of each file with an
`# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing
uses to be consistent in capitalization, and to be placed above any
copyright notices.

This removes nearly 3000 lines of boilerplate from the project (only
python files), which no developer cares to look at.

SPDX is in common use, particularly in the Linux kernel, and is the
recommended format for Meson's own `project(license: )` field
2023-12-13 15:19:21 -05:00
Eli Schwartz 90ce084144
treewide: automatic rewriting of all comment-style type annotations
Performed using https://github.com/ilevkivskyi/com2ann

This has no actual effect on the codebase as type checkers (still)
support both and negligible effect on runtime performance since
__future__ annotations ameliorates that. Technically, the bytecode would
be bigger for non function-local annotations, of which we have many
either way.

So if it doesn't really matter, why do a large-scale refactor? Simple:
because people keep wanting to, but it's getting nickle-and-dimed. If
we're going to do this we might as well do it consistently in one shot,
using tooling that guarantees repeatability and correctness.

Repeat with:

```
com2ann mesonbuild/
```
2023-08-11 13:41:03 -04:00
Xavier Claessens 183e4b8e90 PkgConfigDependency: Move CLI handling into its own abstraction
This makes the code cleaner and will allow to have other implementations
in the future.
2023-08-03 16:27:52 -04:00
George Sedov 0c2b616183 hdf5: remove C sub-dependency for config tool
the config tool provided by HDF5 correctly
links to the C libraries without explicit
sub-dependancy
2023-07-23 13:52:39 -04:00
George Sedov b6e306ea5b hdf5: fix wrong env values for config tool 2023-07-23 13:52:39 -04:00
Eli Schwartz b8b2d87567
dependencies: switch the delayed-import mechanism for custom dependencies
Simply store the module it is expected to be found in. That module then
appends to the packages dict, which guarantees mypy can verify that
it's got the right type -- there is no casting needed.
2023-06-26 13:10:33 -04:00
Eli Schwartz 680b5ff819
treewide: add future annotations import 2023-02-01 17:01:30 -05:00
Eli Schwartz 48f08a7c49
hdf5 dependency: correctly use machine files and respect cross
We do some magic to figure out what names of pkg-config dependencies to
even search for. This magic simply checked for `pkg-config` the $PATH
executable, which was broken in a variety of ways and had a comment to
that effect.
2022-12-04 17:56:03 -05:00
Eli Schwartz c95001b130
dependencies: make the hdf5 dependency use Popen_safe
It is, after all, "safe". ;) That's why it exists. There's no reason to
think listing all pkg-config entries cannot print unicode descriptions,
it's absolutely possible, and we should handle it properly if we
encounter it.
2022-11-03 00:26:28 -04:00
Dudemanguy 8b3a54e508 dependencies: cleanup kwargs.get('static') usage
In a couple of spots, kwargs.get('static', False) was being
unneccesarily used. In these spots, we can just use self.static instead
which is already inherited from the ExternalDependency. In additional,
the python system dependency oddly has a kwargs.get('static', False)
line which overrides the self.static in that dependency for no real
reason. Delete this line too.
2022-05-03 23:03:56 -04:00
Eli Schwartz 3990dc6d64 flake8: fix indentation style 2022-01-27 10:48:01 -08:00
Eli Schwartz 751f84405e
pyupgrade --py37-plus 2022-01-10 18:36:56 -05:00
Eli Schwartz 4f4259de1b hdf5 dependency: check for alternative config-tool names
Depending on whether hdf5 is compiled with parallel support, the
same config-tool program may be installed with a mysterious "p" in the
name. In this case, dependency lookup will totally fail, unless of
course you use the superior pkg-config interface in which case you get a
predictable name.

Work around this insanity by checking for both types of config-tool
name.

Fixes #9555
2021-11-17 23:07:14 +02:00
Eli Schwartz 87e13af1c8
apply flake8 fixes for unused imports and missing imports 2021-09-14 15:55:07 -04:00
Daniel Mensinger 2263a84d07 typing: Rename some variables 2021-06-09 09:46:37 +02:00
Daniel Mensinger 25875ae0d3 typing: Fully annotate dependencies.{detect,factory} + some other fixes 2021-06-06 20:30:24 +03:00
Daniel Mensinger 95b70bcb97 deps: Split dependencies.base
Split the Factory and dependency classes out
of the base.py script to improve maintainability.
2021-06-03 10:23:27 -07:00
Eli Schwartz 6a0fabc647
mass rewrite of string formatting to use f-strings everywhere
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04 17:16:11 -05:00
Eli Schwartz 4340bf34fa
various python neatness cleanups
All changes were created by running

"pyupgrade --py3-only --keep-percent-format"

and committing the results. I have not touched string formatting for
now.

- use set literals
- simplify .format() parameter naming
- remove __future__
- remove default "r" mode for open()
- use OSError rather than compatibility aliases
- remove stray parentheses in function(generator) scopes
2021-03-04 17:11:26 -05:00
Michael Kuhn 2d8d21d5bc hdf5: get include directory from config-tool
hdf5's config-tools will not show compile arguments (including the
include directory) if called without `-c`. Make sure to get both the
compile and link arguments.
2021-02-26 23:04:02 +02:00
Dylan Baker a2055ad18b import MachineChoice from mesonlib
there are a couple of places importing it from envconfig, which is not
correct. It's defined in mesonlib, and then imported into envconfig.
2021-01-11 11:15:06 -08:00
Dylan Baker f6672c7a19 use real pathlib module
We added the _pathlib module to work around defeciencies in python 3.5's
implementation, since we now rely on 3.6 lets drop this
2020-11-20 15:08:40 -08:00
Daniel Mensinger 1dfaccfd91 pathlib: Fix resolve() by overriding it in Python 3.5 2020-10-04 10:45:48 +02:00
Dylan Baker 54329eeed7 dependencies/hdf5: Use the correct compilers for the machine
Instead of the default ones, this is especially important when cross
compiling or when using compilers that aren't compatible with the
default ones.
squash! dependencies/hdf5: Use the actual system compilers
2020-09-25 11:11:46 -07:00
Dylan Baker b7cb30e175 dependencies/hdf5: Convert to a dependency_factory
Instead of a mega dependency that does everything, use a dependency
factory for config-tool and pkg-config
2020-09-25 11:11:46 -07:00
Daniel Mensinger 62f7642a61
typing: fix dependencies for new follow_imports 2020-09-08 20:15:58 +02:00
Daniel Mensinger 1217cf9a3b
typing: fully annotate boost and hdf5 deps 2020-09-08 20:15:57 +02:00
William F Godoy 847d652c4e Add h5cc shlib argument for correctly link hdf5 libraries
respect "static" key in dependency function
-shlib for static dependency
-noshlib for static dependency
2020-08-11 09:42:18 -07:00
Dylan Baker fd892ad7ce dependencies: Make Dependency initializer signatures match
Currently PkgConfig takes language as a keyword parameter in position 3,
while the others take it as positional in position 2. Because most
dependencies don't actually set a language (they use C style linking),
using a positional argument makes more sense. ExtraFrameworkDependencies
is even more different, and duplicates some arguments from the base
ExternalDependency class.

For later changes I'm planning to make having all of the dependencies
use the same signature is really, really helpful.
2020-01-29 09:11:24 -08:00
Michael Hirsch, Ph.D ff822990d1 bugfix: hdf5 depenedency: make sure variable is always defined 2020-01-08 18:59:48 +02:00
Michael Hirsch, Ph.D f1d370247f
dependencies: refactor to use methods properly 2019-12-19 11:52:32 -05:00
Jussi Pakkanen 39db7b1afc Fail gracefully detecting hdf5 if pkg-config is not available. 2019-12-17 15:10:13 +02:00
Michael Hirsch, Ph.D c02593fddc HDF5: make much more robust across platforms
This addresses various real-world problems with HDF5 pkg-config, including

* hdf*.pc with package versions as part of the filename
* malformed hdf*.pc missing the commonly-used HDF5 HL module

---

Additionally, this refactors more complicated dependencies such as
HDF5 and OpenMPI. This may help us deduplicate internal dependency
code in the future.

HDF5 selftest: improve platform-agnostic test

ci: init demo github action for HDF5 framework

ci Actions: hold off on MSYS2 for now [skip ci]

hdf5: ensure C libraries always included

ci: mac hdf5--use clang+gfortran
2019-11-28 12:51:58 +02:00