Commit Graph

11680 Commits

Author SHA1 Message Date
Dylan Baker cfa6ff52e9 modules/gnome: Fix case that could never be hit due to bad types
It's impossible to get a Holder here, we'd get the unholdered build
types. Mypy points this out for us.
2021-10-08 08:44:30 -04:00
Dylan Baker bd00ea6b13 modules/gnome: fix use of undefined variable
Theere is no 'output' key in the kwargs, so if this was it it would
result in an exception. Mypy spotted this in a branch I'm working on
full typing for gnome, but since that seems unlikely to be done before
the 0.60 branchpoint I'd like to get this in sooner
2021-10-08 08:44:30 -04:00
Luca Bacci 6d1e182476 Windows module: Make path flattening for windres work in more cases
If either 'name' or 'name_formatted' are absolute paths,
then they are of the form:

C:\path/to/file.ext                            (example)

By only substituting slashes with the underscore, we get:

C:_path_to_file.ext

This is still not quite right, infact os.path.basename()
returns:

_path_to_file.ext

Also replace colons with underscores to overcome issues when
absolute paths are involved.
2021-10-07 21:52:18 -04:00
Eli Schwartz a864269817
docs: restore build_target method documentation which went missing
In the refman rewrite, these functions vanished. I noticed this when I
went looking at the docs for extract_all_objects(), or should I say I
tried to go looking.
2021-10-07 21:30:55 -04:00
Vladimír Čunát 98d1ec7a32 clike compilers: drop semicolon at function end
warning: ISO C does not allow extra ';' outside of a function [-Wpedantic]
2021-10-07 09:42:52 -07:00
Dylan Baker bcfbfbb343 modules/gnome: deprecate yelp variadic sources
Yelp currently can take sources two different ways, the first is via
variadic arguments, the second is by a keyword argument. If the keyword
is passed then the variadic arguments are silently ignored, which is
obviously not ideal. Fortunately the variadic form was never documented,
and is likely not in wide use.

This patch fixes it by deprecating the variadic form, and warning if
both are passed. It does not change behavior as someone may be relying
on it.
2021-10-07 09:26:35 -07:00
Daniel Mensinger dfec4385a7 interpreter: Move RangeHolder out of interpreterbase to interpreter 2021-10-06 22:37:18 +02:00
Daniel Mensinger af0587cb49 interpreter: Holderify arrays and dicts
This is the final refactoring for extracting the bultin object
logic out of Interpreterbase. I decided to do both arrays and
dicts in one go since splitting it would have been a lot more
confusing.
2021-10-06 22:37:18 +02:00
Jesse Natalie b19530bd7d Fix compiler detection for cl/clang-cl
If the compiler specified is a path to a compiler, the current detection is broken. It needs to use just the compiler name instead.
2021-10-06 13:35:24 -07:00
Daniel Mensinger 29c2b44a29 cmake: Implement support for interpreting link "keywords"
CMakes `target_link_libraries()` supports certain keywords to
only enable specific libraries for specific CMake configurations.
We now try our best to replicate this for Meson dependencies.

Fixes #9197
2021-10-06 16:43:59 +02:00
Daniel Mensinger f1614a6071 cmake: Warn if we could use IMPORTED CMake targets 2021-10-06 16:43:59 +02:00
Daniel Mensinger ecaa1d19ed ci: Add TTY mode to the image builder mounting meson 2021-10-06 16:43:59 +02:00
Xavier Claessens 9d3e9c43cc ci: Add comment to not forget updating wrapdb rules 2021-10-06 08:55:26 -04:00
Eli Schwartz b57b1050a6
wrap clone: be less noisy when doing automated code checkouts
There are two possible issues, both of which emit very long messages
from git:
- when shallow cloning via depth + a pinned commit we locally init
  rather than cloning; use an almost-certainly not conflicting dummy
  branch name
- any time a checkout of a revision is performed, it might not be a
  branch name, in which case it will be a detached HEAD. By default git
  is very noisy about this -- it wants you to know what happened and how
  not to mess up. But wraps aren't per default intended for user editing
  and development, it's just part of the internal transport which meson
  uses. So, temporarily squelch this advice. Do not permanently
  configure the repo like this though, because the user *might* cd in
  and start developing on the subproject; in this case, any additional
  git advice they trigger is their responsibility (and they probably do
  want it).

Fixes #9318
2021-10-04 22:48:09 -04:00
Andres Freund 6b8f10cf6b backend/vs: Generate dependencies for CustomTargetIndex for a CustomTarget.
Test & fix.
2021-10-04 22:42:27 -04:00
Andres Freund a161873948 backend/vs: process link dependencies.
Partially-Fixes: #1799
2021-10-04 22:34:57 -04:00
Andres Freund a1542720f4 Record build in BuildTarget.link_depends, not just output of targets.
To be able to handle link_depends in backends that do not just operate on a
file basis like ninja, information about the targets, not just their output is
required.
2021-10-04 22:34:57 -04:00
Dylan Baker 246d5f34bb run_mypy: Add the external_project_module 2021-10-04 19:33:43 -07: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 0f9ec8bc88 mesonlib: ConfigurationData can also be a `Dict[str, Tuple[Str, Optional[str]]]` 2021-10-04 19:33:43 -07:00
Dylan Baker c2d053674d dependencies: Dependency.sources can have CustomTargets 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
Eli Schwartz c94d6acc49
remove printf debugging
Why did this dumb thing of mine ever get committed???
2021-10-04 18:37:03 -04:00
Daniel Mensinger a8189d0c70 docs: Temporarily disable modules and move RefMan --> Reference-manual 2021-10-04 23:11:48 +02:00
Eli Schwartz 800c3462f0
condense lines 2021-10-04 17:01:03 -04:00
Eli Schwartz d06cc042eb
f-strings 2021-10-04 16:29:32 -04:00
Eli Schwartz 47ae0b82f0
use list unpacking to simplify for loop references 2021-10-04 16:29:31 -04:00
Eli Schwartz 4ab70c5512
fix extra whitespace
discovered via flake8 --select E303
2021-10-04 16:29:31 -04:00
Eli Schwartz c582abbbcf
flake8: extend the ignore list, do not override
Some things are disabled by default because most people are not
interested in them. But (non-obviously) adding a list of ignores to the
flake8 configuration file will actually turn back on anything you didn't
explicitly specify.

This reduces the number of flake8 warnings by about 100, a vast chunk of
which are

E704 multiple statements on one line (def)

which turn out to actually be T.overload or typing definitions with

def func(): ...

which is understandably quite reasonable to permit.
2021-10-04 16:29:31 -04:00
Eli Schwartz 52c4df1ba7
use idiomatic python for membership tests
"X not in Y" is preferred over "not X in Y", as the former is more
readable.
2021-10-04 16:29:31 -04:00
Eli Schwartz 5a8e066c56
remove useless variables that are no longer or were never used 2021-10-04 16:29:31 -04:00
Eli Schwartz f2eb1534dd
work around flake8 F811 for T.overload redefined functions
Since typing != T as far as flake8 is aware, give the linter an extra
hint.
2021-10-04 16:29:31 -04:00
Eli Schwartz 520996fff1
remove double import
Imported both inside and outside of T.TYPE_CHECKING, the runtime import
can be removed by quote-deferring one of the use sites.

Update:

In between then and now, this got removed from T.TYPE_CHECKING, move it
back there rather than preserving the runtime import.
2021-10-04 16:29:31 -04:00
Eli Schwartz 1bb2523e58
remove f from f-string that has no formatting 2021-10-04 16:29:31 -04:00
Eli Schwartz b2ddda7013
fix incorrect porting from % formatting to .format method
(var,) is the correct way to pass values to a percent formatted string,
but not to .format so we would end up printing something like:

unexpected input at line (4,)

Upgrade to an f-string and insert the correct value correctly.
2021-10-04 16:29:30 -04:00
Eli Schwartz cfa8717c4a
coding style: don't format an empty string with another string
'{}'.format('foo') for any given value of 'foo' (in this case, a
function returning a string), can always just be 'foo' directly, which
is a lot more readable.
2021-10-04 16:29:30 -04:00
Eli Schwartz e33ba28ec4
better error message for modules returning the wrong value 2021-10-04 16:29:30 -04:00
Eli Schwartz e8a85fa8a2
various python neatness cleanups
All changes were created by running

"pyupgrade --py3-only"

and committing the results. Although this has been performed in the
past, newer versions of pyupgrade can automatically catch more
opportunities, notably list comprehensions can use generators instead,
in the following cases:
- unpacking into function arguments as function(*generator)
- unpacking into assignments of the form x, y = generator
- as the argument to some builtin functions such as min/max/sorted

Also catch a few creeping cases of new code added using older styles.
2021-10-04 16:29:30 -04:00
Jussi Pakkanen 2d65472c72
Merge pull request #8960 from mensinda/yamlDoc
Reference Manual 2.0
2021-10-04 22:19:07 +03:00
Daniel Mensinger b672ebca88
Minor fixups 2021-10-04 19:39:36 +02:00
Zbigniew Jędrzejewski-Szmek 75dd9fb67f interpreter: improve the error message about install_mode
We wrote:
 ERROR: install_emptydir keyword argument "install_mode" permissions string must
        be exactly 9 characters, got "4" in the form rwxr-xr-x

Let's change this around to be easier to read.

Also, 1-based numbering was used (for components) and 0-based for "bits".
And actually the "bits" are not bits, but octal digits. So say "permissions
character 1", "permissions character 2".

And finally change "must be … if provided" to "can only be". (If it isn't
provided, it "is not", so the sentence is still valid. The user will only
get this error if they provide something, so we don't need to be super precise
and say "if provided". And then we avoid confusing the reader whether
it's "if provided" attaches to the the "False" or to the whole sentence.)
2021-10-04 10:31:21 -04:00
Eli Schwartz c6d74ac7e0 fix typo in error message breaking newline escape
Broken in commit 3feaea6b29.
2021-10-03 18:53:32 -07:00
Dan Streetman 3c2cca5699 modules/i18n: fix gettext use of --datadirs param
The previous commit bd2fcb268b
accidentally used the wrong var so the param name was missing,
leading to an error of "unrecognized arguments" for the
datadirs parameter value.
2021-10-03 16:23:46 -04:00
Eli Schwartz 7825a6f2ca cmake module: if cmake cannot be found, do not traceback
We ended up passing a NoneType as the program binary, which is a very
awkward way to communicate an error when failing to write a basic
package version file.
2021-10-03 12:34:01 +02:00
Daniel Mensinger 0b9c7b74be
docs: Update YAML docs after rebase 2021-10-03 12:19:46 +02:00
Daniel Mensinger 102484b820
docs: Add myself to CODEOWNERS for docs/refman 2021-10-03 12:19:46 +02:00
Daniel Mensinger af24d18842
docs: Added new static docs 2021-10-03 12:19:45 +02:00
Daniel Mensinger 239219220e
docs: Fix mypy 2021-10-03 12:19:45 +02:00
Daniel Mensinger 4e1e98cc31
docs: added install_tag docs 2021-10-03 12:19:45 +02:00