Commit graph

895 commits

Author SHA1 Message Date
Théo Lebrun
e1bdface0c templates/ident: improve "Identifier not used" message
"Identifier not used" is weird, replace it by "unknown identifier" and
 give the search identifier name in the header.

Also improve the autocomplete comment. Make it human-friendly and
explain why people got autocompleted to a symbol that does not exist.
Also, only show it if the symbol actually exists. That way we only
tell "maybe autocomplete lead you here" only in cases where
autocomplete can actually lead you here.

To test this feature:
 - search for any random symbol, you'll see "Unknown identifier '...'"
 - search for a symbol that exists in another version as the selected
   one. For example __NR_epoll_pwait2 appeared in musl v1.2.5. You'll
   see the same header message plus a comment about how the symbol
   exists in another version.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-11-05 14:18:41 +01:00
Franciszek Stachura
1b24366093 templates/ident: add note about autocomplete to "Identifier not used"
Current autocomplete behaviour is unintuitive. It is a good idea to
explain to users why it can suggest invalid identifiers.
2025-11-05 09:48:06 +01:00
Franciszek Stachura
5ff8c70166 web: use GET for ident search form
With POST, if Anubis triggers on search request, user will be redirected
back to home page.
2025-11-05 09:48:06 +01:00
Théo Lebrun
11b6632d5d templates/topbar: add required attribute to search input
If we press enter without any search value, we get directed to
/$PROJECT/$VERSION/A/ident/ which is a "400 Bad Request".

As the search input is selected by default, this is any enter press
where the focus hasn't changed.

`required` documentation:
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/required

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-11-05 09:45:42 +01:00
Thomas Petazzoni
89aef0d77b static/messages.json: update training dates, fix typo
Edit by Théo: remove desktop/mobile blocks using:
⟩ jq --indent 4 '[.[] | .desktop]' static/messages.json | sponge static/messages.json

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2025-10-23 23:26:02 +02:00
Théo Lebrun
8fb444d0cd projects: add iproute2 project
Add iproute2 project. Pretty standard C project and versioning is as we
like it to be. Almost nothing to be done.

https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/
https://en.wikipedia.org/wiki/Iproute2
https://wiki.linuxfoundation.org/networking/iproute2

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-10-15 11:58:07 +02:00
Théo Lebrun
1a012d6b4b projects: add opensbi project
Add OpenSBI. Pretty standard C project and versioning is as we like it
to be. Did add a commit to interpret *.mk as part of the Makefile
family. Without that, CONFIG_* references aren't found.

https://github.com/riscv-software-src/opensbi
https://riscv.org/wp-content/uploads/2024/12/13.30-RISCV_OpenSBI_Deep_Dive_v5.pdf

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-10-15 11:56:58 +02:00
Théo Lebrun
773e2df1b5 lib.py: mark .mk files as makefiles
OpenSBI uses `.mk` files. The tokenizer does not get ran on files
without a family (sad). Adding this means we index references
inside .mk files, eg:

    # opensbi/lib/utils/i2c/objects.mk
    libsbiutils-objs-$(CONFIG_I2C) += i2c/i2c.o

Also, refactor the getFileFamily():
 - All usage of name/ext do a .lower() on them, move it to the top.
 - Use `x == "A"` checks rather than `x in ["A"]`.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-10-15 11:56:58 +02:00
Théo Lebrun
05da14b295 static/messages.json: drop mobile object in each entry
Front-end code should handle both cases gracefully as
static/messages.json might be cached.

⟩ # Done using:
⟩ jq --indent 4 '[.[] | .desktop]' static/messages.json | sponge static/messages.json

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-07-25 12:26:16 +02:00
Franciszek Stachura
6a83ae7661 web: refactor message banners & support mobile
We had an hardcoded mobile banner that was nice looking but couldn't
deal with all the content for the various banners we want to display.

Also, it was a separate element to the desktop one. Unify them as a
single element that adapts (as it should) to desktop or mobile
viewports.
2025-07-25 12:26:04 +02:00
Thomas Petazzoni
7cdeaafa9c static/messages.json: update
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2025-07-25 12:25:40 +02:00
Thomas Petazzoni
3c41681075 static/messages.json: update
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2025-07-25 12:25:38 +02:00
Thomas Petazzoni
092d4496de static/messages.json: update
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2025-07-25 12:25:34 +02:00
Théo Lebrun
c0c5d2283c query: drop query.supports_dts_comp() getter method
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-03-07 16:16:34 +01:00
Théo Lebrun
e1fecd1c3f query: fix comment describing get_versions()
The comment was plain wrong. It said we returned a list.
We return nested OrderedDict structures.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-03-07 16:16:34 +01:00
Franciszek Stachura
6f03eee42c CHANGELOG: Add info about changes in query tool 2025-03-07 16:16:34 +01:00
Franciszek Stachura
0dcf9d4197 query: Move CLI to utils/query.py
Call with python3 -m utils.query
2025-03-07 16:16:34 +01:00
Franciszek Stachura
6a071ff590 utils/speedtest: Make compatible with code changes 2025-03-07 16:16:34 +01:00
Franciszek Stachura
5563feaf78 query: Move dts commands to functions 2025-03-07 16:16:34 +01:00
Franciszek Stachura
ac5a64b972 query: Move 'exists' command to a function 2025-03-07 16:16:34 +01:00
Franciszek Stachura
2a93ee95fb query: Move 'dir' command to a function 2025-03-07 16:16:34 +01:00
Franciszek Stachura
5f9c6236a6 web: Replace query("family") with getFileFamily 2025-03-07 16:16:34 +01:00
Franciszek Stachura
53b1ffe208 query: Move 'file' command to a function 2025-03-07 16:16:34 +01:00
Franciszek Stachura
9bc76f0d8d query: Move 'type' command to a function 2025-03-07 16:16:34 +01:00
Franciszek Stachura
b646d650d4 query: Move 'versions' command to a function 2025-03-07 16:16:34 +01:00
Franciszek Stachura
2440d49731 query: Move 'ident' command to a function 2025-03-07 16:16:34 +01:00
Franciszek Stachura
64efb3d678 query: Move 'latest' command to a function 2025-03-07 16:16:34 +01:00
Théo Lebrun
0e846ccd6e script.sh: parse-defs: C: index defs that have a CONFIG_ in their line
Take the pm_ptr() macro as example:

⟩ ctags -x --kinds-c=+p+x --extras='-{anonymous}' include/linux/pm.h | grep pm_ptr
pm_ptr           macro       475 include/linux/pm.h #define pm_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM), (_ptr))

The previous grep would remove the pm_ptr() line because it contains
CONFIG_. We only want to remove a line if it starts with CONFIG_.

Testing this commit:

⟩ export LXR_REPO_DIR=...
⟩ hash=97b0e23363c8283f53c361d8129ef90d7a2b9350
⟩ ./script.sh parse-defs $hash pm.h C | sort > /tmp/defs-pm-before.txt
⟩ # TODO: apply commit
⟩ ./script.sh parse-defs $hash pm.h C | sort > /tmp/defs-pm-after.txt
⟩ comm -13 /tmp/defs-pm-before.txt /tmp/defs-pm-after.txt
pm_ptr macro 475
pm_sleep_ptr macro 476

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-02-25 09:28:52 +01:00
Franciszek Stachura
fc8106d520 web: Unify _link and _url variable suffixes 2025-02-14 12:50:29 +01:00
Franciszek Stachura
0f0695e09c web: Stop quoting query('latest') multiple times 2025-02-14 12:49:20 +01:00
Franciszek Stachura
531529a182 web: Make "Go to home page" link to current version
If project and version is valid. Otherwise, redirect to latest or /.
2025-02-14 12:49:16 +01:00
Franciszek Stachura
6edaafb2f3 web: Handle project/version details in invalid URL
Examples:
/musl/v1.2.5/sourc
/musl/v1.2.5/sourc/
/musl/v1.2.5/sourc/asd
/musl/v1.2.5/sourc/asd/
/musl/v1.2.5/sourc/asd/zxc
/musl/v1.2.5/sourc/asd/zxc/
/musl/v1.2.5/sourc/asd/zxc/...

Falcon requires field names on one level to be the same on all
(matching?) paths.
2025-02-14 12:48:20 +01:00
Franciszek Stachura
f6b2d46a0c web: Redirect on incomplete URLs
Examples:
/linux          -> /linux/{latest_tag}/source
/linux/{tag}    -> /linux/{tag}/source
2025-02-14 12:48:20 +01:00
Théo Lebrun
e8823db052 query: query('latest'): return string 2025-02-14 12:48:11 +01:00
Franciszek Stachura
7d09affd5b Dockerfile: Build and use ctags v6.1.0 (upgrade from v5.9)
Changelogs: https://github.com/universal-ctags/ctags/releases

There are some function definitions that are not found by ctags v5.9.
We must upgrade to the latest release but it isn't packaged by Debian.

We only copy the ctags executable. Debian's package files are:
https://packages.debian.org/sid/amd64/universal-ctags/filelist
We drop:
 - The optscript and readtags executables,
 - The changelog and copyright files and,
 - All manpages.
2025-02-14 09:58:00 +01:00
Franciszek Stachura
6559c597c8 web: Update Jinja to v3.1.5
Changelog: https://jinja.palletsprojects.com/en/stable/changes/
2025-02-14 09:51:11 +01:00
Franciszek Stachura
60213dddfa web: Update Falcon from dev to v4.0.2
Changelog: https://falcon.readthedocs.io/en/stable/changes/4.0.0.html

It mentions PathConverter, which was the feature we depended in the
development branch.
2025-02-14 09:50:34 +01:00
Théo Lebrun
5a225c5c43 Dockerfile: move COPY . /usr/local/elixir/ to be the last step
On my machine, a `docker build` after any file change is:
 - Before this patch: 7.29s
 - Afterwards:        2.18s

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-02-05 14:51:30 +01:00
Théo Lebrun
29cf6a5f48 elixir/lib: shorten getDataDir() & getRepoDir()
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-02-03 11:51:32 +01:00
Théo Lebrun
0d2f11baba elixir/lib: fix error case of getDataDir() & getRepoDir()
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-02-03 11:50:53 +01:00
Chris White
973d00665e find-file-doc-comments.pl: don't look for a doc comment before the file starts
Related to #232
2025-01-31 20:25:02 +01:00
Chris White
f9267417fa find-file-doc-comments.pl: die on non-existent input files [minor] 2025-01-31 20:25:02 +01:00
Franciszek Stachura
2cf83f5f7b web: Add input reset button
I tried type="reset", but it reverts to initial value that is sometimes
set by the backend, instead of actually cleraing data.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/reset
2025-01-31 20:11:53 +01:00
Franciszek Stachura
de31767f6b web: Add types 2025-01-31 19:55:56 +01:00
Théo Lebrun
1921e05ab1 gitignore: add /data/ for use as data root
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-01-31 19:27:49 +01:00
Théo Lebrun
808ed15dbc Dockerfile: add utils/ in $PATH by default, for easy indexing
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-01-31 19:27:17 +01:00
Théo Lebrun
43a0eba20a Dockerfile: set PYTHONUNBUFFERED=1 by default
This changes the stdout/stderr buffering behavior of Python. Without it,
indexing scripts don't stream updates and use really big buffers.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-01-31 19:27:17 +01:00
Théo Lebrun
7093c4ab6e Dockerfile: add virtualenv to $PATH by default
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-01-31 19:27:17 +01:00
Théo Lebrun
bb7131fafb utils/index: avoid passing argument to test(1)
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-01-31 19:27:17 +01:00
Théo Lebrun
894920a4ff utils/index: force use of bash, we depend on it for ${@:5} syntax
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-01-31 19:27:17 +01:00