summaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/depfixer.py
Commit message (Collapse)AuthorAgeFilesLines
* depfixer: always print the file name in messagesZbigniew Jędrzejewski-Szmek2021-11-091-6/+6
| | | | The messages are not useful unless we know what file they are about.
* depfixer: convert unused printing code to debugging functionsZbigniew Jędrzejewski-Szmek2021-11-091-31/+23
| | | | | | | | | | | | | | | | | | When installing with 'meson install --quiet' I'd get the following output: This file does not have an rpath. This file does not have a runpath. (It turns out that of the couple hundred of binaries that are installed, this message was generated for /usr/lib/systemd/boot/efi/linuxx64.elf.stub.) There doesn't seem to be any good reason for this output by default. But those functions can still be used for debugging. Under a debugger, returning the string is just as useful as printing it, but more flexible. So let's suppress printing of anything by default, but keep the extractor functions. The code was somewhat inconsistent wrt. to when .decode() was done. But it seems that we'll get can expect a decodable text string in all cases, so just call .decode() everywhere, because it's nicer to print decoded strings.
* depfixer: f-stringsZbigniew Jędrzejewski-Szmek2021-11-091-3/+3
|
* Fix typos discovered by codespellChristian Clauss2021-10-101-1/+1
|
* pylint: turn on superflous-parensDylan Baker2021-08-311-1/+1
| | | | | | | | We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
* fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger2021-06-291-1/+1
|
* depfixer: temporarily modify file permissionsHemmo Nieminen2021-03-241-8/+33
| | | | | | If the installed files don't have suitable file permissions depfixer will fail to process it. Temporarily lax file permissions to work around this.
* scripts/depfixer: make rpaths_dirs_to_remove a setDylan Baker2021-01-131-4/+4
| | | | | | It's only used for doing an `if x in container` check, which will be faster with a set, and the only caller already has a set, so avoid we can avoid a type conversion as well.
* depfixer: split new rpath into multiple entries for dedup comparisonsAlan Coopersmith2020-12-221-1/+1
| | | | | | Fixes: #8115 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* typing: fix code reviewDaniel Mensinger2020-09-081-1/+1
|
* typing: more fixesDaniel Mensinger2020-09-081-1/+1
|
* typing: fully annotate scriptsDaniel Mensinger2020-09-081-36/+42
|
* Dedup final install rpath.Jussi Pakkanen2020-08-301-6/+9
|
* Better log message on rpath error.Jussi Pakkanen2020-08-071-1/+2
|
* Let .pc files specify rpath.Dan Kegel2020-05-161-8/+24
| | | | Fixes #4027
* depfixer: Ignore more extensions that can't need RPATH fixesNirbheek Chauhan2020-02-171-5/+4
| | | | | | | | | | | | | | | | Generated headers, PDB files, import libraries, etc. Speed-up in gst-build on Windows: ``` meson install before: 5.4 seconds after: 5.1 seconds meson install --only-changed before: 2.7 seconds after: 1.6 seconds ```
* depfixer: Cache searching of install_name_toolNirbheek Chauhan2020-02-171-1/+11
| | | | | | | | | | | | | | | This gives a significant speedup in large projects such as gst-build since now we only search for the tool once. Speed-up on Windows: ``` meson install: before: 15.3 seconds after: 5.4 seconds meson install --only-changed: before: 11.6 seconds after: 2.7 seconds ```
* Prevent install_name_tool to run on EXE when cross compile on OSXBinh Nguyen2019-11-121-2/+2
|
* remove unreachable codeMichael Hirsch, Ph.D2019-08-021-3/+2
|
* Fix unused variables warningsDaniel Mensinger2019-04-291-1/+1
|
* Fix blind exceptionsDaniel Mensinger2019-04-291-1/+1
|
* depfixer: Do not try to fix rpaths of dllsMarvin Scholz2018-10-251-0/+3
|
* Do not try to remove duplicate RPATH entries on macOSDavid Seifert2018-10-141-2/+23
|
* java: remove manifest classpath from installed jarNiclas Moeslund Overby2018-07-031-0/+14
|
* macos: Rewrite install_name for dependent built libraries on installNirbheek Chauhan2018-06-181-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* depfixer: Rewrite install_name for dylibs on installNirbheek Chauhan2018-06-181-7/+15
| | | | | | | | | | 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.
* depfixer: Run install_name_tool only once while deleting rpathsNirbheek Chauhan2018-05-241-2/+5
|
* depfixer: We no longer run this as a scriptNirbheek Chauhan2018-05-241-13/+0
|
* Made depfixer more robust on OSX. Closes #3493.Jussi Pakkanen2018-05-011-4/+10
|
* 🤦🤦🤦Jussi Pakkanen2018-04-141-1/+8
|
* Update depfixer to fix rpaths also on OSX.Jussi Pakkanen2018-04-081-9/+51
|
* Close files reliably.Jussi Pakkanen2017-07-181-0/+5
|
* Use sys.exit rather than plain exit.Jussi Pakkanen2017-07-161-1/+1
|
* Whitespace tweaks to reduce Flake8 warningsAlistair Thomas2017-05-291-1/+1
|
* Use American English: behaviour -> behaviorPeter Hutterer2017-05-041-1/+1
|
* Don't use len() to test emptiness vs not emptinessDylan Baker2017-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Meson has a common pattern of using 'if len(foo) == 0:' or 'if len(foo) != 0:', however, this is a common anti-pattern in python. Instead tests for emptiness/non-emptiness should be done with a simple 'if foo:' or 'if not foo:' Consider the following: >>> import timeit >>> timeit.timeit('if len([]) == 0: pass') 0.10730923599840025 >>> timeit.timeit('if not []: pass') 0.030033907998586074 >>> timeit.timeit('if len(['a', 'b', 'c', 'd']) == 0: pass') 0.1154778649979562 >>> timeit.timeit("if not ['a', 'b', 'c', 'd']: pass") 0.08259823200205574 >>> timeit.timeit('if len("") == 0: pass') 0.089759664999292 >>> timeit.timeit('if not "": pass') 0.02340641999762738 >>> timeit.timeit('if len("foo") == 0: pass') 0.08848102600313723 >>> timeit.timeit('if not "foo": pass') 0.04032287199879647 And for the one additional case of 'if len(foo.strip()) == 0', which can be replaced with 'if not foo.isspace()' >>> timeit.timeit('if len(" ".strip()) == 0: pass') 0.15294511600222904 >>> timeit.timeit('if " ".isspace(): pass') 0.09413968399894657 >>> timeit.timeit('if len(" abc".strip()) == 0: pass') 0.2023209120015963 >>> timeit.timeit('if " abc".isspace(): pass') 0.09571301700270851 In other words, it's always a win to not use len(), when you don't actually want to check the length.
* Do not obliterate old rpath because it might be used due to read only data ↵Jussi Pakkanen2017-04-171-3/+12
| | | | sharing. Closes #1619.
* cleanup: Remove redundant parenthesesMike Sinkovsky2017-01-181-2/+2
|
* fix 'unreachable code' warningsMike Sinkovsky2017-01-031-1/+1
|
* style: fix E703 violationsIgor Gnatenko2017-01-011-7/+7
| | | | | | E703: statement ends with a semicolon Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* style: fix E265 violationsIgor Gnatenko2017-01-011-9/+9
| | | | | | E265: block comment should start with '# ' Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* style: fix E226 violationsIgor Gnatenko2017-01-011-12/+12
| | | | | | E226: missing whitespace around arithmetic operator Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* Fix installation of statically linked executable for ELF binary.Matthieu Gautier2016-12-211-0/+7
| | | | | | | At installation, if the executable is a ELF file, we try to fix the dependencies in the binary section. If a executable has been compiled with the --static flag, there is no .dynamic section in the ELF binary and so we need to handle this case.
* remove shebangs from scriptsIgor Gnatenko2016-12-181-2/+0
| | | | | | | | | | | | | | | | | meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/regen_checker.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_test.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_benchmark.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_exe.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/symbolextractor.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/commandrunner.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/gtkdochelper.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_install.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/depfixer.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/dirchanger.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/delwithsuffix.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/vcstagger.py 644 /usr/bin/python3 Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* Fix depfixer on MIPS.Aurelien Jarno2016-10-241-0/+6
|
* Remove shebangs on files that are not runnable and add execute bits to those ↵Jussi Pakkanen2016-10-071-0/+0
| | | | that are.
* Convert depfixer.Elf class into a context manager.Elliott Sales de Andrade2016-08-271-12/+22
| | | | This allows for automatic closing of its internal file handle.
* Handle both DT_RPATH as well as DT_RUNPATH when fixing rpath settings.Jussi Pakkanen2016-08-041-7/+23
|
* Invoke depfixer in-process to make it faster. Closes #480.Jussi Pakkanen2016-03-301-10/+13
|
* Renamed meson package to mesonbuild so that we can have a script named meson ↵Jussi Pakkanen2016-01-161-0/+302
in the same toplevel dir.