Commit Graph

44 Commits

Author SHA1 Message Date
Xavier Claessens 807cbcb350 external-project: Add depends kwarg
The unit test was racy but surprisingly never failed on CI. The reason
is we need to ensure ninja build somelib.so before running `make` into
the external project.
2022-06-17 18:56:13 -04:00
Xavier Claessens 18bec0d3e3 pkgconfig: Use EnvironmentVariables to build PKG_CONFIG_* env
The new get_env() method that returns an EnvironmentVariables object
will be needed in next commit that will pass it to CustomTarget.

This has the side effect to use the proper os specific path separator
instead of hardcoding `:`. It is the obvious right thing to do here, but
has caused issues in the past. Hopefully issues have been fixed in the
meantime. If not, better deal with fallouts than keep doing the wrong
thing forever.
2022-04-30 15:01:28 -04:00
Xavier Claessens e33ec88ac7 Pass environment down to base Target class 2022-03-29 16:10:28 -04:00
Remi Thebault 4fe6f0dd29 add D features to InternalDependency 2022-03-03 08:42:56 -08:00
Eli Schwartz d39b330075 clean up FeatureCheck signature to move location to use time
The point of a .use() function is because we don't always have the
information we need to use a feature check, so we allow creating the
feature and then storing it for later use. When implementing location
checks, although it is optional, actually using it violated that design.

Move the location out of the init method for FeatureCheck itself. It
remains compatible with all cases of .single_use(), but fix the rest up.
2022-03-01 12:13:24 -08:00
Dylan Baker 11f9638035 build: replace kwargs in CustomTarget initializer
Because we don't want to pass the Interpreter kwargs into the build
layer. This turned out to be a mega commit, as there's really on elegant
way to make this change in an incremental way. On the nice side, mypy
made this change super easy, as nearly all of the calls to
`CustomTarget` are fully type checked!

It also turns out that we're not handling install_tags in custom_target
correctly, since we're not converting the boolean values into Optional
values!
2022-01-28 15:53:20 -05:00
Eli Schwartz d73e81c77b
Popen_safe and wrappers can accept os.PathLike for cwd
Do not require users to convert it to a string first. This is a waste of
time and effort for exactly the same results.
2022-01-26 22:08:09 -05:00
Eli Schwartz 32821be623
add location nodes to some Feature calls 2021-11-20 20:48:30 -05:00
Xavier Claessens 7a12c911bf Remove duplicated CEXE_MAPPING table 2021-10-29 22:42:21 +03:00
Eli Schwartz 8947352889 fix various flake8 whitespace errors 2021-10-27 09:51:52 -04:00
Dylan Baker 4c00e63574 modules/external_project: use typed_kwargs
Which resolves all of the remaining typing issues.
2021-10-04 19:33:43 -07:00
Dylan Baker f228e0244b mdoules/external_project: fix most of the mypy warnings/errors 2021-10-04 19:33:43 -07:00
Dylan Baker 7c3f256b14 modules/external_project: clean up and sort modules 2021-10-04 19:33:43 -07:00
Dylan Baker c3c30d4b06 interpreter: Use typed_kwargs for func_custom_target
This does not convert the build side, or remove any of the checking it
does. We still need that for other callers of custom target. What we'll
do for those is add an internal interface that defaults things, then
we'll be able to have those callers do their own validation, and the
CustomTarget validation machinary can be removed.

Fixes #9096
2021-09-30 21:01:38 +02:00
Xavier Claessens e836076e24 external-project: variables must be dict not list
Fixes: #9316
2021-09-29 19:01:44 -04:00
Dylan Baker d661a0cd96 build: use an object rather than a dict for the dep_manifest
This really is more of a struct than a dict, as the types are disjoint
and they are internally handled, (ie, not from user input). This cleans
some things up, in addition I spotted a bug in the ModuleState where the
dict with the version and license is passed to a field that expects just
the version string.
2021-09-24 10:36:05 -07:00
Eli Schwartz 2c34b2f063
fix traceback for undefined exception when trying to raise exception 2021-09-14 15:50:29 -04:00
Xavier Claessens 12e5bfbc1c external-project: Add support for WAF build system
Fixes: #7638
2021-08-20 09:12:20 -04:00
Dylan Baker 4a0a6a8083 modules: modules need to return either an ExtensionModlue or a
NewExtensionModule object

So that we get the found() method.
2021-06-30 14:07:26 -07:00
Daniel Mensinger 3e396b3782
fix: Always explicitly set encoding for text files (fixes #8263) 2021-06-29 11:28:08 +02:00
Daniel Mensinger 7c757dff71 holders: Fix the remaining code to respect the holder changes 2021-06-18 23:48:33 +02: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
Xavier Claessens 2fb24b18e1 unstable_external_project: Remove unused imports 2021-05-28 15:17:10 -04:00
Xavier Claessens 8abbc5cc5d modules: Replace find_program_impl() by state.find_program() 2021-05-28 15:17:10 -04:00
Xavier Claessens 3340284805 modules: Stop using InterpreterObject
Custom objects returned by modules must be subclass of ModuleObject and
have the state argument in its methods.

Add MutableModuleObject base class for objects that needs to be deep
copied on assignation.
2021-05-28 15:17:10 -04:00
Dylan Baker b1d85f3cde modules/external_project: use typed_pos_args 2021-03-26 12:28:42 -07:00
Xavier Claessens 6415453f17 externalproject: Flatten configure_options kwarg 2021-03-16 18:17:58 -04:00
Xavier Claessens a0689647a9 externalproject: Do not add --includedir by default
Some projects (e.g. OpenSSL) does not support setting include directory
at all.
2021-03-16 18:17:58 -04:00
Xavier Claessens f6d5e8aa47 externalproject: Fix error when used from main project 2021-03-16 18:17:58 -04: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
Leif Middelschulte 8339594014 exernal_project: Fix default cross compile parameters
The variable `{host}` cannot be successfully expanded.
Using the `@HOST@` parameter, as suggested by the documentation, works.
2021-03-02 08:20:28 -05:00
Xavier Claessens 2fabd4c7dc minstall: Add --skip-subprojects option
By default all subprojects are installed. If --skip-subprojects is given
with no value only the main project is installed. If --skip-subprojects
is given with a value, it should be a coma separated list of subprojects
to skip and all others will be installed.

Fixes: #2550.
2021-02-22 23:03:55 +02:00
Xavier Claessens 11cfc258fc external_project: Add default configure options 2021-01-29 11:01:00 -05:00
Xavier Claessens 6a6323ff09 external_project: Do not set LD in the env
This was breaking some autotools projects such as libyaml.
2021-01-29 10:10:37 -05:00
Xavier Claessens 46b68d4c83 external_project: Improve logging
Write output of 'make' and 'make install' into log files as well when
not verbose.
2021-01-29 10:01:36 -05:00
Xavier Claessens 05ab792d58 external_project: Log configure command 2021-01-20 19:11:50 +00:00
Xavier Claessens 903c8716e3 external_project: Write output in log files when not verbose 2021-01-17 11:08:08 +00:00
Dylan Baker e36aca42d0 build/interpreter: Split InstallDir to fix layering violation
Currently InstallDir is part of the interpreter, and is an Interpreter
object, which is then put in the Build object. This is a layering
violation, the interperter should have a Holder for build data. This
patch fixes that.
2021-01-13 13:32:48 -08:00
Dylan Baker 4580433b82 rename cflags_mapping to CFLAGS_MAPPING
This is PEP8 convention for a const variable. Also, make the type
Mapping, which doesn't have mutation methods. This means mypy will warn
us if someone tries to change this.
2021-01-11 11:15:06 -08:00
Dylan Baker e81acbd606 Use a single coredata dictionary for options
This patches takes the options work to it's logical conclusion: A single
flat dictionary of OptionKey: UserOptions. This allows us to simplify a
large number of cases, as we don't need to check if an option is in this
dict or that one (or any of 5 or 6, actually).
2021-01-04 12:20:58 -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
Xavier Claessens 6ec0b535ba external-project: Add typing annotation 2020-09-13 13:54:47 -04:00
Xavier Claessens 9d338200da external-project: New module to build configure/make projects
This adds an experimental meson module to build projects with other
build systems.

Closes: #4316
2020-09-13 13:54:47 -04:00