Skip to content

Commit 13d4c4a

Browse files
authored
Merge pull request #10460 from github/aeisenberg/lang-spec-packs
Updates the library path section of the CodeQL spec
2 parents 3165bab + 867e316 commit 13d4c4a

File tree

1 file changed

+8
-25
lines changed

1 file changed

+8
-25
lines changed

docs/codeql/ql-language-reference/ql-language-specification.rst

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -57,44 +57,27 @@ construction of the library path.
5757
First, determine the *query directory* of the ``.ql`` file being
5858
compiled. Starting with the directory containing the ``.ql`` file, and
5959
walking up the directory structure, each directory is checked for a
60-
file called ``queries.xml`` or ``qlpack.yml``. The first directory
60+
file called ``qlpack.yml`` or ``codeql-pack.yml``. The first directory
6161
where such a file is found is the query directory. If there is no such
6262
directory, the directory of the ``.ql`` file itself is the query
6363
directory.
6464

65-
A ``queries.xml`` file that defines a query directory must always
66-
contain a single top-level tag named
67-
``queries``, which has a ``language`` attribute set to the identifier
68-
of the active database schema (for example, ``<queries
69-
language="java"/>``).
70-
7165
A ``qlpack.yml`` file defines a :ref:`CodeQL pack <about-codeql-packs>`.
7266
The content of a ``qlpack.yml`` file is described in the CodeQL CLI documentation.
67+
``codeql-pack.yml`` is an alias for ``qlpack.yml``.
7368

74-
If both a ``queries.xml`` and a ``qlpack.yml`` exist in the same
75-
directory, the latter takes precedence (and the former is assumed to
76-
exist for compatibility with older tooling).
77-
78-
The CodeQL CLI and newer tools based on it (such as,
69+
The CodeQL CLI and tools based on it (such as,
7970
GitHub code scanning and the CodeQL extension for Visual Studio Code)
8071
construct a library path using CodeQL packs. For each CodeQL pack
8172
added to the library path, the CodeQL packs named in its
82-
``libraryPathDependencies`` will be subsequently added to the library
73+
``dependencies`` will be subsequently added to the library
8374
path, and the process continues until all packs have been
8475
resolved. The actual library path consists of the root directories of
8576
the selected CodeQL packs. This process depends on a mechanism for finding
86-
CodeQL packs by pack name, as described in the :ref:`CodeQL CLI documentation <codeql-cli>`.
87-
88-
When the query directory contains a ``queries.xml`` file but no
89-
``qlpack.yml``, the CodeQL pack resolution behaves as if it defines a QL
90-
pack with no name and a single library path dependency named
91-
``legacy-libraries-LANGUAGE`` where ``LANGUAGE`` is taken from
92-
``queries.xml``. The ``github/codeql`` repository provides packs with
93-
names following this pattern, which themselves depend on the actual
94-
CodeQL libraries for each language.
95-
96-
When the query directory contains neither a ``queries.xml`` nor
97-
``qlpack.yml`` file, it is considered to be a CodeQL pack with no name and
77+
CodeQL packs by pack name and version, as described in the :ref:`CodeQL CLI documentation <codeql-cli>`.
78+
79+
When the query directory contains neither a ``qlpack.yml`` nor
80+
``codeql-pack.yml`` file, it is considered to be a CodeQL pack with no name and
9881
no library dependencies. This causes the library path to consist of
9982
*only* the query directory itself. This is not generally useful,
10083
but it suffices for running toy examples of QL code that don't

0 commit comments

Comments
 (0)