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

Elixir Linux Kernel: powerpc version of __WARN_FLAGS() is not seen as a macro #278

Open
chleroy opened this issue Mar 13, 2024 · 4 comments
Labels

Comments

@chleroy
Copy link

chleroy commented Mar 13, 2024

https://elixir.bootlin.com/linux/v6.8/A/ident/__WARN_FLAGS

The powerpc version is not seen as a macro, why ?

@tleb
Copy link
Member

tleb commented Mar 18, 2024

Good catch. Locally, ctags appears to return the right thing:

⟩ export LXR_REPO_DIR="/absolute/path/to/linux"

⟩ cd $LXR_REPO_DIR

⟩ git ls-tree v6.8 arch/powerpc/include/asm/bug.h
100644 blob 1db485aacbd9b7c4e77847dbcb5e112ebb011ab2	arch/powerpc/include/asm/bug.h

⟩ $elixir_path/script.sh parse-defs \
		1db485aacbd9b7c4e77847dbcb5e112ebb011ab2 foo.c C | \
	grep __WARN_FLAGS
__WARN_FLAGS macro 75

⟩ ctags --version
Universal Ctags 6.1.0(v6.1.0), Copyright (C) 2015-2023 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Dec 28 2023, 18:49:35
  URL: https://ctags.io/
  Output version: 0.0
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory,
                +xpath, +json, +interactive, +sandbox, +yaml, +packcc, 
                +optscript, +pcre2

This does a call to parse_defs_C in script.sh that confirms my local ctags returns the right value. macro is the expected type for a macro declaration. There are many other possible reasons:

  • ctags version;
  • bug that modifies the entry type;
  • corrupted entry in the database;
  • etc.

Digging deeper is required.

@fstachura
Copy link
Collaborator

fstachura commented Mar 18, 2024

parse-defs also returns wrong data on my local docker instance. (older kernel tag but that does not matter https://elixir.bootlin.com/linux/v6.1/A/ident/__WARN_FLAGS).

root@80a0a2bce64f:/srv/elixir-data/linux/repo# git ls-tree v6.1 arch/powerpc/include/asm/bug.h
100644 blob 61a4736355c244448104080e144631a3cb8839b2    arch/powerpc/include/asm/bug.h
root@80a0a2bce64f:/srv/elixir-data/linux/repo# cd /usr/local/elixir/
root@80a0a2bce64f:/usr/local/elixir# ./script.sh parse-defs 61a4736355c244448104080e144631a3cb8839b2 foo.c C
_ASM_POWERPC_BUG_H macro 3
_exception prototype 165
_exception_pkey prototype 166
bad_page_fault prototype 164
die prototype 167
die_mce prototype 168
die_will_crash prototype 169
hash__do_page_fault prototype 163
panic_flush_kmsg_end prototype 171
panic_flush_kmsg_start prototype 170

I suspect ctags version is the issue. Ctags in the debian docker image is pinned to a rather old version and perhaps the same applies to production.
Manually upgrading ctags to the latest nightly version seems to fix the issue (not that I advocate using nightly on prod, since there exists a stable release that also works). ctags included in Debian Bookworm repos seems to be too old.

@tleb
Copy link
Member

tleb commented Mar 19, 2024

Thanks for the check using the old ctags version. I remember this version is patched for a reason, @michaelopdenacker will be able to tell us more about why. Upgrading it makes sense. The question will be if we still need custom patches on top or if we can use upstream.

@fstachura
Copy link
Collaborator

This commit suggests, that the changes from the special ctags version were upstreamed.

The packages should probably be removed from the Dockerfile, same with pygments.

@fstachura fstachura added the bug label Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants