aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rwxr-xr-xdocs/genrelnotes.py42
-rw-r--r--docs/markdown/Continuous-Integration.md150
-rw-r--r--docs/markdown/D.md2
-rw-r--r--docs/markdown/Reference-manual.md30
-rw-r--r--docs/markdown/Syntax.md12
-rw-r--r--docs/markdown/Unit-tests.md20
-rw-r--r--docs/markdown/Users.md4
-rw-r--r--docs/markdown/snippets/add_dictionary_variable_key.md20
-rw-r--r--docs/markdown/snippets/find_program.md9
9 files changed, 195 insertions, 94 deletions
diff --git a/docs/genrelnotes.py b/docs/genrelnotes.py
index e5ff432..70d8915 100755
--- a/docs/genrelnotes.py
+++ b/docs/genrelnotes.py
@@ -13,13 +13,17 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-
-import sys, os, subprocess
+'''
+ Generates release notes for new releases of Meson build system
+'''
+import subprocess
+import sys
+import os
from glob import glob
-relnote_template = '''---
-title: Release %s
-short-description: Release notes for %s
+RELNOTE_TEMPLATE = '''---
+title: Release {}
+short-description: Release notes for {}
...
# New features
@@ -28,21 +32,27 @@ short-description: Release notes for %s
def add_to_sitemap(from_version, to_version):
+ '''
+ Adds release note entry to sitemap.txt.
+ '''
sitemapfile = '../sitemap.txt'
- sf = open(sitemapfile)
- lines = sf.readlines()
- sf.close()
- with open(sitemapfile, 'w') as sf:
+ s_f = open(sitemapfile)
+ lines = s_f.readlines()
+ s_f.close()
+ with open(sitemapfile, 'w') as s_f:
for line in lines:
if 'Release-notes' in line and from_version in line:
new_line = line.replace(from_version, to_version)
- sf.write(new_line)
- sf.write(line)
+ s_f.write(new_line)
+ s_f.write(line)
def generate(from_version, to_version):
- ofilename = 'Release-notes-for-%s.md' % to_version
+ '''
+ Generate notes for Meson build next release.
+ '''
+ ofilename = 'Release-notes-for-{}.md'.format(to_version)
with open(ofilename, 'w') as ofile:
- ofile.write(relnote_template % (to_version, to_version))
+ ofile.write(RELNOTE_TEMPLATE.format(to_version, to_version))
for snippetfile in glob('snippets/*.md'):
snippet = open(snippetfile).read()
ofile.write(snippet)
@@ -57,7 +67,7 @@ if __name__ == '__main__':
if len(sys.argv) != 3:
print(sys.argv[0], 'from_version to_version')
sys.exit(1)
- from_version = sys.argv[1]
- to_version = sys.argv[2]
+ FROM_VERSION = sys.argv[1]
+ TO_VERSION = sys.argv[2]
os.chdir('markdown')
- generate(from_version, to_version)
+ generate(FROM_VERSION, TO_VERSION)
diff --git a/docs/markdown/Continuous-Integration.md b/docs/markdown/Continuous-Integration.md
index 13a9a00..0846f2d 100644
--- a/docs/markdown/Continuous-Integration.md
+++ b/docs/markdown/Continuous-Integration.md
@@ -6,20 +6,16 @@ Travis and AppVeyor.
Please [file an issue](https://github.com/mesonbuild/meson/issues/new)
if these instructions don't work for you.
-## Travis for OS X and Linux (with Docker)
+## Travis-CI with Docker
-Travis for Linux provides ancient versions of Ubuntu which will likely
-cause problems building your projects regardless of which build system
-you're using. We recommend using Docker to get a more-recent version
-of Ubuntu and installing Ninja, Python3, and Meson inside it.
+Travis with Docker gives access to newer non-LTS Ubuntu versions with
+pre-installed libraries of your choice.
-This `yml` file is derived from the [configuration used by Meson for
-running its own
-tests](https://github.com/mesonbuild/meson/blob/master/.travis.yml).
+This `yml` file is derived from the
+[configuration used by Meson](https://github.com/mesonbuild/meson/blob/master/.travis.yml)
+for running its own tests.
```yaml
-sudo: false
-
os:
- linux
- osx
@@ -34,10 +30,10 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python3 ninja; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip3 install meson; fi
- - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull YOUR/REPO:yakkety; fi
+ - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull YOUR/REPO:eoan; fi
script:
- - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo FROM YOUR/REPO:yakkety > Dockerfile; fi
+ - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo FROM YOUR/REPO:eoan > Dockerfile; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo ADD . /root >> Dockerfile; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker build -t withgit .; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run withgit /bin/sh -c "cd /root && TRAVIS=true CC=$CC CXX=$CXX meson builddir && ninja -C builddir test"; fi
@@ -46,7 +42,7 @@ script:
## CircleCi for Linux (with Docker)
-[CircleCi](https://circleci.com/) can work for spinning all of the Linux images you wish.
+[CircleCi](https://circleci.com/) can work for spinning all of the Linux images you wish.
Here's a sample `yml` file for use with that.
```yaml
@@ -59,7 +55,7 @@ executors:
docker:
- image: your_dockerhub_username/ubuntu-sys
- meson_debain_builder:
+ meson_debian_builder:
docker:
- image: your_dockerhub_username/debian-sys
@@ -76,8 +72,8 @@ jobs:
- run: ninja -C builddir
- run: meson test -C builddir
- meson_debain_build:
- executor: meson_debain_builder
+ meson_debian_build:
+ executor: meson_debian_builder
steps:
- checkout
- run: meson setup builddir --backend ninja
@@ -97,17 +93,20 @@ workflows:
linux_workflow:
jobs:
- meson_ubuntu_build
- - meson_debain_build
+ - meson_debian_build
- meson_fedora_build
```
## AppVeyor for Windows
-For CI on Windows, [AppVeyor](https://www.appveyor.com/) is probably
-your best bet. Here's a sample `yml` file for use with that.
+For CI on Windows, [AppVeyor](https://www.appveyor.com/) has a wide selection of
+[default configurations](https://www.appveyor.com/docs/windows-images-software/).
+AppVeyor also has [MacOS](https://www.appveyor.com/docs/macos-images-software/) and
+[Linux](https://www.appveyor.com/docs/linux-images-software/) CI images.
+This is a sample `appveyor.yml` file for Windows with Visual Studio 2015 and 2017.
```yaml
-os: Visual Studio 2017
+image: Visual Studio 2017
environment:
matrix:
@@ -148,9 +147,11 @@ test_script:
### Qt
For Qt 5, add the following line near the `PYTHON_ROOT` assignment:
+
```yaml
- cmd: if %arch%==x86 (set QT_ROOT=C:\Qt\5.11\%compiler%) else (set QT_ROOT=C:\Qt\5.11\%compiler%_64)
```
+
And afterwards add `%QT_ROOT%\bin` to the `PATH` variable.
You might have to adjust your build matrix as there are, for example, no msvc2017 32-bit builds. Visit the [Build Environment](https://www.appveyor.com/docs/build-environment/) page in the AppVeyor docs for more details.
@@ -158,35 +159,31 @@ You might have to adjust your build matrix as there are, for example, no msvc201
### Boost
The following statement is sufficient for meson to find Boost:
+
```yaml
- cmd: set BOOST_ROOT=C:\Libraries\boost_1_67_0
```
## Travis without Docker
-You can cheat your way around docker by using **python** as language and setting your compiler in the build **matrix**. This example just uses **linux** and **c** but can be easily adapted to **c++** and **osx**.
+Non-Docker Travis-CI builds can use Linux, MacOS or Windows.
+Set the desired compiler(s) in the build **matrix**.
+This example is for **Linux** (Ubuntu 18.04) and **C**.
```yaml
-sudo: false
+dist: bionic
+group: travis_latest
os: linux
-dist: trusty
-
language: python
-python: 3.6
-
matrix:
include:
- env: CC=gcc
- env: CC=clang
install:
- - export NINJA_LATEST=$(curl -s https://api.github.com/repos/ninja-build/ninja/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep ninja-linux.zip)
- - wget "$NINJA_LATEST"
- - unzip -q ninja-linux.zip -d build
- - export PATH="$PWD/build:$PATH"
- - pip install meson
+ - pip install meson ninja
script:
- meson builddir
@@ -194,27 +191,80 @@ script:
- ninja -C builddir test
```
-This setup uses the **beta** group. It is not recommended but included here for completeness:
+## GitHub Actions
-```yaml
-sudo: false
-language: cpp
-group: beta
+GitHub Actions are distinct from Azure Pipelines in their workflow syntax.
+It can be easier to setup specific CI tasks in Actions than Pipelines, depending on the particular task.
+This is an example file: .github/workflows/ci_meson.yml supposing the project is C-based, using GCC on Linux, Mac and Windows.
+The optional `on:` parameters only run this CI when the C code is changed--corresponding ci_python.yml might run only on "**.py" file changes.
-matrix:
- include:
- - os: linux
- dist: trusty
- - os: osx
+```yml
+name: ci_meson
-install:
- - export PATH="$(pwd)/build:${PATH}"
- - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install python3 ninja; fi
- - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip && unzip -q ninja-linux.zip -d build; fi
- - pip3 install meson
+on:
+ push:
+ paths:
+ - "**.c"
+ - "**.h"
+ pull_request:
+ paths:
+ - "**.h"
+ - "**.h"
-script:
- - meson builddir
- - ninja -C builddir
- - ninja -C builddir test
+jobs:
+
+ linux:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v1
+ - uses: actions/setup-python@v1
+ with:
+ python-version: '3.x'
+ - run: pip install meson ninja
+ - run: meson setup build
+ env:
+ CC: gcc
+ - run: meson test -C build -v
+ - uses: actions/upload-artifact@v1
+ if: failure()
+ with:
+ name: Linux_Meson_Testlog
+ path: build/meson-logs/testlog.txt
+
+ macos:
+ runs-on: macos-latest
+ steps:
+ - uses: actions/checkout@v1
+ - uses: actions/setup-python@v1
+ with:
+ python-version: '3.x'
+ - run: brew install gcc
+ - run: pip install meson ninja
+ - run: meson setup build
+ env:
+ CC: gcc
+ - run: meson test -C build -v
+ - uses: actions/upload-artifact@v1
+ if: failure()
+ with:
+ name: MacOS_Meson_Testlog
+ path: build/meson-logs/testlog.txt
+
+ windows:
+ runs-on: windows-latest
+ steps:
+ - uses: actions/checkout@v1
+ - uses: actions/setup-python@v1
+ with:
+ python-version: '3.x'
+ - run: pip install meson ninja
+ - run: meson setup build
+ env:
+ CC: gcc
+ - run: meson test -C build -v
+ - uses: actions/upload-artifact@v1
+ if: failure()
+ with:
+ name: Windows_Meson_Testlog
+ path: build/meson-logs/testlog.txt
```
diff --git a/docs/markdown/D.md b/docs/markdown/D.md
index ed8986b..39aebc8 100644
--- a/docs/markdown/D.md
+++ b/docs/markdown/D.md
@@ -74,6 +74,8 @@ my_lib = library('mylib',
soversion: project_soversion,
d_module_versions: ['FeatureA', 'featureB']
)
+
+pkgc = import('pkgconfig')
pkgc.generate(name: 'mylib',
libraries: my_lib,
subdirs: 'd/mylib',
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index dd0b3f4..5c5d164 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -151,9 +151,10 @@ Abort with an error message if `condition` evaluates to `false`.
```
Creates a benchmark item that will be run when the benchmark target is
-run. The behavior of this function is identical to `test` with the
-exception that there is no `is_parallel` keyword, because benchmarks
-are never run in parallel.
+run. The behavior of this function is identical to [`test()`](#test) except for:
+
+* benchmark() has no `is_parallel` keyword because benchmarks are not run in parallel
+* benchmark() does not automatically add the `MALLOC_PERTURB_` environment variable
*Note:* Prior to 0.52.0 benchmark would warn that `depends` and `priority`
were unsupported, this is incorrect
@@ -701,6 +702,9 @@ Keyword arguments are the following:
If the output is more complicated than that, the version checking will have to
be done manually using [`run_command()`](#run_command).
+- `dirs` *(since 0.53.0)* Extra list of absolute paths where to look for program
+ names.
+
Meson will also autodetect scripts with a shebang line and run them
with the executable/interpreter specified in it both on Windows
(because the command invocator will reject the command otherwise) and
@@ -1509,7 +1513,25 @@ object](#build-target-object) returned by
object](#external-program-object) returned by
[`find_program()`](#find_program).
-Keyword arguments are the following:
+By default, environment variable
+[`MALLOC_PERTURB_`](http://man7.org/linux/man-pages/man3/mallopt.3.html)
+is automatically set by `meson test` to a random value between 1..255.
+This can help find memory leaks on configurations using glibc,
+including with non-GCC compilers. However, this can have a performance impact,
+and may fail a test due to external libraries whose internals are out of the
+user's control. To check if this feature is causing an expected runtime crash,
+disable the feature by temporarily setting environment variable
+`MALLOC_PERTURB_=0`. While it's preferable to only temporarily disable this
+check, if a project requires permanent disabling of this check
+in meson.build do like:
+
+```meson
+nomalloc = environment({'MALLOC_PERTURB_': '0'})
+
+test(..., env: nomalloc, ...)
+```
+
+#### test() Keyword arguments
- `args` arguments to pass to the executable
diff --git a/docs/markdown/Syntax.md b/docs/markdown/Syntax.md
index b96e6e1..cf0516c 100644
--- a/docs/markdown/Syntax.md
+++ b/docs/markdown/Syntax.md
@@ -324,8 +324,8 @@ Dictionaries
--
Dictionaries are delimited by curly braces. A dictionary can contain an
-arbitrary number of key value pairs. Keys are required to be literal
-strings, values can be objects of any type.
+arbitrary number of key value pairs. Keys are required to be strings, values can
+be objects of any type. Prior to *0.53.0* keys were required to be literal strings.
```meson
my_dict = {'foo': 42, 'bar': 'baz'}
@@ -359,6 +359,14 @@ if 'foo' not in my_dict
endif
```
+*Since 0.53.0* Keys can be any expression evaluating to a string value, not limited
+to string literals any more.
+```meson
+d = {'a' + 'b' : 42}
+k = 'cd'
+d += {k : 43}
+```
+
Function calls
--
diff --git a/docs/markdown/Unit-tests.md b/docs/markdown/Unit-tests.md
index 4b21699..066b57e 100644
--- a/docs/markdown/Unit-tests.md
+++ b/docs/markdown/Unit-tests.md
@@ -15,8 +15,7 @@ You can add as many tests as you want. They are run with the command `ninja test
Meson captures the output of all tests and writes it in the log file `meson-logs/testlog.txt`.
-Test parameters
---
+## Test parameters
Some tests require the use of command line arguments or environment variables. These are simple to define.
@@ -27,15 +26,21 @@ test('envvar test', exe2, env : ['key1=value1', 'key2=value2'])
Note how you need to specify multiple values as an array.
-Coverage
---
+### MALLOC_PERTURB_
+
+By default, environment variable
+[`MALLOC_PERTURB_`](http://man7.org/linux/man-pages/man3/mallopt.3.html)
+is set to a random value between 1..255. This can help find memory
+leaks on configurations using glibc, including with non-GCC compilers.
+This feature can be disabled as discussed in [test()](./Reference-manual#test).
+
+## Coverage
If you enable coverage measurements by giving Meson the command line flag `-Db_coverage=true`, you can generate coverage reports. Meson will autodetect what coverage generator tools you have installed and will generate the corresponding targets. These targets are `coverage-xml` and `coverage-text` which are both provided by [Gcovr](http://gcovr.com) (version 3.3 or higher) and `coverage-html`, which requires [Lcov](https://ltp.sourceforge.io/coverage/lcov.php) and [GenHTML](https://linux.die.net/man/1/genhtml) or [Gcovr](http://gcovr.com). As a convenience, a high-level `coverage` target is also generated which will produce all 3 coverage report types, if possible.
The output of these commands is written to the log directory `meson-logs` in your build directory.
-Parallelism
---
+## Parallelism
To reduce test times, Meson will by default run multiple unit tests in parallel. It is common to have some tests which can not be run in parallel because they require unique hold on some resource such as a file or a D-Bus name. You have to specify these tests with a keyword argument.
@@ -51,8 +56,7 @@ By default Meson uses as many concurrent processes as there are cores on the tes
$ MESON_TESTTHREADS=5 ninja test
```
-Priorities
---
+## Priorities
*(added in version 0.52.0)*
diff --git a/docs/markdown/Users.md b/docs/markdown/Users.md
index 5cbef8a..7290a5b 100644
--- a/docs/markdown/Users.md
+++ b/docs/markdown/Users.md
@@ -65,6 +65,7 @@ listed in the [`meson` GitHub topic](https://github.com/topics/meson).
- [Libepoxy](https://github.com/anholt/libepoxy/), a library for handling OpenGL function pointer management
- [libfuse](https://github.com/libfuse/libfuse), the reference implementation of the Linux FUSE (Filesystem in Userspace) interface
- [Libgit2-glib](https://git.gnome.org/browse/libgit2-glib), a GLib wrapper for libgit2
+ - [libglvnd](https://gitlab.freedesktop.org/glvnd/libglvnd), Vendor neutral OpenGL dispatch library for Unix-like OSes
- [Libhttpseverywhere](https://git.gnome.org/browse/libhttpseverywhere), a library to enable httpseverywhere on any desktop app
- [libmodulemd](https://github.com/fedora-modularity/libmodulemd), a GObject Introspected library for managing [Fedora Project](https://getfedora.org/) module metadata.
- [Libosmscout](https://github.com/Framstag/libosmscout), a C++ library for offline map rendering, routing and location
@@ -77,6 +78,7 @@ format files
- [Marker](https://github.com/fabiocolacio/Marker), a GTK-3 markdown editor
- [Mesa](https://gitlab.freedesktop.org/mesa/mesa/), an open source graphics driver project
- [MiracleCast](https://github.com/albfan/miraclecast), connect external monitors to your system via Wifi-Display specification aka Miracast
+ - [mrsh](https://github.com/emersion/mrsh), a minimal POSIX shell
- [Nautilus](https://gitlab.gnome.org/GNOME/nautilus), the GNOME file manager
- [Nemo](https://github.com/linuxmint/nemo), the file manager for the Cinnamon desktop environment
- [oomd](https://github.com/facebookincubator/oomd), a userspace Out-Of-Memory (OOM) killer for Linux systems
@@ -85,9 +87,11 @@ format files
- [Orc](http://cgit.freedesktop.org/gstreamer/orc/), the Optimized Inner Loop Runtime Compiler (not the default yet)
- [OTS](https://github.com/khaledhosny/ots), the OpenType Sanitizer, parses and serializes OpenType files (OTF, TTF) and WOFF and WOFF2 font files, validating and sanitizing them as it goes. Used by Chromium and Firefox
- [Outlier](https://github.com/kerolasa/outlier), a small Hello World style meson example project
+ - [Pacman](https://git.archlinux.org/pacman.git/tree/), a package manager for Arch Linux
- [Pango](https://git.gnome.org/browse/pango/), an Internationalized text layout and rendering library (not the default yet)
- [Parzip](https://github.com/jpakkane/parzip), a multithreaded reimplementation of Zip
- [Peek](https://github.com/phw/peek), simple animated GIF screen recorder with an easy to use interface
+ - [PicoLibc](https://github.com/keith-packard/picolibc), a standard C library for small embedded systems with limited RAM
- [PipeWire](https://github.com/PipeWire/pipewire), a framework for video and audio for containerized applications
- [Pithos](https://github.com/pithos/pithos), a Pandora Radio client
- [Pitivi](https://github.com/pitivi/pitivi/), a nonlinear video editor
diff --git a/docs/markdown/snippets/add_dictionary_variable_key.md b/docs/markdown/snippets/add_dictionary_variable_key.md
index 373ce04..72294ae 100644
--- a/docs/markdown/snippets/add_dictionary_variable_key.md
+++ b/docs/markdown/snippets/add_dictionary_variable_key.md
@@ -1,17 +1,9 @@
-## Adding dictionary entry using string variable as key
-
-New dictionary entry can now be added using string variable as key,
-in addition to using string literal as key.
+## Dictionary entry using string variable as key
+Keys can now be any expression evaluating to a string value, not limited
+to string literals any more.
```meson
-dict = {}
-
-# A variable to be used as a key
-key = 'myKey'
-
-# Add new entry using the variable
-dict += {key : 'myValue'}
-
-# Test that the stored value is correct
-assert(dict[key] == 'myValue', 'Incorrect value retrieved from dictionary')
+d = {'a' + 'b' : 42}
+k = 'cd'
+d += {k : 43}
```
diff --git a/docs/markdown/snippets/find_program.md b/docs/markdown/snippets/find_program.md
new file mode 100644
index 0000000..2bef824
--- /dev/null
+++ b/docs/markdown/snippets/find_program.md
@@ -0,0 +1,9 @@
+## Search directories for `find_program()`
+
+It is now possible to give a list of absolute paths where `find_program()` should
+also search, using the `dirs` keyword argument.
+
+For example on Linux `/sbin` and `/usr/sbin` are not always in the `$PATH`:
+```meson
+prog = find_program('mytool', dirs : ['/usr/sbin', '/sbin'])
+```