* doc: fix hotdoc misuse for dynamically generated content
hotdoc has a native include feature for including files inline. Use this
to generate one file for each dynamically generated code block, and
include that file in Commands.md; see:
https://hotdoc.github.io/syntax-extensions.html#smart-file-inclusion-syntax
This permits us to move back to using the in-tree version of the hotdoc
*.md sources, thus fixing the incorrect inclusion of "builddir/" in the
"Edit on github" links which resulted from using copies as the source.
Fixes#8061
* doc: call the dummy file a "stamp" as it is a better known term
Like other language specific modules this module is module for holding
rust specific helpers. This commit adds a test() function, which
simplifies using rust's internal unittest mechanism.
Rust tests are generally placed in the same code files as they are
testing, in contrast to languages like C/C++ and python which generally
place the tests in separate translation units. For meson this is
somewhat problematic from a repetition point of view, as the only
changes are generally adding --test, and possibly some dependencies.
The rustmod.test() method provides a mechanism to remove the repatition:
it takes a rust target, copies it, and then addes the `--test` option,
then creates a Test() target with the `rust` protocol. You can pass
additional dependencies via the `dependencies` keyword. This all makes
for a nice, DRY, test definition.
Rust has it's own built in unit test format, which is invoked by
compiling a rust executable with the `--test` flag to rustc. The tests
are then run by simply invoking that binary. They output a custom test
format, which this patch adds parsing support for. This means that we
can report each subtest in the junit we generate correctly, which should
be helpful for orchestration systems like gitlab and jenkins which can
parse junit XML.
It is a usual workflow to fix something and retest to see if it is fixed using a
particular test. When tests start to become numerous, it becomes time consuming
for "meson test" to relink all of them (and in fact rebuild the whole project)
where the user has already specified the tests they want to run, as well as
the tests' dependencies.
Teach meson to be smart and only build what is needed for the test (or suite)
that were specified.
Fixes: #7473
Related: #7830
Some changes:
* Set HOME to /root, since github mounts its own HOME and 'wine'
(because of permissions) and 'dub' (can't find packages) don't
like that.
* Remove the seccomp option, doesn't seem to be needed.
This fix a regression introduced in Meson 0.56.0 when using python 3.5.
Also mention in documentation that using a meson dict does not guarantee
ordering.
Fixes: #8074.
Allow methods on the compiler object to receive internal dependencies,
as long as they only specify compiler/linker arguments or other
dependencies that satisfy the same requirements.
This is useful if you're using internal dependencies to add special
"-D" flags such as -DNCURSES_WIDECHAR, -D_XOPEN_SOURCE_EXTENDED or
-DGLIB_STATIC_COMPILATION.
In most places, we now refer to "builddir/" which is a lot less likely
to make people think it is a subcommand which needs to be used
literally.
This is a regression since commit 276d342eba
due to the existence of new docs which were added later on, using the
wrong form.
Some CMake packages fail to find at all if no version is specified.
This commit adds a cmake_version parameter to dependency() to allow you
to specify the requested version.
- mention installing from local sources, not PyPI
- warn against --user installs, which too often screw up users that then
cannot install projects because ~/.local won't be in sudo's PYTHONPATH
- advise installing with sudo -- current versions of pip assume --user
for you rather than failing with permission errors, which is great
unless, like meson, there are compelling reasons to need to install as
root
Some license identifiers are ambiguous (e.g. "GPL3"). The SPDX license
identifiers avoid this by providing standardized and unique identifiers
(e.g. "GPL-3.0-only" or "GPL-3.0-or-later" for the previous example).
Because SPDX short-form identifiers are also both human- and
machine-readable we should recommend them in the documentation.
More information (advantages, details, etc.) can be found here:
- https://spdx.dev/resources/use/#identifiers
- https://spdx.dev/ids/Fix#7905.
Using the std option, so now `rust_std=..` will work. I've chosen to use
"std" even though rust calls these "editions", as meson refers to
language versions as "standards", which makes meson feel more uniform,
and be less surprising.
Fixes: #5100
Apparently anchor links are case-sensitive and needs to be lowercase in hotdoc.
Prior to this change the anchor links were uppercase so the link did not refer to the anchor tag.
Likely that there are more occurrences around the docs than this, have not looked.
wraps from subprojects are now merged into the list of wraps from main
project, so they can be used to download dependencies of dependencies
instead of having to promote wraps manually. If multiple projects
provides the same wrap file, the first one to be configured wins.
This also fix usage of sub-subproject that don't have wrap files. We can
now configure B when its source tree is at
`subprojects/A/subprojects/B/`. This has the implication that we cannot
assume that subproject "foo" is at `self.subproject_dir / 'foo'` any
more.
You could always specify a list of tests to run by passing the names as
arguments to `meson test`. If there were multiple tests with that name (in the
same project or different subprojects), all of them would be run. Now you can:
1. Run all tests with the specified name from a specific subproject: `meson test subprojname:testname`
1. Run all tests defined in a specific subproject: `meson test subprojectname:`
Also forbid ':' in test names. We already forbid this elsewhere, so
should not be a big deal.
Sometimes, distros want to configure a project so that it does not
use any bundled library. In this case, meson.build might want
to do something like this, where slirp is a combo option
with values auto/system/internal:
slirp = dependency('', required: false)
if get_option('slirp') != 'internal'
slirp = dependency('slirp',
required: get_option('slirp') == 'system')
endif
if not slirp.found()
slirp = subproject('libslirp', ...) .variable('...')
endif
and we cannot use "fallback" because the "system" value should never
look for a subproject.
This worked until 0.54.x, but in 0.55.x this breaks because of the
automatic subproject search. Note that the desired effect here is
backwards compared to the policy of doing an automatic search on
"required: true"; we only want to do the search if "required" is false!
It would be possible to look for the dependency with `required: false`
and issue the error manually, but it's ugly and it may produce an error
message that looks "different" from Meson's.
Instead, with this change it is possible to achieve this effect in an
even simpler way:
slirp = dependency('slirp',
required: get_option('slirp') != 'auto',
allow_fallback: get_option('slirp') == 'system' ? false : ['slirp', 'libslirp_dep'])
The patch also adds support for "allow_fallback: true", which is
simple and enables automatic fallback to a wrap even for non-required
dependencies.
Automatic fallback to subprojects is complicated and should be
pointed out outside the "fallback" keyword argument. It is also
surprising that fallback to a subproject will not happen if
override_dependency has already been used with the request
dependency. Document all this.