Skip to content

Commit 584a90e

Browse files
committed
Docker: start migrating to 20.04
Still failing with: Traceback (most recent call last): File "util/cpt_upgrader.py", line 73, in <module> from six.moves import configparser ImportError: No module named six.moves Also fix some issues noticed: - userland/c/atomic was not ignoring arch specific examples - ./build would not stop on the first error, now it does - add libhdf5-dev as a dependency of gem5
1 parent 76a4862 commit 584a90e

8 files changed

+63
-22
lines changed

Diff for: Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# https://cirosantilli.com/linux-kernel-module-cheat#docker
2-
FROM ubuntu:18.04
2+
FROM ubuntu:20.04
33
COPY setup /
44
RUN /setup -y
55
CMD bash

Diff for: build

+37-15
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ class _Component:
5454
(self.build_callback is not None) and
5555
(self.supported_archs is None or arch in self.supported_archs)
5656
):
57-
self.build_callback()
57+
return self.build_callback()
58+
else:
59+
# Component that does not build anything itself, only has dependencies.
60+
return 0
5861

5962
submodule_extra_remotes = {
6063
'binutils-gdb': {
@@ -168,38 +171,53 @@ so looping over all of them would waste time.
168171
'make',
169172
'patch',
170173
'perl',
171-
'python-matplotlib',
172174
'python3',
173175
'rsync',
174176
'sed',
175177
'tar',
176178
'unzip',
177179
},
180+
python3_pkgs={
181+
# Generate graphs of config.ini under m5out.
182+
'matplotlib',
183+
},
178184
)
179185
buildroot_overlay_qemu_component = copy.copy(buildroot_component)
180186
# We need to build QEMU before the final Buildroot to get qemu-img.
181187
buildroot_overlay_qemu_component.dependencies = ['overlay', 'qemu']
182188
buildroot_overlay_gem5_component = copy.copy(buildroot_component)
183189
buildroot_overlay_gem5_component.dependencies = ['overlay-gem5']
184190
gem5_deps = {
185-
# TODO test it out on Docker and answer that question properly:
186-
# https://askubuntu.com/questions/350475/how-can-i-install-gem5
187191
'apt_get_pkgs': {
188-
'device-tree-compiler',
189-
'diod',
190-
'libgoogle-perftools-dev',
192+
# https://askubuntu.com/questions/350475/how-can-i-install-gem5/1275773#1275773
193+
'build-essential',
194+
'doxygen',
195+
'git',
191196
'libboost-all-dev',
197+
'libelf-dev',
198+
'libgoogle-perftools-dev',
199+
'libhdf5-serial-dev',
200+
'libpng-dev',
201+
'libprotobuf-dev',
202+
'libprotoc-dev',
192203
'm4',
193204
'protobuf-compiler',
194-
'python-dev',
195-
'python-pip',
196-
# For prebuilt qcow2 unpack.
197-
'qemu-utils',
205+
'python-is-python3',
206+
'python3-dev',
207+
'python3-pydot',
208+
'python3-six',
198209
'scons',
210+
'zlib1g',
199211
'zlib1g-dev',
212+
213+
# Some extra ones.
214+
'device-tree-compiler',
215+
'diod',
216+
# For prebuilt qcow2 unpack.
217+
'qemu-utils',
200218
},
201-
'python2_pkgs': {
202-
# Generate graphs of config.ini under m5out.
219+
'python3_pkgs': {
220+
# https://cirosantilli.com/linux-kernel-module-cheat#gem5-config-dot
203221
'pydot',
204222
},
205223
'submodules_shallow': {'gem5'},
@@ -446,7 +464,7 @@ Which components to build. Default: qemu-buildroot
446464
args = self.get_common_args()
447465
args.update(extra_args)
448466
args['show_time'] = False
449-
lkmc.import_path.import_path_main(component_file)(**args)
467+
return lkmc.import_path.import_path_main(component_file)(**args)
450468
return f
451469

452470
def timed_main(self):
@@ -511,6 +529,8 @@ Which components to build. Default: qemu-buildroot
511529
ruby_pkgs.update(component.ruby_pkgs)
512530
if ruby_pkgs:
513531
apt_get_pkgs.add('ruby')
532+
if python3_pkgs:
533+
apt_get_pkgs.add('python3-pip')
514534
if apt_get_pkgs or apt_build_deps:
515535
if self.env['travis']:
516536
interacive_pkgs = {
@@ -653,7 +673,9 @@ Which components to build. Default: qemu-buildroot
653673
if self.env['print_components']:
654674
print(self.component_to_name_map[component])
655675
else:
656-
component.build(self.env['arch'])
676+
ret = component.build(self.env['arch'])
677+
if (ret != 0):
678+
return ret
657679

658680
if __name__ == '__main__':
659681
Main().cli()

Diff for: build-buildroot

+8-2
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,15 @@ files on the root filesystem.
152152
] +
153153
extra_make_args
154154
,
155-
out_file=os.path.join(self.env['buildroot_build_dir'], self.env['repo_short_id'] + '.log'),
156-
delete_env=['LD_LIBRARY_PATH', 'PERL_MM_OPT'],
157155
cwd=self.env['buildroot_source_dir'],
156+
delete_env=['LD_LIBRARY_PATH', 'PERL_MM_OPT'],
157+
extra_env={
158+
# In Docker, >>> host-tar 1.29 Configuring
159+
# checking whether mknod can create fifo without root privileges... configure: error: in `/root/lkmc/out.docker/buildroot/build/default/aarch64/build/host-tar-1.29':
160+
# configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)
161+
'FORCE_UNSAFE_CONFIGURE': '1',
162+
},
163+
out_file=os.path.join(self.env['buildroot_build_dir'], self.env['repo_short_id'] + '.log'),
158164
)
159165
# Create the qcow2 from ext2.
160166
# Skip if qemu is not present, because gem5 does not need the qcow2.

Diff for: build-docker

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ See also: https://github.com/cirosantilli/linux-kernel-module-cheatTODO#ubuntu-g
4545
'-t',
4646
'-w', target_dir,
4747
'-v', '{}:{}'.format(kwargs['root_dir'], target_dir),
48-
'ubuntu:18.04',
48+
'ubuntu:20.04',
4949
'bash',
5050
])
5151
self.sh.run_cmd([

Diff for: build-gem5

+2
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ https://github.com/cirosantilli/linux-kernel-module-cheat-regression#gem5-unit-t
133133
[
134134
# TODO reenable, broken, had enough of this.
135135
# https://gem5.atlassian.net/browse/GEM5-357
136+
# https://gem5.atlassian.net/browse/GEM5-656
137+
# https://gem5.atlassian.net/browse/GEM5-778
136138
#'SLICC_HTML=True', LF,
137139
] +
138140
self.sh.add_newlines(targets) +

Diff for: common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,7 @@ def main(self, *args, **kwargs):
14531453
'''
14541454
Run timed_main across all selected archs and emulators.
14551455
1456-
:return: if any of the timed_mains exits non-zero and non-null,
1456+
:return: if any of the timed_mains exits non-zero and non-None,
14571457
return that. Otherwise, return 0.
14581458
'''
14591459
env = kwargs.copy()

Diff for: path_properties.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,18 @@ def get(path):
690690
# This has complex failure modes, too hard to assert.
691691
'smash_stack.c': {'skip_run_unclassified': True},
692692
'std_atomic.c': {'baremetal': False},
693-
'atomic': {'baremetal': False},
693+
'atomic': (
694+
{
695+
'test_run_args': {'cpus': 3},
696+
},
697+
{
698+
'aarch64_add.c': {'allowed_archs': {'aarch64'}},
699+
'aarch64_ldadd.c': {'allowed_archs': {'aarch64'}},
700+
'aarch64_ldaxr_stlxr.c': {'allowed_archs': {'aarch64'}},
701+
'x86_64_inc.c': {'allowed_archs': {'x86_64'}},
702+
'x86_64_lock_inc.c': {'allowed_archs': {'x86_64'}},
703+
},
704+
),
694705
# Wrapper not defined by newlib.
695706
'timespec_get.c': {'baremetal': False},
696707
}

Diff for: requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Cython==0.29.15
2-
china-dictatorship==0.0.52
2+
china-dictatorship==0.0.67
33
pexpect==4.6.0

0 commit comments

Comments
 (0)