From ccf58dc813cbdbc82df424f7ba9ab3b4e33e00b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Sun, 5 May 2019 00:00:00 +0000 Subject: [PATCH] userland: make libs really work --- common.py | 15 ++++++++++++--- path_properties.py | 13 ++++++++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/common.py b/common.py index fbc6285..eebc9d4 100644 --- a/common.py +++ b/common.py @@ -486,10 +486,13 @@ CLI arguments to pass to the userland executable. default=False, help='''\ Place build output inside source tree to conveniently run it, especially when -building with the host native toolchain. Currently only supported by ./build-userland. +building with the host native toolchain. -When running, prefer in-tree executables instead of out-of-tree ones, e.g.: +When running, use in-tree executables instead of out-of-tree ones, userland/c/hello resolves userland/c/hello.out instead of the out-of-tree one. + +Currently only supported by userland scripts such as ./build-userland and +./run --userland. ''', ) self.add_argument( @@ -982,7 +985,13 @@ lunch aosp_{}-eng of the script. ''' return { - key:self.env[key] for key in self._common_args if self.env['_args_given'][key] + key:self.env[key] for key in self._common_args if + ( + # Args given on command line. + self.env['_args_given'][key] or + # Ineritance changed defaults. + key in self._defaults + ) } def get_stats(self, stat_re=None, stats_file=None): diff --git a/path_properties.py b/path_properties.py index c040f96..108b618 100644 --- a/path_properties.py +++ b/path_properties.py @@ -29,6 +29,10 @@ class PathProperties: # of how Python + QEMU + gem5 determine the exit status of signals. 'receives_signal', 'requires_kernel_modules', + # The example requires sudo, which usually implies that it can do something + # deeply to the system it runs on, which would preventing further interactive + # or test usage of the system, for example poweroff or messing up the GUI. + 'sudo', 'uses_dynamic_library', } @@ -76,6 +80,7 @@ class PathProperties: not self['receives_signal'] and \ not self['requires_kernel_modules'] and \ not self['skip_run_unclassified'] and \ + not self['sudo'] and \ not (self['uses_dynamic_library'] and env['emulator'] == 'gem5') def update(self, other): @@ -166,6 +171,7 @@ path_properties_tuples = ( 'receives_signal': False, 'requires_kernel_modules': False, 'skip_run_unclassified': False, + 'sudo': False, 'uses_dynamic_library': False, }, { @@ -264,7 +270,12 @@ path_properties_tuples = ( 'assert_fail.c': {'exit_status': 1}, } ), - 'libs': {'uses_dynamic_library': True}, + 'libs': ( + {'uses_dynamic_library': True}, + { + 'libdrm': {'sudo': True}, + } + ), 'linux': {**gnu_extension_properties, **{'skip_run_unclassified': True}}, 'posix': ( {},