diff options
-rw-r--r-- | .pylintrc | 9 | ||||
-rw-r--r-- | azure-pipelines.yml | 15 | ||||
-rw-r--r-- | cross/armclang-linux.txt | 35 | ||||
-rw-r--r-- | docs/markdown/Users.md | 1 | ||||
-rw-r--r-- | docs/markdown/snippets/kconfig_enhancements.md | 3 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/arm.py | 4 | ||||
-rw-r--r-- | mesonbuild/coredata.py | 20 | ||||
-rw-r--r-- | mesonbuild/dependencies/misc.py | 5 | ||||
-rw-r--r-- | mesonbuild/environment.py | 1 | ||||
-rw-r--r-- | mesonbuild/modules/unstable_kconfig.py | 13 | ||||
-rw-r--r-- | mesonbuild/scripts/depfixer.py | 5 | ||||
-rw-r--r-- | sider.yml (renamed from sideci.yml) | 0 | ||||
-rw-r--r-- | test cases/kconfig/4 load_config builddir/meson.build | 4 |
13 files changed, 93 insertions, 22 deletions
diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 0000000..10483d3 --- /dev/null +++ b/.pylintrc @@ -0,0 +1,9 @@ +[MASTER] +jobs=0 + +[REPORTS] +score=no + +[MESSAGES CONTROL] +disable=all +enable=unreachable
\ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5f6dafd..56dc4b9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -12,6 +12,21 @@ variables: CI: 1 jobs: +- job: Pylint + pool: + vmImage: ubuntu-latest + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + addToPath: true + - script: python -m pip install pylint + displayName: Install Pylint + - script: pylint mesonbuild + displayName: Lint Checks + + - job: vs2015 pool: vmImage: vs2015-win2012r2 diff --git a/cross/armclang-linux.txt b/cross/armclang-linux.txt new file mode 100644 index 0000000..2772d82 --- /dev/null +++ b/cross/armclang-linux.txt @@ -0,0 +1,35 @@ +# Using ARM compilers from Linux command line is tricky and +# not really well documented because they want you to use +# their IDE instead. +# +# First you need to do the full install with the IDE and set +# up license files et al. This may be possible from the command +# line. +# +# Then you need to do the following: +# +# Select toolchain by running /opt/arm/developmentstudio-2019.0/bin/select_default_toolchain +# Armcc is only available in toolchain version 5. +# Armclang is only available in toolchain version 6. +# Start shell with /opt/arm/developmentstudio-2019.0/bin/suite_exec zsh +# Now the compilers will work. + +[binaries] +# we could set exe_wrapper = qemu-arm-static but to test the case +# when cross compiled binaries can't be run we don't do that +c = '/opt/arm/developmentstudio-2019.0/sw/ARMCompiler6.12/bin/armclang' +#c = '/opt/arm/developmentstudio-2019.0/sw/ARMCompiler5.06u6/bin/armcc' +#cpp = '/usr/bin/arm-linux-gnueabihf-g++' +ar = '/opt/arm/developmentstudio-2019.0/sw/ARMCompiler6.12/bin/armar' +#strip = '/usr/arm-linux-gnueabihf/bin/strip' +#pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config' + +[properties] + +#c_args = ['--target=aarch64-arm-none-eabi'] + +[host_machine] +system = 'baremetal' +cpu_family = 'arm' +cpu = 'armv7' # Not sure if correct. +endian = 'little' diff --git a/docs/markdown/Users.md b/docs/markdown/Users.md index 475fa54..37939dc 100644 --- a/docs/markdown/Users.md +++ b/docs/markdown/Users.md @@ -8,6 +8,7 @@ If you have a project that uses Meson that you want to add to this list, please listed in the [`meson` GitHub topic](https://github.com/topics/meson). - [2048.cpp](https://github.com/plibither8/2048.cpp), a fully featured terminal version of the game "2048" written in C++ + - [Aravis](https://github.com/AravisProject/aravis), a glib/gobject based library for video acquisition using Genicam cameras - [Akira](https://github.com/akiraux/Akira), a native Linux app for UI and UX design built in Vala and Gtk - [AQEMU](https://github.com/tobimensch/aqemu), a Qt GUI for QEMU virtual machines, since version 0.9.3 - [Arduino sample project](https://github.com/jpakkane/mesonarduino) diff --git a/docs/markdown/snippets/kconfig_enhancements.md b/docs/markdown/snippets/kconfig_enhancements.md new file mode 100644 index 0000000..94e3872 --- /dev/null +++ b/docs/markdown/snippets/kconfig_enhancements.md @@ -0,0 +1,3 @@ +## Enhancements to the kconfig module + +`kconfig.load()` may now accept a `configure_file()` as input file. diff --git a/mesonbuild/compilers/mixins/arm.py b/mesonbuild/compilers/mixins/arm.py index dfdf540..02654ce 100644 --- a/mesonbuild/compilers/mixins/arm.py +++ b/mesonbuild/compilers/mixins/arm.py @@ -161,8 +161,8 @@ class ArmclangCompiler: def __init__(self, compiler_type: 'CompilerType'): if not self.is_cross: raise mesonlib.EnvironmentException('armclang supports only cross-compilation.') - # Check whether 'armlink.exe' is available in path - self.linker_exe = 'armlink.exe' + # Check whether 'armlink' is available in path + self.linker_exe = 'armlink' args = '--vsn' try: p, stdo, stderr = mesonlib.Popen_safe(self.linker_exe, args) diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 29cda90..048a29c 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -389,14 +389,17 @@ class CoreData: if not filenames: return [] - real = [] + found_invalid = [] # type: typing.List[str] + missing = [] # type: typing.List[str] + real = [] # type: typing.List[str] for i, f in enumerate(filenames): f = os.path.expanduser(os.path.expandvars(f)) if os.path.exists(f): if os.path.isfile(f): real.append(os.path.abspath(f)) + continue elif os.path.isdir(f): - raise MesonException('Cross and native files must not be directories') + found_invalid.append(os.path.abspath(f)) else: # in this case we've been passed some kind of pipe, copy # the contents of that file into the meson private (scratch) @@ -410,8 +413,8 @@ class CoreData: # Also replace the command line argument, as the pipe # probably wont exist on reconfigure filenames[i] = copy - continue - elif sys.platform != 'win32': + continue + if sys.platform != 'win32': paths = [ os.environ.get('XDG_DATA_HOME', os.path.expanduser('~/.local/share')), ] + os.environ.get('XDG_DATA_DIRS', '/usr/local/share:/usr/share').split(':') @@ -421,9 +424,14 @@ class CoreData: real.append(path_to_try) break else: - raise MesonException('Cannot find specified {} file: {}'.format(ftype, f)) - continue + missing.append(f) + else: + missing.append(f) + if missing: + if found_invalid: + mlog.log('Found invalid candidates for', ftype, 'file:', *found_invalid) + mlog.log('Could not find any valid candidate for', ftype, 'files:', *missing) raise MesonException('Cannot find specified {} file: {}'.format(ftype, f)) return real diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index cdfa48b..53c3747 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -392,8 +392,9 @@ class OpenMPDependency(ExternalDependency): if self.clib_compiler.has_header(name, '', self.env, dependencies=[self], disable_cache=True)[0]: self.is_found = True self.compile_args = self.link_args = self.clib_compiler.openmp_flags() - else: - mlog.log(mlog.yellow('WARNING:'), 'OpenMP found but omp.h missing.') + break + if not self.is_found: + mlog.log(mlog.yellow('WARNING:'), 'OpenMP found but omp.h missing.') class ThreadDependency(ExternalDependency): diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index a47208d..6c30fc1 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -763,7 +763,6 @@ class Environment: target = 'x86' if 'IA-32' in err else 'x86_64' cls = IntelClCCompiler if lang == 'c' else IntelClCPPCompiler return cls(compiler, version, for_machine, is_cross, exe_wrap, target) - return cls(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, full_version=full_version) if 'Microsoft' in out or 'Microsoft' in err: # Latest versions of Visual Studio print version # number to stderr but earlier ones print version diff --git a/mesonbuild/modules/unstable_kconfig.py b/mesonbuild/modules/unstable_kconfig.py index 1639eed..6685710 100644 --- a/mesonbuild/modules/unstable_kconfig.py +++ b/mesonbuild/modules/unstable_kconfig.py @@ -54,15 +54,16 @@ class KconfigModule(ExtensionModule): raise InvalidCode('load takes only one file input.') s = sources[0] + is_built = False if isinstance(s, mesonlib.File): - # kconfig input is processed at "meson setup" time, not during - # the build, so it cannot reside in the build directory. if s.is_built: - raise InvalidCode('kconfig input must be a source file.') - s = s.relative_name() + FeatureNew('kconfig.load() of built files', '0.52.0').use(state.subproject) + is_built = True + s = s.absolute_path(interpreter.environment.source_dir, interpreter.environment.build_dir) + else: + s = os.path.join(interpreter.environment.source_dir, s) - s = os.path.join(interpreter.environment.source_dir, s) - if s not in interpreter.build_def_files: + if s not in interpreter.build_def_files and not is_built: interpreter.build_def_files.append(s) return self._load_file(s) diff --git a/mesonbuild/scripts/depfixer.py b/mesonbuild/scripts/depfixer.py index cc4669c..9925f4e 100644 --- a/mesonbuild/scripts/depfixer.py +++ b/mesonbuild/scripts/depfixer.py @@ -413,9 +413,8 @@ def fix_darwin(fname, new_rpath, final_path, install_name_mappings): subprocess.check_call(['install_name_tool', fname] + args, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) - except Exception: - raise - sys.exit(0) + except Exception as err: + raise SystemExit(err) def fix_jar(fname): subprocess.check_call(['jar', 'xfv', fname, 'META-INF/MANIFEST.MF']) diff --git a/test cases/kconfig/4 load_config builddir/meson.build b/test cases/kconfig/4 load_config builddir/meson.build index 93136ba..1924d23 100644 --- a/test cases/kconfig/4 load_config builddir/meson.build +++ b/test cases/kconfig/4 load_config builddir/meson.build @@ -2,8 +2,8 @@ project('kconfig builddir test') k = import('unstable-kconfig') -configure_file(input: 'config', output: 'out-config', copy: true) -conf = k.load(meson.build_root() / 'out-config') +out_conf = configure_file(input: 'config', output: 'out-config', copy: true) +conf = k.load(out_conf) if not conf.has_key('CONFIG_IS_SET') error('Expected CONFIG_IS_SET to be set, but it wasn\'t') |