aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
AgeCommit message (Collapse)AuthorFilesLines
2023-07-19move various bits of type-checking only code to TYPE_CHECKING blocksEli Schwartz1-1/+1
Mostly detected with flake8-type-checking. Also quote T.cast() first arguments, since those are not affected by future annotations.
2023-07-12Add type annotations where they previously didn't existTristan Partin1-5/+5
2023-07-12Annotate naked fundamental Python typesTristan Partin1-4/+5
Although mypy wasn't complaining, pyright was.
2023-07-12Replace some type comments with annotationsTristan Partin1-4/+4
2023-07-04environment: separate illumos and Solaris kernels in MachinesDylan Baker1-1/+12
While both kernels are derived from the OpenSolaris project of Sun, they have diverged and code that works with one may not work with the other. As such, we should provide different values for them. This was requested by both Oracle and the illumos upstreams. Fixes: #11922
2023-06-19Add kernel and subsystem properties to machine objects.Jussi Pakkanen1-2/+26
2023-06-08dependencies/llvm: strip default include dirsKarol Herbst1-1/+13
Fixes an issue with rust.bindgen if a cmake LLVM dependency with the system include_type is getting used as a dependency.
2023-04-28detect_cpu: Fix mips32 detection on mips64Cyan1-1/+9
MIPS64 can run MIPS32 code natively, so there is a chance that a mixture of MIPS64 kernel and MIPS32 userland exists. Before this Meson just treats such mixture as mips64, because uname -m returns mips64. So in this case we have to check compiler builtin defines for actual architecture and CPU in use. - Also fixes mips64 related detection tests in internaltests: Normalize mips64 as mips first, then if __mips64 is defined, return mips64 for mips64* machines. This is a bit confiusing because normally one would detect if a flag of 32-bit target is defined while running on a 64-bit machine. For mips64 it is almost just the other way around - we need to detect if __mips64 is set to make sure it is a mips64 environment. Co-Authored-By: Jue Wang <maliya355@outlook.com>
2023-04-11fix various spelling issuesJosh Soref1-1/+1
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-03get_llvm_tool_names: add released llvm versionsChristoph Reiter1-0/+2
2023-02-01micro-optimize: define typing-only objects in TYPE_CHECKINGEli Schwartz1-2/+3
Union types that exist solely for use as annotations don't need to be created in normal runs.
2023-02-01treewide: add future annotations importEli Schwartz1-0/+1
2023-01-22Revert "debug cygwin CI"Eli Schwartz1-1/+0
This reverts commit 79d7891746a7864a1407d48eac8a753b225ec6c3. This debug print probably should not have ended up live. Moreover, the function it debugs is, surprisingly, called rather often. Adding I/O to it causes it to begin to noticeably lag, on the scale of adding actual *minutes* to a setup run. Fixes #11322
2023-01-03Add fatal=False to many mlog.warnings()Dylan Baker1-2/+3
There are lots of warnings that become fatal, that are simply unfixable by the end user. Things like using old versions of software (because they're using some kind of LTS release), warnings about compilers not supporting certain kinds of checks, or standards being upgraded due to skipped implementations (MSVC has c++98 and c++14, but not c++11). None of these should be fatal, they're informative, and too important to reduce to notices, but not important enough to stop meson if they're printed.
2022-12-11debug cygwin CIEli Schwartz1-0/+1
2022-12-07Remove useless EmptyExternalProgramXavier Claessens1-5/+3
It is only used by Environment.get_exe_wrapper() and every callers were handling None already. Type annotation was wrong, it already could return None for the case an exe wrapper is needed but none is provided.
2022-11-30pylint: enable the set_membership pluginDylan Baker1-2/+2
Which adds the `use-set-for-membership` check. It's generally faster in python to use a set with the `in` keyword, because it's a hash check instead of a linear walk, this is especially true with strings, where it's actually O(n^2), one loop over the container, and an inner loop of the strings (as string comparison works by checking that `a[n] == b[n]`, in a loop). Also, I'm tired of complaining about this in reviews, let the tools do it for me :)
2022-11-24Fix various spelling errorsDavid Robillard1-1/+1
Found with codespell.
2022-10-25Fix native compilation on ARM64 WindowsGustavoLCR1-19/+3
Move `detect_native_windows_arch()` to `mesonlib/universal.py` and rename it to `windows_detect_native_arch()` Use `IsWow64Process2()` to detect native architecture if available Use native `vcvarsarm64.bat` to initialize vsenv if available
2022-09-19pylint: enable consider-using-inDylan Baker1-1/+1
2022-09-19compilers: don't use instance checks to determine propertiesEli Schwartz1-2/+2
In various situations we want to figure out what type of compiler we have, because we want to know stuff like "is it the pgi one", or "does it use msvc style". The compiler object has this property already, via an API specifically designed to communicate this info, but instead we performed isinstance checks on a compiler class. This is confusing and indirect, and has the side effect of requiring more imports everywhere. We should do away with it.
2022-06-27dependencies: update llvm versionsDylan Baker1-1/+3
15 is the current snapshot version, 13 and 14 are released.
2022-04-30pkgconfig: Use EnvironmentVariables to build PKG_CONFIG_* envXavier Claessens1-1/+1
The new get_env() method that returns an EnvironmentVariables object will be needed in next commit that will pass it to CustomTarget. This has the side effect to use the proper os specific path separator instead of hardcoding `:`. It is the obvious right thing to do here, but has caused issues in the past. Hopefully issues have been fixed in the meantime. If not, better deal with fallouts than keep doing the wrong thing forever.
2022-03-07merge various TYPE_CHECKING blocks into oneEli Schwartz1-3/+1
A bunch of files have several T.TYPE_CHECKING blocks that each do some things which could just as well be done once, with a single `if` statement. Make them do so.
2022-02-28Change jar() default install dirTristan Partin1-0/+4
The previous install dir seemed incorrect when looking at various Linux distributions.
2021-11-01coverage generator: obey the documentation and only generate supported outputsEli Schwartz1-4/+4
We say: > If version 4.2 or higher of the first is found, targets coverage-text, > coverage-xml, coverage-sonarqube and coverage-html are generated. But this is totally untrue. Make it true, by actually checking (and not generating broken coverage commands when older versions of gcovr are found). Fixes #9505
2021-10-10Fix typos discovered by codespellChristian Clauss1-3/+3
2021-10-04fix extra whitespaceEli Schwartz1-1/+0
discovered via flake8 --select E303
2021-09-24pylint: check for duplicate importsDylan Baker1-1/+0
I ran into one of these from LGTM, and it would be nice if pylint could warn me as part of my local development process instead of waiting for the CI to tell me.
2021-08-30environment: correctly handle cpu value aarch64_beDylan Baker1-1/+7
Fixes #9191
2021-08-30environment: add ppc -> ppc64 for aix to detect_cpuDylan Baker1-0/+4
This seems like an oversight, that we'd replace ppc with ppc64 on AIX for the cpu_family, but not for the specific cpu.
2021-08-30environment: Add a few type annotationsDylan Baker1-6/+4
These are just annotations in code that I'm working for this series
2021-08-27environment: Add correct annotation for wrap_resolverDylan Baker1-1/+2
2021-08-20environment: add annotations and fix get_meson_commandDylan Baker1-3/+7
It is theoretically possible for the command to be None so we should handle that.
2021-08-20environment: add some missing annotationsDylan Baker1-5/+5
2021-07-05more f-strings too complex to be caught by pyupgradeEli Schwartz1-2/+2
2021-06-25typing: Annotate compilers.detectDaniel Mensinger1-1/+1
2021-06-25Split compiler detection from EnvironmentDaniel Mensinger1-1363/+5
This moves all the compiler detection logic into the new compilers.detect module. This dramatically reduces the size and complexity of Environment.
2021-06-14environment: Add LLVM suffixes for 11 and 12Ting-Wei Lan1-2/+4
Both LLVM 11 and 12 are stable releases. Note that FreeBSD changes the way to version LLVM executables in LLVM 10.
2021-06-09typing: Fully annotate run_project_tests.pyDaniel Mensinger1-2/+2
2021-06-07environment: Add detection logic for cythonDylan Baker1-0/+28
2021-04-12dependency: Add JDK system dependencyTristan Partin1-2/+3
The JDK system dependency is important for detecting JDK include paths that may be useful when developing a JNI interface.
2021-04-06environment: simplify handling of native files with no cross filesDylan Baker1-7/+3
Instead of treating native files as always being for the build machine, and then copying them to the host machine, treat them as for the build machine only when a cross file is also present
2021-04-06environment: fix typos in commentDylan Baker1-1/+1
2021-04-06environment: don't load project options from a native file in a cross buildDylan Baker1-1/+3
2021-04-06environment: Add some comments to the _load_machine_file_options methodDylan Baker1-2/+11
2021-04-01environment: get environment variables for both host and build machinesDylan Baker1-6/+2
Fixes #8605
2021-03-30Split environment variable and command line cflagsDylan Baker1-1/+22
They are supposed to have different behavior. The environment variables apply to both the compiler and linker when the compiler acts as a linker, but the command line ones do not. Fixes #8345
2021-03-19split program related classes and functions out of dependenciesDylan Baker1-3/+3
Dependencies is already a large and complicated package without adding programs to the list. This also allows us to untangle a bit of spaghetti that we have.
2021-03-14ninjabackend: Use rsp_file_syntax methodDylan Baker1-1/+1
This also makes us of the new enum value in the backend, for better type saftey.