summaryrefslogtreecommitdiff
path: root/mesonbuild/minstall.py
Commit message (Collapse)AuthorAgeFilesLines
* minstall: always track meson-created directoriesEli Schwartz2021-03-181-5/+1
| | | | | | | | | | | If a custom_target output is a directory, we install it as a directory, not as a file. And, we try to track subdirectories which are created so uninstalling works. But one directory creation did not go through DirMaker, in the case where the output directory does not have any further subdirectories. Consolidate on makedirs, since I don't see much point in using os.mkdir right here.
* minstall: Correctly set uid/gid of installed filesPeter Kjellerstedt2021-03-061-1/+1
| | | | | | | | | | | In commit caab4d3d, the uid and gid arguments passed to os.chown() by set_chown() were accidentally swapped, causing files to end up with incorrect owner/group if the owner and group are not the same. Also update the documentation to better indicate which argument to install_mode is which. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
* mass rewrite of string formatting to use f-strings everywhereEli Schwartz2021-03-041-18/+18
| | | | performed by running "pyupgrade --py36-plus" and committing the results
* minstall: Add --skip-subprojects optionXavier Claessens2021-02-221-17/+38
| | | | | | | | | By default all subprojects are installed. If --skip-subprojects is given with no value only the main project is installed. If --skip-subprojects is given with a value, it should be a coma separated list of subprojects to skip and all others will be installed. Fixes: #2550.
* Fix destdir detection for installation via polkitXℹ Ruoyao2021-02-161-1/+1
| | | | | | In 0.57.0 installation via polkit won't work anymore. `destdir` is defaulted to an empty string ('') instead of None. But polkit installation code incorrectly tests `destdir is None`.
* minstall: Add --dry-run optionXavier Claessens2021-02-041-24/+100
| | | | Closes: #1281
* add_install_script: add skip_if_destdir kwargXavier Claessens2021-01-301-3/+6
| | | | | | | | It is common, at least in GNOME projects, to have scripts that must be run only in the final destination, to update system icon cache, etc. Skipping them from Meson ensures we can properly log that they have not been run instead of relying on such scripts to to it (they don't always).
* minstall: Add --destdir command line optionXavier Claessens2021-01-301-0/+7
|
* Fix executable as script on WindowsXavier Claessens2021-01-301-7/+3
| | | | | | | | | | | | | | | | | | On Windows this would fail because of missing DLL: ``` mylib = library(...) exe = executable(..., link_with: mylib) meson.add_install_script(exe) ``` The reason is on Windows we cannot rely on rpath to find libraries from build directory, they are searched in $PATH. We already have all that mechanism in place for custom_target() using ExecutableSerialisation class, so reuse it for install/dist/postconf scripts too. This has bonus side effect to also use exe_wrapper for those scripts. Fixes: #8187
* minstall: Fix signature of monkeypatched os.chownDylan Baker2021-01-131-3/+12
| | | | this also clears up the last of the mypy problems in minstall, yay!
* minstall: Pass destdir and fullprefix instead of adding them to instanceDylan Baker2021-01-131-25/+25
| | | | Same idea as the last patch, just different data
* minstall: Pass DirMaker separately instead of adding to instanceDylan Baker2021-01-131-24/+23
| | | | | | | Add a new attribute to an object outside of the initializer of construtor is considered an antipattern for good reason, it's gross, it's confusing, and it often leads to AttributeErrors down some paths. Let's not do that.
* minstall: Add type annotationsDylan Baker2021-01-131-31/+64
| | | | | | | This adds annotations and fixes a couple of issues (passing Set[bytes] where List[byte] is expected), however, there's some very gross addition of attributes to types going on that I haven't fixed yet, and mypy is very grump about.
* build: Add some type annotationsDylan Baker2021-01-131-0/+2
|
* minstall: fix importsDylan Baker2021-01-131-6/+10
| | | | | This uses PEP8 style, one per from `import mod`, but with commas from `from mod import a, b`. Also run sort, for niceness.
* Fix missed imports in #7902wereii2020-12-281-0/+3
|
* mtest: only build what is needed for the testsPaolo Bonzini2020-12-141-1/+17
| | | | | | | | | | | | | | 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
* install: don't elevate when using destdirThomas Weißschuh2020-12-101-1/+1
| | | | | | | | Previously the destdir was ignored completely when using elevated privileges to install files as pkexec stripped the DESTDIR environment variable. As the destdir is not supposed to require any special privileges anyways, just re-raise the error.
* pylint: Turn on warnings for incorrect number of argsDylan Baker2020-09-221-1/+1
| | | | | | | | | This catches some very real errors. The one in scalapack is pretty silly actually, it's failing to figure out that the exploded list is at least two arguments. However, the code is actually clearer by not using a list and exploding it, so I've done that and pylint is happy too.
* minstall: Add version field to install dataNirbheek Chauhan2020-09-101-1/+13
| | | | | | | And check the install data in the same way that mtest checks serialisation data. Fixes https://github.com/mesonbuild/meson/issues/2354
* minstall: Print a big FAILED when a script failsNirbheek Chauhan2020-09-081-4/+6
| | | | | | | We don't run any further scripts when this happens, so we need to print a big error. The exit code was already correct. Fixes https://github.com/mesonbuild/meson/issues/7627
* simplify shutil usage by invoking copy2 where appropriateEli Schwartz2020-08-201-4/+2
| | | | It's equivalent to copyfile + copystat with the same arguments.
* Let .pc files specify rpath.Dan Kegel2020-05-161-1/+1
| | | | Fixes #4027
* Do not call restorecon if there are no files to installMichael Kuhn2020-03-291-0/+4
| | | | Fixes #6452
* Cherry-picking - (rm python2 % add python3 .format) (#6725)Michael Brockus2020-03-031-9/+9
|
* minstall: Add a new option --quietNirbheek Chauhan2020-02-171-10/+18
| | | | | | | | | | | | | This is a significant speed-up on Windows because terminals are slow to print things out. Speed-up in gst-build on Windows: ``` meson install: before: 5.1 seconds after: 4.0 seconds ```
* minstall: Optimize when to call makedirs()Nirbheek Chauhan2020-02-171-9/+11
| | | | | | | | | | | | | | In `--only-changed` mode, we were spending half our time inside `makedirs()`, which is a waste in the case when only a few files have changed. Speed-up on Windows with gst-build: ``` meson install --only-changed before: 1.6 seconds after: 0.9 seconds ```
* minstall: Error out when trying to copy file to dirNirbheek Chauhan2020-02-171-0/+1
| | | | | Not sure why this wasn't already an error. It's a bad situation to be in, and we should not ignore it.
* minstall: Fix check for when something was installedNirbheek Chauhan2020-02-171-10/+11
| | | | | | | | | | | | | | | If we preserve the existing file, we did not install anything. In that case, the output now looks like: ``` ninja: Entering directory `.' ninja: no work to do. Nothing to install. Preserved 1732 unchanged files, see meson-logs\install-log.txt for the full list ``` This also avoids an `isfile` lookup, which shaves off a few seconds in gst-build install.
* minstall: Add new hidden argument --profile-selfNirbheek Chauhan2020-02-171-1/+9
| | | | Same purpose as `meson setup`.
* minstall: Make --only-changed less verboseNirbheek Chauhan2020-02-111-1/+5
| | | | | | | | | | | | When `--only-changed` is passed, we only want to know about files that were newly-installed. Everything else is noise. The full list can always be found in `install-log.txt` anyway. Sample output: ``` ninja: Entering directory `.' ninja: no work to do. Preserved 667 unchanged files, see meson-logs\install-log.txt for the full list ```
* lgtm: Fix redundant codeDaniel Mensinger2019-12-051-1/+0
|
* Fix for issue #4499, multiple entries per file in install-log.txtOrlando Wingbrant2019-10-231-1/+0
|
* Fix *.pdb files missing in meson introspect --installed outputJakub Adam2019-10-091-5/+0
| | | | | On Windows, make sure the introspect command lists all Program database (PDB) files containing debugging information that Meson will install.
* Catch NotADirectoryError to fix selinux errorAndrew Conrad2019-09-271-1/+1
| | | | Fixes #4798
* Log the used strip command. [skip ci]Jussi Pakkanen2019-09-031-1/+1
|
* Add basic Webassembly support via Emscripten.Jussi Pakkanen2019-08-051-0/+7
|
* Fix builtin variable namesDaniel Mensinger2019-04-291-1/+1
|
* Fix blind exceptionsDaniel Mensinger2019-04-291-1/+1
|
* pep8 py37Michael Hirsch, Ph.D2019-01-291-2/+2
|
* fix meson configure exception when install_umask is not an intNicolas Schneider2019-01-061-2/+2
|
* print 'Nothing to install.' if nothing was installedNicolas Schneider2019-01-011-0/+10
| | | | Fixes #882.
* minstall: Do not delete dst files when installing a directoryXavier Claessens2018-11-201-3/+1
| | | | | | | do_copyfile() already takes the decision to delete or preserve them. Also do not append a confusing '.' in log messages that finish by a file path.
* Fix flake8 'imported but unused' reportsJon Turney2018-10-241-1/+1
| | | | | | | | $ flake8 | grep F401 ./mesonbuild/minstall.py:15:1: F401 'gzip' imported but unused ./mesonbuild/backend/backends.py:26:1: F401 '..compilers.get_macos_dylib_install_name' imported but unused ./mesonbuild/backend/backends.py:29:1: F401 'functools.lru_cache' imported but unused ./mesonbuild/scripts/dist.py:27:1: F401 'mesonbuild.dependencies.ExternalProgram' imported but unused
* Remove implicit compression of man pagesMichał Górny2018-10-201-11/+1
| | | | | | | | | Remove the code responsible for implicitly compressing manpages as .gz files. It has been established that manpage compression is a distro packager's task, with existing distros already having their own implementations of compression. Fixes #4330
* Use a single ArgumentParser for all subcommandsXavier Claessens2018-10-041-10/+2
| | | | | | This has the adventage that "meson --help" shows a list of all commands, making them discoverable. This also reduce the manual parsing of arguments to the strict minimum needed for backward compatibility.
* Revert symlink copy behaviour. Closes #4069.Jussi Pakkanen2018-08-231-1/+13
|
* minstall: use follow_symlinks to check executableMarco Trevisan (Treviño)2018-08-171-3/+3
| | | | | | | This could happen when setting an default install mode but with broken symlinks. Fixes #3914
* minstall: never follow symlinks when setting ownershipMarco Trevisan (Treviño)2018-08-171-1/+19
| | | | | | | | | | | | | | Since we're supposed to call this for each installed path, we only should go through what we've installed and not what this point to, as it might be outside our scope or not existent. To do this, since shutil.chown doesn't expose the follow_symlink that os.chown has, we can temporarily replace os.chown with a lambda that acutually passes all the values as we want them, and then restore it to the built-in functions. Not the nicest way, but fixes the issue without having to reimplement what shutil does. Fixes #3914
* minstall: never try to set chmod on symlinksMarco Trevisan (Treviño)2018-08-171-2/+9
| | | | | | | | | | | | It's only supported by few platforms when the linked file exists, while it would cause an error otherwise. In any case just implement this via an helper set_chmod function that will handle the case where follow_symlinks is not supported by the platform and will just not set any mod for the link itself (as it would otherwise apply to the linked file). Fixes #3914