openbmc / phosphor-state-manager

Apache License 2.0
11 stars 21 forks source link

Can't compile phosphor-state-manager with CI due to lack of pyyaml #13

Closed wangkair closed 4 years ago

wangkair commented 4 years ago

When compiling phosphor-state-manager with CI, it reports error:

 > run-clang-tidy-8.py -p build
Traceback (most recent call last):
  File "/usr/bin/run-clang-tidy-8.py", line 51, in <module>
    import yaml
ImportError: No module named yaml

https://openpower.xyz/job/openbmc-repository-ci/47342/console

This may be caused by commit "python3: move CI over to only python3". It's lack of pyyaml which is used by clang-tidy.

geissonator commented 4 years ago

Appears as if run-clang-tidy-8.py still uses just "python". The base docker container we use has python2 (python) still installed but we removed all supporting python2 related packages so yeah, it's related to that change you noted above. I don't see an upstream clang-tidy that supports python3 yet although there have been some related changes, it seems they have not pulled the trigger yet.

A couple of solutions come to mind. Only this repo and one other use clang-tidy, so we could just remove it. We could try putting python2 needed packages back in. Or we could just try converting the clang-tidy script we use over to python3 via a sed command in the docker build.

I think I may see if that last option works since it seems like the easiest and we could just remove it once clang-tidy gets to python3.

geissonator commented 4 years ago

Put a quick fix up at https://gerrit.openbmc-project.xyz/c/openbmc/openbmc-build-scripts/+/31296 and confirmed when cherry picked into the CI job, it passed the CI test.