Commit Graph

10744 Commits

Author SHA1 Message Date
Dylan Baker 504ae2dee8
compilers: Use EnvironmentException not EnvironmentError/OSError
The latter is a python built-in exception, the former is a meson
exception.
2021-03-04 22:13:33 -05:00
Eli Schwartz ed252b87e0
use python2-compatible syntax because needed on macOS
Apparently this unittest runs on macOS using the system python2.
2021-03-04 17:49:36 -05: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
Eli Schwartz 76df995ba6
raw string literals are next to godliness
Invalid escape sequences are deprecated and will be removed from a
future version of python. Use r"" to define them so they remain
readable.
2021-03-04 17:09:00 -05:00
Michael Brockus fb59529458
Fix release notes typo [skip ci] 2021-03-04 15:49:37 -05:00
Daniel Mensinger 1236b1500a ci: Downgrade Qt on MacOS from Qt6 to Qt5 2021-03-04 20:27:59 +02:00
Chris Mayo 91e30fadc7
docs: Clarify compiler.cmd_array() (#8454)
Make it easier to understand that this array contains the compiler
command, not arguments to it, and may only have one element.
2021-03-04 20:09:08 +02:00
Amr Ojjeh 5ca2aa7ec0
Improved a paragraph [skip ci]
Made it easier to understand
2021-03-04 20:08:09 +02:00
Paolo Bonzini be0a05e777 mintro: include the correct target filenames for flat layout
Fixes: #8408
2021-03-04 17:36:41 +01:00
Paolo Bonzini 675bb2f340 mintro: fix flake8 issues 2021-03-04 17:36:41 +01:00
Xavier Claessens ba9bfd2bd8 Simplify module API
- ModuleState is now a real class that will have methods in the future
  for actions modules needs, instead of using interpreter internal API.
- New ModuleObject base class, similar to InterpreterObject, that should
  be used by all objects returned by modules. Its methods gets the
  ModuleState passed as first argument. It has a `methods` dictionary to
  define what is public API that can be called from build definition.
- Method return value is not required to be a ModuleReturnValue any
  more, it can be any type that interpreter can holderify, including
  ModuleObject.
- Legacy module API is maintained until we port all modules.

In the future modules should be updated:
- Use methods dict.
- Remove snippets.
- Custom objects returned by modules should all be subclass of
  ModuleObject to get the state iface in their methods.
- Modules should never call into interpreter directly and instead state
  object should have wrapper API.
- Stop using ModuleReturnValue in methods that just return simple
  objects like strings. Possibly remove ModuleReturnValue completely
  since all objects that needs to be processed by interpreter (e.g.
  CustomTarget) should be created through ModuleState API.
2021-03-04 11:33:22 -05:00
Xavier Claessens 1e69908be5 interpreter: Fix process_new_values()
It should recurse on lists and does not need to return a value.
2021-03-04 11:33:22 -05:00
Xavier Claessens a2cae005ec build: Fix backend type 2021-03-04 11:33:22 -05:00
Xavier Claessens 5ad9320f47 pkgconfig: Add missing permitted kwargs
Fixes #8462
2021-03-03 09:23:37 -05:00
Xavier Claessens c8abede403 Windows Subsystem for Linux can run .exe without mono interpreter
Fixes: #8445
2021-03-03 08:05:00 -05:00
Xavier Claessens b7bcdb7839 wrap: sha256 digest is not case sensitive
Fixes: #8450.
2021-03-02 12:38:46 -05:00
Remi Thebault 25848fc05f fix missing versions with generated source 2021-03-02 09:31:40 -08: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
Dylan Baker 1ac4358eae docs/faq: Add a section on user defined functions and macros [skip ci]
Fixes #3234
2021-03-01 15:10:51 -08:00
Paolo Bonzini 0c663d056a mtest: create separate runners for multiple repeats
Reusing the runners for multiple repeats of the test run gets in the
way of the progress report, which stores runners in an OrderedSet.
Instead, create a separate SingleTestRunner object for each repeat.

While at it, fix the "duplicate suite" assertion as it can fire
with TAP tests and --repeat=N.

Fixes: #8405
2021-03-02 00:57:57 +02:00
Remi Thebault 3bf207ab1b D add build dir to -J switch 2021-03-01 09:51:40 -08:00
Jussi Pakkanen 62b744b2c4 Require Windows 10 or newer for the MSI package. [skip ci] 2021-02-28 22:41:41 +02:00
Jussi Pakkanen eacd43d5b5 Add filecmp to list of bundled modules. Closes #8431. [skip ci] 2021-02-28 22:41:41 +02:00
Jussi Pakkanen 5e95f13737 Remove remnants of 32 bit support. [skip ci] 2021-02-28 22:41:41 +02:00
Jussi Pakkanen b86ef3f850
Merge pull request #8389 from dcbaker/submit/single-test-runner
Add a script to run a single meson functional test case (with test.json support)
2021-02-27 21:06:07 +02:00
Jason Woodward 50af09de03 install_man locale support
Rather than having to manually build the locale aware man paths with

`install_data('foo.fr.1', install_dir: join_paths(get_option('mandir'), 'fr', 'man1'), rename: 'foo.1')`

Support doing

`install_man('foo.fr.1', locale: 'fr')`
2021-02-27 14:35:23 +02:00
Jeff Moguillansky 0047f7439c pkg-config: dump all PKG_CONFIG environment variables to simplify debugging
With this change, all the system's built-in pkg-config environment variables
are outputted as well, to simplify debugging.
2021-02-26 16:52:15 -08:00
Dylan Baker 6a9a1557e4
Merge pull request #8429 from dcbaker/submit/rust-fix-linking-with-find-library
rust: correctly handle -l link args
2021-02-26 16:50:53 -08:00
Dylan Baker 219535aad4 interpreter: Clean up and simplify/optimize get_(external|cross)_property
These are both way more compilcated than they needed to be, this is a
much simpler implementation, and is shared between cross and external
properies.
2021-02-26 15:31:15 -08:00
Dylan Baker d7d80945ea rust: a meson -l argument could be etiher a static or dynamic library
I made an incorrect assumption that -l arguments would always be static
libraries, but they might well be shared libraries.
2021-02-26 14:26:15 -08: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
Jordan Justen e127e47d7a tests/rust: Add rust case linking to libm in rust static library
When building on Linux, I see:

rustc -C linker=cc --color=always --crate-type rlib --crate-name rs_math -g --emit dep-info=rs_math.d --emit link -L /usr/lib/x86_64-linux-gnu -o librs_math.rlib -l static=m ../rs_math.rs
error: failed to add native library /usr/lib/x86_64-linux-gnu/libm.a: file too small to be an archive

I think the "file too small to be an archive" message is coming from
libLLVM, and is a case of LLVM not handling this type of "script
archive". So, possibly this is just LLVM not handling a linking case.

The rust_args usage in meson.build is invalid, but required to
reproduce the issue in the test case. Perhaps meson should
automatically add the library include path via the dep_m meson object,
or maybe the meson.build can add the link path in a better way.

Changing '-l static=m' to '-l dylib=m' appears to fix this case. (See
comments in meson.build.)
2021-02-26 11:58:47 -08:00
Dylan Baker fad0a498fb modules/fs: Use typed_pos_args 2021-02-26 09:34:27 -08:00
Dylan Baker e079553959 interpreter: correctly track whether a subproject is initialized
The way the tracking is currently done it works if no new subprojects
are added to a configured build directory. For cases where we want to
add a new subproject, it fails because we don't initialize builtins for
that subproject. This corrects that by checking to see if the subproject
already exists, and if it doesn't initializes the bultins for it.

Fixes: #8421
2021-02-26 09:05:30 -08:00
Stephen Gregoratto ec5fe58e6d Allow printing UserOptions in the summary 2021-02-26 10:28:00 -05:00
Tim-Philipp Müller ace22f21a7 meson: add .has_external_property() methods
Useful in case of boolean values to distinguish between a boolean
value having been set in the native/cross file and not having been
provided, which can't be achieved by passing a fallback parameter
to .get_external_property().
2021-02-26 10:15:17 -05:00
Riccardo Schirone c5aee36fa2 Add Rizin to the list of meson users 2021-02-26 07:06:28 -05:00
Dylan Baker aa4efc709e deprecated `meson.get_cross_property`
It's a pure subset of `get_external_property`, and has odd behavior in
host == build configurations. `get_external_property` is clear, and uses
the standard `native : bool` syntax to control host vs build properties
2021-02-25 15:18:39 -08:00
Jussi Pakkanen 542dea2571
Merge pull request #8404 from dcbaker/submit/rust-c-dependencies
Fix linking Rust with C dependencies
2021-02-26 00:22:57 +02:00
Dylan Baker eba9535428 interpreter: stop using hasattr for held_object
We have unholder or isinsatnce(ObjectHolder) for that
2021-02-25 23:08:23 +02:00
Dylan Baker 69c22181f7 interpreter: Fix ObjectHolder usage 2021-02-25 23:08:23 +02:00
Dylan Baker b8e4600bb8 interpreterbase: fix ObjectHolder
There are two problems:
1. It doesn't take the generic type as a parameter
2. it sets subpproject to None, but expects to always get a string
2021-02-25 23:08:23 +02:00
Xavier Claessens cef5cab23c Support multiple args in error()
Seems it got forgotten when that was added to warnings() and message().

Fixes: #8414.
2021-02-25 22:58:45 +02:00
Matthias Klumpp 4e5efd3897
Allow custom target output to be processed by generators 2021-02-25 20:53:41 +02:00
Jussi Pakkanen 74ebb1ba59 Clarify that wrap requests are for user submission. [skip ci] 2021-02-25 00:40:20 +02:00
Eli Schwartz c7ddde58fd
mcompile: do not pass the builddir to ninja if it is the current directory
Because when you don't specify -C, this logging feels silly:

ninja: Entering directory `.
2021-02-23 19:37:04 -05:00
Eli Schwartz 691eb0250a
mcompile: make sure arguments are passed in the correct order
meson compile itself doesn't permit GNU-style argument permutation, i.e.
TARGET to precede options, so why should we expect ninja to?

And indeed, ninja doesn't document support for this -- but it does
accept it anyway, which is confusing and results in people thinking it's
"supposed to" work.

However, if NINJA=samu then this is in fact enforced. samu does not
permit GNU-style argument permutation. As a result, the arguments passed
to mcompile are actively re-ordered before being passed to the
subprocess, and samu dies with a fatal error.

Fix ordering in mcompile.py and add a comment to warn future readers
that the order does, in fact, matter.
2021-02-23 19:37:03 -05:00
Dylan Baker 0edd005804 rust: replace for loop with any()
This is a little cleaner, and short circuits correctly, unlike the loop
it replaces
2021-02-23 16:22:56 -08:00
Dylan Baker 6544f151db rust: fix linking with external dependencies
Rust can link with any dependency that uses c linkage, which is pretty
much what we assume across the board anyway.
2021-02-23 16:22:56 -08:00