FS#65450 - [apparmor] make output garbage in apparmor.vim syntax file

Attached to Project: Arch Linux
Opened by Jill (KokaKiwi) - Tuesday, 11 February 2020, 02:03 GMT
Last edited by David Runge (dvzrv) - Thursday, 23 April 2020, 18:24 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To David Runge (dvzrv)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Seems like the latest build of this package left some `make` output stuff in the apparmor.vim syntax file:

" normal capabilities - really keep this list? syn match sdCap should be enough... (difference: sdCapKey words would loose underlining)
syn keyword sdCapKey make[2]: entering directory '/build/apparmor/src/apparmor-2.13.3/utils/vim'
make[2]: warning: jobserver unavailable: using -j1. add '+' to parent make rule.
audit_control audit_read block_suspend chown dac_override dac_read_search fowner fsetid ipc_lock ipc_owner kill lease linux_immutable mknod net_admin net_bind_service net_broadcast net_raw setfcap setgid setpcap setuid syslog sys_boot sys_chroot sys_nice sys_pacct sys_ptrace sys_resource sys_time sys_tty_config wake_alarm
make[2]: leaving directory '/build/apparmor/src/apparmor-2.13.3/utils/vim'

Additional info:
* package version(s)
- apparmor-2.13.3-4

Steps to reproduce:
1. Open /etc/apparmor.d/nvidia_modprobe file with vim
2. Vim screaming at you because of invalid vim syntax file
This task depends upon

Closed by  David Runge (dvzrv)
Thursday, 23 April 2020, 18:24 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed with apparmor 2.13.4-4
Comment by Eli Schwartz (eschwartz) - Tuesday, 11 February 2020, 02:10 GMT
That's the most amazing bug I've seen all month.
Comment by Eli Schwartz (eschwartz) - Tuesday, 11 February 2020, 02:19 GMT
https://gitlab.com/apparmor/apparmor/-/blob/fbe8641026166c7e9dfef60554fc2c455f119448/utils/vim/create-apparmor.vim.py#L45

So, it uses "make" to print out this Makefile rule: https://gitlab.com/apparmor/apparmor/-/blob/fbe8641026166c7e9dfef60554fc2c455f119448/common/Make.rules#L84

And then they invoke it via python subprocess.Popen and *explicitly* concatenate the Popen resulting stdout and stderr (which again, is used to echo a Makefile variable defined by a very long $(shell cmd | cmd2 | cmd3) shell pipeline), and somehow they expect this to not go wrong?

I'm... I don't have words to describe this. It is just so broken. I'm not sure how we could fix this.
Comment by Eli Schwartz (eschwartz) - Tuesday, 11 February 2020, 02:31 GMT Comment by David Runge (dvzrv) - Tuesday, 11 February 2020, 10:20 GMT
Also, this has happened before: https://bugs.archlinux.org/task/61633
However, it was not reproducible after a rebuild (which could have been due to all sorts of reasons).

I'm fairly certain, that the vim syntax file creation is flaky enough to depend on the machine the build is running on (or the state of the moon).
Comment by Eli Schwartz (eschwartz) - Sunday, 15 March 2020, 23:51 GMT
So a month later, they haven't even acknowledged the bug, but they have issued a new release. And as per https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/apparmor&id=df689898b0c514f8471f1d6b4b90623ea10418e8 part of the testsuite actually works anymore. Does apparmor itself even work? Why is apparmor just repeated boatloads of everything broken? Can we just remove this heap of pure trash from the repos?

Loading...