Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building gem5 raise " ValueError : unsupported pickle protocol: 4" #130

Open
Jrebort opened this issue Sep 18, 2020 · 1 comment
Open

Building gem5 raise " ValueError : unsupported pickle protocol: 4" #130

Jrebort opened this issue Sep 18, 2020 · 1 comment

Comments

@Jrebort
Copy link

Jrebort commented Sep 18, 2020

@cirosantilli
I used ./build --download-dependencies gem5-buildroot this command when building gem5, and got an error.

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: *** [build/x86/call_type/inst.cc] ValueError : unsupported pickle protocol: 4
scons: building terminated because of errors.
Traceback (most recent call last):
  File "./build", line 669, in <module>
    Main().cli()
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/cli_function.py", line 267, in cli
    exit_status = self.cli_noexit(*args, **kwargs)
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/cli_function.py", line 258, in cli_noexit
    return self._do_main(vars(args))
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/cli_function.py", line 152, in _do_main
    return self.main(**self._get_args(kwargs))
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/common.py", line 1518, in main
    ret = self.timed_main()
  File "./build", line 664, in timed_main
    ret = component.build(self.env['arch'])
  File "./build", line 57, in build
    return self.build_callback()
  File "./build", line 455, in f
    return lkmc.import_path.import_path_main(component_file)(**args)
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/common.py", line 733, in __call__
    return super().__call__(**kwargs)
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/cli_function.py", line 149, in __call__
    return self._do_main(kwargs)
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/cli_function.py", line 152, in _do_main
    return self.main(**self._get_args(kwargs))
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/common.py", line 1518, in main
    ret = self.timed_main()
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/common.py", line 2011, in timed_main
    return self.build()
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/build-m5", line 33, in build
    self._get_make_cmd(),
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/shell_helpers.py", line 457, in run_cmd
    raise e
Exception: Command exited with status: 2

I guess this is caused by the python version, my system python version is 2.7.
So I switched the system python version to 3.6 and got a new error.

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Cleaning targets ...
scons: done cleaning targets.
AttributeError: '_Environ' object has no attribute 'has_key':
  File "/usr/lib/scons/SCons/Script/Main.py", line 1376:
    _exec_main(parser, values)
  File "/usr/lib/scons/SCons/Script/Main.py", line 1339:
    _main(parser)
  File "/usr/lib/scons/SCons/Script/Main.py", line 1111:
    if os.environ.has_key('DH_INTERNAL_OPTIONS'):
Traceback (most recent call last):
  File "./build", line 669, in <module>
    Main().cli()
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/cli_function.py", line 267, in cli
    exit_status = self.cli_noexit(*args, **kwargs)
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/cli_function.py", line 258, in cli_noexit
    return self._do_main(vars(args))
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/cli_function.py", line 152, in _do_main
    return self.main(**self._get_args(kwargs))
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/common.py", line 1518, in main
    ret = self.timed_main()
  File "./build", line 664, in timed_main
    ret = component.build(self.env['arch'])
  File "./build", line 57, in build
    return self.build_callback()
  File "./build", line 455, in f
    return lkmc.import_path.import_path_main(component_file)(**args)
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/common.py", line 733, in __call__
    return super().__call__(**kwargs)
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/cli_function.py", line 149, in __call__
    return self._do_main(kwargs)
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/cli_function.py", line 152, in _do_main
    return self.main(**self._get_args(kwargs))
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/common.py", line 1518, in main
    ret = self.timed_main()
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/common.py", line 2011, in timed_main
    return self.build()
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/build-m5", line 31, in build
    self.clean()
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/build-m5", line 43, in clean
    self._get_make_cmd() + ['--clean', LF],
  File "/home/yangshuang/workspace/linux-kernel-module-cheat/shell_helpers.py", line 457, in run_cmd
    raise e
Exception: Command exited with status: 2

Here shows the error of different versions of the protocol. What caused this? I did not get an error when building gem5 separately, but I used the packaging script of this repo and got the above error.

@cirosantilli
Copy link
Owner

cirosantilli commented Sep 18, 2020

The Python 2 one I'm not sure about.

The Python 3 one, looks like your scons is too old?

I have now tested a full clean build inside docker Ubuntu 20.04 with ./run-docker sh -- ./build --download-dependencies gem5-buildroot -aA as mentioned at https://github.com/cirosantilli/linux-kernel-module-cheat/tree/e62ff90b884bdb319cb5703408105dabf8e829ac#docker in the latest commit e62ff90 and that has scons v3.1.2 and it worked. That system contains only Python3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants