Package: kconfigeditor2
Severity: wishlist
X-Debbugs-Cc: [email protected]

Dear Maintainer,

Use of kconfigeditor2/process.py fails to generate output target directories
for new external CONFIG_OUTPUT path.

Steps to reproduce:

# apt build-dep linux

# apt install '^linux-support-.*$'

# git -C $HOME/source clone --depth 1
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux.git

# git -C $HOME/source clone --depth 1 https://salsa.debian.org/kernel-
team/kernel-team.git debian-kernel-team.git

# git -C $HOME/source clone --depth 1 https://salsa.debian.org/kernel-
team/linux.git debian-linux.git

# $HOME/source/debian-kernel-team.git/utils/kconfigeditor2/process.py -c
$HOME/build/debian-kernel-config -s $HOME/source/linux.git $HOME/source/debian-
linux.git

# $HOME/source/debian-kernel-team.git/utils/kconfigeditor2/process.py -c
$HOME/build/debian-kernel-config -s $HOME/source/linux.git $HOME/source/debian-
linux.git

```
Traceback (most recent call last):
  File "/home/user/source/debian-kernel-
team.git/utils/kconfigeditor2/process.py", line 80, in <module>
   Main(package, source, config_output)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/source/debian-kernel-
team.git/utils/kconfigeditor2/process.py", line 42, in __init__
    f = open(filename_tmp, 'w')
FileNotFoundError: [Errno 2] No such file or directory:
'/home/user/build/debian-kernel-config/config.tmp'
```

The above error may be expected, however creating that directory does not get
us to where we need to be:

mkdir $HOME/build/debian-kernel-config

# $HOME/source/debian-kernel-team.git/utils/kconfigeditor2/process.py -c
$HOME/build/debian-kernel-config -s $HOME/source/linux.git $HOME/source/debian-
linux.git

```
Traceback (most recent call last):
  File "/home/user/source/debian-kernel-
team.git/utils/kconfigeditor2/process.py", line 80, in <module>
    Main(package, source, config_output)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/source/debian-kernel-
team.git/utils/kconfigeditor2/process.py", line 42, in __init__
    f = open(filename_tmp, 'w')
FileNotFoundError: [Errno 2] No such file or directory:
'/home/user/build/debian-kernel-config/alpha/config.tmp'
```

Additional action of creating the expected directories leads to an
approximately successful run:

# find $HOME/source/debian-linux.git/debian/config -mindepth 2 -maxdepth 2
-iname 'config*' -type f -exec sh -c "cd $HOME/build/debian-kernel-config ;
dirname {} | xargs -n 1 basename | xargs mkdir" \;

# $HOME/source/debian-kernel-team.git/utils/kconfigeditor2/process.py -c
$HOME/build/debian-kernel-config -s $HOME/source/linux.git $HOME/source/debian-
linux.git

```
/home/user/source/debian-linux.git/debian/config/config: Unknown setting
CONFIG_CRYPTO_MANAGER=y
/home/user/source/debian-linux.git/debian/config/config: Unknown setting #
CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
```
...snip...
```
/home/user/source/debian-linux.git/debian/config/amd64/config: Unknown setting
CONFIG_CRYPTO_SHA256_SSSE3=m
/home/user/source/debian-linux.git/debian/config/amd64/config: Unknown setting
CONFIG_X86_X32_DISABLED=y
```

There are of course missing information in the output as this is not the exact
described workflow from documentation. However it is quick-and-dirty way to get
a useful kernel config.

Creating the target directories by default may not be intended or would mask
some error.

Should kconfigeditor2/process.py have an option (or by default) populate target
directories for this usage?


-- System Information:
Debian Release: 13.0
  APT prefers testing-security
  APT policy: (500, 'testing-security'), (500, 'stable-updates'), (500, 
'stable-security'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.12.31-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Reply via email to