Commit Graph

13019 Commits

Author SHA1 Message Date
Alf Henrik Sauge 9ad5d0df4a Remove redundant backslash and fix white space issue 2022-08-26 17:12:40 -04:00
Alf Henrik Sauge 06bf9a5cda Fix purely white space issues reported by flake8 2022-08-26 17:12:40 -04:00
Eli Schwartz 47a0ed5924
Revert "Windows: Improve Python 3.8+ module check on Windows"
This reverts commit 99ad11bd9c.

This breaks working setups in conda. It is either wrong or incomplete
and thus cannot be used.

Fixes #10737
2022-08-25 17:41:38 -04:00
Fabian Orccon 83c6fc5b02 wrap: Support netrc files 2022-08-25 10:18:04 -04:00
Eli Schwartz 27748f9cd1
fix linker regression for compilers that don't accept LDFLAGS directly
e.g. ldc -- the compiler needs to process args before consuming them.

Fixes #10693
2022-08-24 23:49:14 -04:00
Eli Schwartz 9e2d4994c4
fix incorrect type annotations for coredata compile/link args
These make no sense as single strings.
2022-08-24 23:49:13 -04:00
Dylan Baker c94c492089 build: don't add targets to link_whole_targets if we took their objects
What happens is this:
 - liba is a convenience static library
 - libb is an installed static library
 - libb links in liba with --link-whole
 - libc links to libb
 - we generate a link line with libb *and* liba, even though libb is a
   strict superset of liba

This is a bug that has existed since the we stopped using link-whole to
combine convenience libraries, and to instead propagate their
dependencies up. For most linkers this is harmless, if inefficient.
However, for apple's ld64 with the addition calling `ranlib -c`, this
ends up causing multiple copies of symbols to clash (I think that other
linkers recognize that these symbols are the same and combine them), and
linking to fail.

The fix is to stop adding libraries to a target's `link_whole_targets`
when we take its objects instead. This is an all around win since it
fixes this bug, shortens linker command lines, and avoids opening
archives that no new symbols will be found in anyway.
2022-08-24 22:50:35 -04:00
Dylan Baker c02d7fe119 backend/ninja: properly track objects extracted from fortran sources
We need this to ensure that .mod files are created before we start
compiling, and to ensure that the proper include directory arguments are
generated.
2022-08-24 22:50:35 -04:00
Dylan Baker a044f42308 build: add a `uses_fortran()` convenience method 2022-08-24 22:50:35 -04:00
Dylan Baker 741de25462 build: Don't attempt to link-whole with rust convenience libraries
There are two distinct cases here that need to be considered. The first
issue is https://github.com/mesonbuild/meson/issues/10723 and
https://github.com/mesonbuild/meson/issues/10724, which means that Meson
can't actually generate link-whole arguments with rust targets. The
second is that rlibs are never valid candidates for link-whole anyway.
The promotion happens to work because of another bug in the promotion
path (which is fixed in the next commit).
2022-08-24 22:50:35 -04:00
Eli Schwartz f8ebfdf7b1
install modes should not apply sticky bit to files
This is generally a bad idea, e.g. it causes OSError on freebsd.

It also gets ignored by solaris and thus causes unittest failures.

The proper solution is to simply reject any attempt to set this, and log a
warning.

The install_emptydir function does apply the mode as well, and since it
is a directory it actually does something. This is the only place where
we don't reset the mode.

Although install_subdir also installs directories, and in theory it
could set the mode as well, that would be a new feature. Also it doesn't
provide much granularity and has mixed semantics with files. Better to
let people use install_emptydir + install_subdir.

Fixes #5902
2022-08-23 21:07:00 -04:00
Eli Schwartz b7245d3f27 tests: remove compiler requirement in various unneeded cases
Compiled languages are Meson's bread and butter, but hardly required.
This is convenient, because many test caases specifically, do not care
about testing the compiler interactions.

In such cases, we can skip doing compiler lookups which aren't used, as
they only slow down test setup.
2022-08-23 12:26:13 -04:00
Xavier Claessens 75b8dc5c9e pkgconfig: Variables can be a single string
It used to be listified and libxml2 wrap relies on that.
2022-08-23 08:13:55 -04:00
Eli Schwartz 3e73d4d77d
introspection: untangle install_plan implemetation, fix a bunch of wrong ones
Generally plumb through the values of get_option() passed to
install_dir, and use this to establish the install plan name. Fixes
several odd cases, such as:

- {datadir} being prepended to "share" or "include"

- dissociating custom install directories and writing them out as
  {prefix}/share/foo or {prefix}/lib/python3.10/site-packages

This is the second half of #9478
Fixes #10601
2022-08-22 14:15:22 -04:00
Eli Schwartz e19e9ce6f1
interpreter: add a special class to track the lifecycle of get_option() strings 2022-08-22 11:46:34 -04:00
Eli Schwartz d395b1a768
fix up some message strings that don't include "setup" in the configure command 2022-08-22 00:23:14 -04:00
Dylan Baker a572734330 modules/pkgconfig: make it a NewExtensionModule
Since we no longer need Interpreter.extract_variables, we can remove the
interpreter from the module!
2022-08-18 21:57:36 -04:00
Dylan Baker 4135925b60 run_mypy: Add modules/pkgconfig to the list of checked modules 2022-08-18 21:57:36 -04:00
Dylan Baker 7c12066e73 modules/pkgconfig: mypy clean! 2022-08-18 21:57:36 -04:00
Dylan Baker 9bd3c1957d modules/pkgconfig: Fix code to handle CustomTarget and CustomTargetIndex 2022-08-18 21:57:36 -04:00
Dylan Baker 2fb0c0e4d8 modules/pkgconfig: remove type checking abstraction
Which confuses the heck out of mypy
2022-08-18 21:57:36 -04:00
Dylan Baker e15f15d904 modules/pkgconfig: get rid of modifications to the BuildTarget objects
This would tack on extra attributes for meta data tracking. Do that with
our own datastructures instead
2022-08-18 21:57:36 -04:00
Dylan Baker 3f63827527 modules/pkgconfig: ensure "name" is not None
The name can be None if a library is not passed as a positional
argument, and the name keyword argument is not provided. We shouldn't
allow that to happen.
2022-08-18 21:57:36 -04:00
Dylan Baker 26f02f50b8 modules/pkgconfig: Get most type annotations added
There are still a lot of errors here due to a mixture of really bad
design (adding extra attributes to objects), and legitimate type errors
(passing a str where a List[str] is expected). I suspect a lot of these
cases aren't hit for some reason.
2022-08-18 21:57:36 -04:00
Dylan Baker e84f293f67 modules/pkgconfig: Use typed_kwargs 2022-08-18 21:57:36 -04:00
Dylan Baker ddb95b0ed8 modules/pkgconfig: use typed_pos_args 2022-08-18 21:57:36 -04:00
Dylan Baker 6e75456a75 modules/pkgconfig: fix typo in blocked variable
require_private -> requires_private.
2022-08-18 21:57:36 -04:00
Dylan Baker 48222c45b2 modules/pkgconfig: Fix some low hanging typing issues 2022-08-18 21:57:36 -04:00
Dylan Baker 394f734b1d build: Add a Union alias for all build targets 2022-08-18 21:57:36 -04:00
Dylan Baker f10967e3f4 unittests: Add additional tests for KwargInfo::since values
The first test is checking the added support for keys as either `dict`
or `list`.

The second checks that a default value which would otherwise trigger a
value_since check doesn't, and that passing the default value explicitly
does.
2022-08-18 21:57:36 -04:00
Dylan Baker 25a3eff797 interpreterbase: fix type annotations for KwargInfo::since_values
These are now allowed to be `Dict[_T | Type[list] | Type[dict], str]`,
but the type annotations weren't updated
2022-08-18 21:57:36 -04:00
Dylan Baker 991baf56e9 modules/fs: Replace configure_file(copy:) with fs.copyfile
`configure_file` is both an extremely complicated implementation, and
a strange place for copying. It's a bit of a historical artifact, since
the fs module didn't yet exist. It makes more sense to move this to the
fs module and deprecate this `configure_file` version.

This new version works at build time rather than configure time, which
has the disadvantage it can't be passed to `run_command`, but with the
advantage that changes to the input don't require a full reconfigure.
2022-08-18 16:53:36 -04:00
Eli Schwartz f93886192e
minstall: do not trample install_mode by rpath fixer
install_mode can include the setuid bit, which has the special property
(mentioned in the set_mode logic for minstall itself) of needing to come
last, because it "will get wiped by chmod" (or at least chown).

In fact, it's not just chown that wipes setuid, but other changes as
well, such as the file contents. This is not an issue for install_data /
custom_target, but for compiled outputs, we run depfixer to handle
rpaths. This may or may not cause edits to the binary, depending on
whether we have a build rpath to wipe, or an install rpath to add. (We
also may run `strip`, but that external program already has its own mode
restoration logic.)

Fix this by switching the order of operations around, so that setting
the permissions happens last.

Fixes https://github.com/void-linux/void-packages/issues/38682
2022-08-18 07:57:51 -04:00
Dylan Baker 5ca5e0c900 build: actually check for targets with no sources
Do to a bug in which a method, rather than an attribute, was checked
we would never detect that a target had no sources, even though we meant
to. As a result we would never actually error out when a target has no
sources. When fixing the check, I've changed the error to a warning
so that existing projects will continue to build without errors, only
warnings.
2022-08-17 13:44:08 -07:00
Dylan Baker fd9ee31d14 tests/common/215: Save some time by only checking pkg-config 2022-08-17 13:44:08 -07:00
Dylan Baker 6d50fadde5 tests: fix targets with no sources
This was never supposed to be possible, so stop doing it.
2022-08-17 13:44:08 -07:00
Dylan Baker 429e7c1edc interpreter: deprecate the ability import unstable modules as `unstable_*`
This was never meant to work, it's an implementation detail of using
`importlib.import_module` and that our modules used to be named
`unstable_` that this ever worked.
2022-08-17 16:25:36 -04:00
Dylan Baker a78992dd81 interpreter: move handling of module stability to interpreter
Thanks to `ModuleInfo`, all modules are just named `foo.py` instead of
`unstable_foo.py`, which simplifies the import method a bit. This also
allows for accurate FeatureNew/FeatureDeprecated use, as we know when
the module was added and if/when it was stabilized.
2022-08-17 16:25:36 -04:00
Dylan Baker c32f83a829 modules: Add stabilization information to ModuleInfo
We're going to do more with this in the next commit, but this just adds
the information for now. This allows the next commit have 100% mv
changes for some of the modules, which makes review easier
2022-08-17 16:25:36 -04:00
Dylan Baker 6843f56f6b modules: use module level information about new and deprecation
Instead of using FeatureNew/FeatureDeprecated in the module.

The goal here is to be able to handle information about modules in a
single place, instead of having to handle it separately. Each module
simply defines some metadata, and then the interpreter handles the rest.
2022-08-17 16:25:36 -04:00
Dylan Baker 2801ead6d3 tests: remove deprecated `import('unstable_')` 2022-08-17 16:25:36 -04:00
Dylan Baker e062dcdfcc allplatformstests: use subTests with test_warning_location 2022-08-17 16:25:36 -04:00
Dylan Baker 369c2660d0 run_project_tests: also change paths for DEPRECATION messages
Not just WARNING and ERROR
2022-08-17 16:25:36 -04:00
Eli Schwartz 2fe07adc0e
fixup! deprecate running "meson builddir" without setup subcommand
Also pass the setup command when rewriting --internal regenerate. This
avoids the issue where `ninja` triggers a reconfigure, and this warning
gets printed as a side effect.
2022-08-16 23:39:37 -04:00
Eli Schwartz 3c7ab542c0
deprecate running "meson builddir" without setup subcommand
This is ambiguous, if the build directory has the same name as a
subcommand then we end up running the subcommand. It also means we have
a hard time adding *new* subcommands, because if it is a popular name of
a build directory then suddenly scripts that try to set up a build
directory end up running a subcommand instead.

The fact that we support this at all is a legacy design. Back in the
day, the "meson" program was for setting up a build directory and all
other tools were their own entry points, e.g. `mesontest` or
`mesonconf`. Then in commit fa278f351f we
migrated to the subcommand mechanism. So, for backwards compatibility,
we made those tools print a warning and then invoke `meson <tool>`. We
also made the `meson` tool default to setup.

However, we only warned for the other tools whose entry points were
eventually deleted. We never warned for setup itself, we just continued
to silently default to setup if no tool was provided.

`meson setup` has worked since 0.42, which is 5 years old this week.
It's available essentially everywhere. No one needs to use the old
backwards-compatible invocation method, but it continues to drag down
our ability to innovate. Let's finally do what we should have done a
long time ago, and sunset it.
2022-08-16 17:40:03 -04:00
Eli Schwartz 25b0988d4e
docs: fix various references to "meson builddir"
This is wrong, it should use "meson setup builddir".
2022-08-16 16:18:18 -04:00
Eli Schwartz 33a5352e3c
make add_project_dependencies respect build version of include dirs
Fixes #10695
2022-08-15 23:27:27 -04:00
0xMRTT d141b85462 add AdwCustomizer 2022-08-12 21:56:24 +03:00
Dimitri John Ledkov c3cc66a1cc mesonbuild/mtest.py: filter more invalid googletest JUnit4 attributes
googletest 1.12.1 generates new JUnit4 invalid attributes file and
line.

Maybe all gtest "invalid" attributes are actually valid JUnit5
attributes, and maybe schema should be upgraded to JUni5.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
2022-08-12 21:16:07 +03:00
Eli Schwartz 28d07c31b8 mcompile: provide user visibility into what actually happens
This command is magical and I hate it. Mostly because it seems people
have no clue what it does, and what it doesn't do.

Provide informational messages to the user indicating how it works, e.g.
for debugging. Point out if we ran vsenv before shelling out to the
backend.
2022-08-12 17:07:41 +03:00