aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts
AgeCommit message (Collapse)AuthorFilesLines
2018-06-18Made install a top level Meson command.Jussi Pakkanen1-441/+0
2018-06-18meson_install: Don't add DESTDIR to install_nameNirbheek Chauhan1-2/+1
This was added accidentally. Includes a test for it. Also fix a rebase error. The variable was defined incorrectly and was overwritten with the correct value immediately afterwards.
2018-06-18macos: Rewrite install_name for dependent built libraries on installNirbheek Chauhan2-9/+14
On macOS, we set the install_name for built libraries to @rpath/libfoo.dylib, and when linking to the library, we set the RPATH to its path in the build directory. This allows all built binaries to be run as-is from the build directory (uninstalled). However, on install, we have to strip all the RPATHs because they point to the build directory, and we change the install_name of all built libraries to the absolute path to the library. This causes the install name in binaries to be out of date. We now change that install name to point to the absolute path to each built library after installation. Fixes https://github.com/mesonbuild/meson/issues/3038 Fixes https://github.com/mesonbuild/meson/issues/3077 With this, the default workflow on macOS matches what everyone seems to do, including Autotools and CMake. The next step is providing a way for build files to override the install_name that is used after installation for use with, f.ex., private libraries when combined with the install_rpath: kwarg on targets.
2018-06-18depfixer: Rewrite install_name for dylibs on installNirbheek Chauhan2-8/+18
The install name is used by consumers of the library to find the library at runtime. If it's @rpath/libfoo.dylib, all consumers must manually add the library path to RPATH, which is not what people expect. Almost everyone sets the library install name as the full path to the library, and this is done at install time with install_name_tool.
2018-06-17gtkdoc: Run gtkdoc-scangobj command from build directoryXavier Claessens1-2/+3
All paths in CFLAGS are relative to build_root, so current directory must be there we invoking gtkdoc-scangobj. Closes: #3379
2018-06-07gettext: Install .mo files atomicallyPhilip Chimento1-2/+4
Without this, building a module in a Flatpak app manifest that is a newer version of a module already present in the Flatpak runtime will fail. (The Flatpak file system is a bunch of hard links to readonly files, which can be replaced but not written to.) This instead creates a temporary file in the same directory as the destination (to avoid cross-device renaming errors) and atomically renames the temporary file to the destination, replacing it instead of rewriting it as shutil.copyfile() would do.
2018-06-06Fix issues found by flake8Xavier Claessens1-1/+1
2018-06-05Set WINEPATH when running serialized executablesNirbheek Chauhan1-0/+9
When the exe runner is `wine` or `wine32` or `wine64`, etc. This allows people to run tests with wine. Note that you also have to set WINEPATH to point to your custom prefix(es) if your tests use external dependencies. Closes https://github.com/mesonbuild/meson/issues/3620
2018-06-02Add 'install_mode' to all installable targetsFilipe Brandenburger1-11/+13
This makes it possible to customize permissions of all installable targets, such as executable(), libraries, man pages, header files and custom or generated targets. This is useful, for instance, to install setuid/setgid binaries, which was hard to accomplish without access to this attribute.
2018-06-01Set the meson command to use when we know what it isNirbheek Chauhan1-4/+2
Instead of using fragile guessing to figure out how to invoke meson, set the value when meson is run. Also rework how we pass of meson_script_launcher to regenchecker.py -- it wasn't even being used With this change, we only need to guess the meson path when running the tests, and in that case: 1. If MESON_EXE is set in the env, we know how to run meson for project tests. 2. MESON_EXE is not set, which means we run the configure in-process for project tests and need to guess what meson to run, so either - meson.py is found next to run_tests.py, or - meson, meson.py, or meson.exe is in PATH Otherwise, you can invoke meson in the following ways: 1. meson is installed, and mesonbuild is available in PYTHONPATH: - meson, meson.py, meson.exe from PATH - python3 -m mesonbuild.mesonmain - python3 /path/to/meson.py - meson is a shell wrapper to meson.real 2. meson is not installed, and is run from git: - Absolute path to meson.py - Relative path to meson.py - Symlink to meson.py All these are tested in test_meson_commands.py, except meson.exe since that involves building the meson msi and installing it.
2018-06-01Revert "commandrunner: make run handle python options"Filipe Brandenburger1-21/+3
This reverts commit ab599b5733539130db5c4d17c664744f4d5aacaf.
2018-05-30commandrunner: make run handle python optionsMartin Kelly1-3/+21
Currently, commandrunner breaks when we give options to python because it assumes python commands are in the form "python script.py", rather than "python -u script.py" or "python -u -m module script.py". Extend it to be more resilient and correctly parse python options.
2018-05-24depfixer: Run install_name_tool only once while deleting rpathsNirbheek Chauhan1-2/+5
2018-05-24depfixer: We no longer run this as a scriptNirbheek Chauhan1-13/+0
2018-05-18Print message when using polkitRyan Gonzalez1-0/+2
2018-05-18Fix #3579: Wait for a permissions failure before trying to run pkexecRyan Gonzalez1-13/+17
2018-05-17Support installation via polkitRyan Gonzalez1-17/+27
2018-05-06gnome.gtkdoc: Allow passing file objects as xml_filesNirbheek Chauhan1-3/+6
If we pass a source files() object, we will look for it in the build directory, which is wrong. If we pass a build files() object (from configure_file()), we will find it in the build directory, and then try to copy it on top of itself in gtkdochelper.py getting a SameFileError. Add a test for it, and also properly iterate custom target outputs when adding to content files.
2018-05-01Made depfixer more robust on OSX. Closes #3493.Jussi Pakkanen1-4/+10
2018-04-18Add new builtin option --install-umaskFilipe Brandenburger1-8/+33
This option controls the permissions of installed files (except for those specified explicitly using install_mode option, e.g. in install_data rules.) An install-umask of 022 will install all binaries, directories and executable files with mode rwxr-xr-x, while all data and non-executable files will be installed with mode rw-r--r--. Setting install-umask to the string 'preserve' will disable this feature, keeping the permissions of installed files same as the files in the build tree (or source tree for install_data and install_subdir.) Note that, in this case, the umask used when building and that used when checking out the source tree will leak into the install tree. Keep the default as 'preserve', to show that no behavior is changed and all tests keep passing unchanged. Tested: ./run_tests.py
2018-04-14🤦🤦🤦Jussi Pakkanen2-8/+9
2018-04-08Update depfixer to fix rpaths also on OSX.Jussi Pakkanen2-11/+52
2018-04-02Merge pull request #3242 from thejk/coverage_targetsJussi Pakkanen1-73/+121
Use standalone coverage script for legacy targets
2018-04-02gtkdochelper: print warningsSébastien Wilmet1-0/+2
The GTK-Doc commands output was never printed, except in case of error. So there was no way to see the warnings. https://github.com/mesonbuild/meson/issues/2396
2018-03-27Always build parser objects anew to avoid leaking old data.Jussi Pakkanen1-3/+5
2018-03-19Create a helper for checking if a string has a path componentNirbheek Chauhan1-2/+3
This is used in a number of places, and in some places it is incomplete. Use a helper to ensure it's used properly.
2018-03-19Generate coveragereport directory for gcovr html targetJoel Klinghed1-0/+2
2018-03-19Exclude subprojects when doing coverageJoel Klinghed1-2/+12
Restore subproject exclusion for the html coverage report that existed in the ninja backend legacy target. Also exclude subprojects for the gcovr generated reports.
2018-03-19Use standalone coverage script for legacy targetsJoel Klinghed1-73/+109
ninja coverage -> generate all possible reports (text, xml, html) depending on gcovr and/or lcov/genhtml availability. ninja coverage-html -> generate only html report ninja coverage-xml -> generate only xml report ninja coverage-text -> generate only text report Make all targets phony, the old legacy rules where just annoying as you would have to remove the old report before being able to generate a new one. ninja coverage succeeds if it can generate at least one report. ninja coverage-* only succeeds if it can generate the requested report
2018-03-15Fix FileNotFoundError when restorecon unavailableFabrice Fontaine1-0/+4
Fixes: - http://autobuild.buildroot.net/results/d5dcdfdfab3503fdc387f99e68267972a38c417d Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2018-03-13Merge pull request #3145 from thejk/gcovrJussi Pakkanen1-4/+17
Support gcovr >= 3.1 and add gcovr html report as fallback
2018-03-12fixup! Allow gcovr >= 3.1 to be used to generate html coverage reportJoel Klinghed1-2/+2
Rename gcovr_3_1 to gcovr_new_rootdir
2018-03-12fixup! Fix coverage-xml and coverage-text targets for gcovr >= 3.1Joel Klinghed1-2/+2
Rename gcovr_3_1 to gcovr_new_rootdir
2018-03-12Use specific exception types instead of ExceptionAleksey Filippov1-1/+1
2018-03-11Do not use bare except [flake8]Aleksey Filippov1-1/+1
Use more specific exception types where appropriate. This patch does not change bare except calls if exception is re-raised.
2018-02-27Allow gcovr >= 3.1 to be used to generate html coverage reportJoel Klinghed1-1/+9
Modern gcovr includes html generation support so if lcov and genhtml are not available fallback to gcovr. Kept lcov and genhtml as default so to not surprise existing users of coverage-html with the different output of gcovr. gcovr added html support in 3.0 but as there already is a test for 3.1 because of the changes to -r/--rootdir I opted to only allow html generation for >= 3.1 to keep things simple.
2018-02-27Fix coverage-xml and coverage-text targets for gcovr >= 3.1Joel Klinghed1-3/+8
In gcovr 3.1 the -r/--rootdir argument changed meaning causing reports generated with gcovr 3.1 to not find the source files and look for *.gcda in the whole source tree rather than the build dir. So, detect gcovr version and if 3.1 give build_root to -r instead of source_root.
2018-02-08Remove all files outside the source directory from the coverage reportHenk van der Laan1-10/+7
Cuurently, a set of directories is filtered out from the output based on the location of system includes on most common linux distro's. This commit does away with the blacklist and implements a whitelist approach: only the files inside the source root are shown.
2018-02-05Fix install_subdir() installation messageAleksey Filippov1-5/+5
Print full destination path in 'Installing subdir ...' message, including DESTDIR, consistent with other installation functions. Use separate dst_dir and full_dst_dir variables to avoid mixing up the order in the future and make code more readable. Closes #3006.
2018-02-04Refactor and simplify install_subdir()Aleksey Filippov1-18/+36
- Pass exclude_files and exclude_directories relative to src_dir, same as specified by user and documented in public install_subdir(). - Make do_copydir() interface similar to do_copyfile(): install src_dir contents to dst_dir. - Remove src_prefix/src_dir code, it adds confusion and duplicates arguments. Use single src_dir parameter instead. - Make callers specify that src_dir contents should be installed under dst_dir/basename(src_dir) if necessary. - Use os.path.relpath() instead of string manipulations on paths. - Add documentation to do_copydir(): specify types and add usage example.
2018-01-30Use os.path: basename() and dirname() instead of split()Aleksey Filippov2-9/+9
According to Python documentation[1] dirname and basename are defined as follows: os.path.dirname() = os.path.split()[0] os.path.basename() = os.path.split()[1] For the purpose of better readability split() is replaced by appropriate function if only one part of returned tuple is used. [1]: https://docs.python.org/3/library/os.path.html#os.path.split
2018-01-30Echo coverage report uris after generation. Fixes #2805.Félix Piédallu1-1/+10
2018-01-14Avoid worrying about encodings when capturing child program outputIlia Mirkin1-5/+9
The output may be a binary data stream, not subject to any locale encoding. This avoids any encoding errors that might arise as a result. Also fixes github issue #2868.
2018-01-07gtkdochelper: Set LD_LIBRARY_PATH from -Wl,-rpath argumentsTing-Wei Lan1-3/+15
gnome.gtkdoc uses -Wl,-rpath to ensure the scanner executable built by gtkdoc-scangobj will load shared libraries from the correct directories. However, FreeBSD configures its linker to use --enable-new-dtags by default, which converts RPATH to RUNPATH. If users have LD_LIBRARY_PATH environment variable set, RUNPATH will be overrided by LD_LIBRARY_PATH and libraries will be loaded from wrong directories, causing undefined symbol error when running the executable. In order to solve the problem, we have to prepend directories specified with -Wl,-rpath to LD_LIBRARY_PATH to avoid relying on the deprecated RPATH attribute.
2017-12-30The scanbuild script does now also look for executables with a version in ↵snsmac1-1/+25
the name
2017-12-17Exclude llvm/clang lib headers from test coveragesnsmac1-0/+1
Excludes the /usr/lib/llvm-*/include/ directory from coverage. This directory is used on Ubuntu for the libclang-dev packages
2017-12-09Check for more errors when executing subprocess. (#2746)behlec1-4/+10
2017-12-07Improve error handling when failing to execute program. (#2743)behlec1-1/+4
2017-11-21Review fixes.Jussi Pakkanen1-5/+6
2017-11-20Replaced sys.executable use with the mesonlib equivalent.Jussi Pakkanen1-9/+5