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

compliance script broken #31436

Closed
pabigot opened this issue Jan 19, 2021 · 8 comments · Fixed by #31446
Closed

compliance script broken #31436

pabigot opened this issue Jan 19, 2021 · 8 comments · Fixed by #31446
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug

Comments

@pabigot
Copy link
Collaborator

pabigot commented Jan 19, 2021

After 251648a I'm getting the following on the master branch:

tirzah[31]$ scripts/ci/check_compliance.py -c HEAD^..HEAD
Running checkpatch       tests in /scratch/zephyr/zp1/zephyr ...
Running Kconfig          tests in /scratch/zephyr/zp1/zephyr ...
Python exception in `scripts/ci/check_compliance.py`:

Traceback (most recent call last):
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 2189, in _enter_file
    self._readline = self._open(filename, "r").readline
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 3922, in _open
    open(filename, mode, encoding=self._encoding)
IsADirectoryError: [Errno 21] Is a directory: '/scratch/zephyr/zp1/zephyr/'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "scripts/ci/check_compliance.py", line 1081, in main
    n_fails = _main(args)
  File "scripts/ci/check_compliance.py", line 1032, in _main
    test.run()
  File "scripts/ci/check_compliance.py", line 229, in run
    kconf = self.parse_kconfig()
  File "scripts/ci/check_compliance.py", line 335, in parse_kconfig
    return kconfiglib.Kconfig()
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 947, in __init__
    self._init(filename, warn, warn_to_stderr, encoding)
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 1085, in _init
    self._parse_block(None, self.top_node, self.top_node).next = None
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 2989, in _parse_block
    prev = self._parse_block(None, parent, prev)
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 3028, in _parse_block
    self._parse_block(_T_ENDMENU, node, node)
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 2989, in _parse_block
    prev = self._parse_block(None, parent, prev)
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 2989, in _parse_block
    prev = self._parse_block(None, parent, prev)
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 3028, in _parse_block
    self._parse_block(_T_ENDMENU, node, node)
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 2988, in _parse_block
    self._enter_file(filename)
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 2192, in _enter_file
    raise _KconfigIOError(
kconfiglib._KconfigIOError: /tmp/Kconfig.modules:2: Could not open '/scratch/zephyr/zp1/zephyr/' (in 'osource "$(ZEPHYR_HAL_NORDIC_KCONFIG)"') (EISDIR: Is a directory)

Traceback (most recent call last):
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 2189, in _enter_file
    self._readline = self._open(filename, "r").readline
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 3922, in _open
    open(filename, mode, encoding=self._encoding)
IsADirectoryError: [Errno 21] Is a directory: '/scratch/zephyr/zp1/zephyr/'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "scripts/ci/check_compliance.py", line 1108, in <module>
    main()
  File "scripts/ci/check_compliance.py", line 1081, in main
    n_fails = _main(args)
  File "scripts/ci/check_compliance.py", line 1032, in _main
    test.run()
  File "scripts/ci/check_compliance.py", line 229, in run
    kconf = self.parse_kconfig()
  File "scripts/ci/check_compliance.py", line 335, in parse_kconfig
    return kconfiglib.Kconfig()
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 947, in __init__
    self._init(filename, warn, warn_to_stderr, encoding)
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 1085, in _init
    self._parse_block(None, self.top_node, self.top_node).next = None
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 2989, in _parse_block
    prev = self._parse_block(None, parent, prev)
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 3028, in _parse_block
    self._parse_block(_T_ENDMENU, node, node)
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 2989, in _parse_block
    prev = self._parse_block(None, parent, prev)
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 2989, in _parse_block
    prev = self._parse_block(None, parent, prev)
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 3028, in _parse_block
    self._parse_block(_T_ENDMENU, node, node)
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 2988, in _parse_block
    self._enter_file(filename)
  File "/scratch/zephyr/zp1/zephyr/scripts/kconfig/kconfiglib.py", line 2192, in _enter_file
    raise _KconfigIOError(
kconfiglib._KconfigIOError: /tmp/Kconfig.modules:2: Could not open '/scratch/zephyr/zp1/zephyr/' (in 'osource "$(ZEPHYR_HAL_NORDIC_KCONFIG)"') (EISDIR: Is a directory)
@pabigot pabigot added the bug The issue is a bug, or the PR is fixing a bug label Jan 19, 2021
@pabigot
Copy link
Collaborator Author

pabigot commented Jan 19, 2021

It appears that 6d3cdf5 inadvertently fixed this.

@pabigot pabigot closed this as completed Jan 19, 2021
@pabigot
Copy link
Collaborator Author

pabigot commented Jan 19, 2021

No, I'm still seeing it.

@pabigot pabigot reopened this Jan 19, 2021
@mbolivar-nordic
Copy link
Contributor

mbolivar-nordic commented Jan 19, 2021

I can reproduce.

@henrikbrixandersen
Copy link
Member

I can reproduce the issue here.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.5 LTS
Release:	18.04
Codename:	bionic

@pabigot
Copy link
Collaborator Author

pabigot commented Jan 19, 2021

A clean revert would probably require reverting:

@pabigot
Copy link
Collaborator Author

pabigot commented Jan 19, 2021

In case it's OS dependent:

tirzah[2195]$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.1 LTS
Release:	20.04
Codename:	focal

@pabigot pabigot self-assigned this Jan 19, 2021
@pabigot
Copy link
Collaborator Author

pabigot commented Jan 19, 2021

Per comment on slack from @mbolivar-nordic this may be related to having ZEPHYR_BASE set.

@tejlmand
Copy link
Collaborator

Looking into a fix.

Somehow CI didn't fail the pr, even though compliance failed.
https://github.com/zephyrproject-rtos/zephyr/runs/1727523984#step:7:157

@tejlmand tejlmand self-assigned this Jan 20, 2021
tejlmand added a commit to tejlmand/zephyr that referenced this issue Jan 20, 2021
Fixes: zephyrproject-rtos#31436

This fix adds ZEPHYR_<MODULE_NAME>_KCONFIG variable to compliance check.
This ensures that Zephyr Kconfig glue code is included in the
compliance check, and thus remove the issue reported in zephyrproject-rtos#31436.

Signed-off-by: Torsten Rasmussen <[email protected]>
carlescufi pushed a commit that referenced this issue Jan 20, 2021
Fixes: #31436

This fix adds ZEPHYR_<MODULE_NAME>_KCONFIG variable to compliance check.
This ensures that Zephyr Kconfig glue code is included in the
compliance check, and thus remove the issue reported in #31436.

Signed-off-by: Torsten Rasmussen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
4 participants