<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Tianocore/edk2.git/BaseTools/Source/Python/Trim, branch master</title>
<subtitle>EDK II (mirror)</subtitle>
<id>https://git.radix-linux.su/Tianocore/edk2.git/atom?h=master</id>
<link rel='self' href='https://git.radix-linux.su/Tianocore/edk2.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/'/>
<updated>2026-08-28T10:04:05+00:00</updated>
<entry>
<title>BaseTools/Python: Remove error message with email address</title>
<updated>2026-08-28T10:04:05+00:00</updated>
<author>
<name>Vishal Oliyil Kunnil</name>
<email>vishalo@qti.qualcomm.com</email>
</author>
<published>2026-05-22T21:14:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=edcf8ffa69319cd5cb038124bd3878f254f97056'/>
<id>urn:sha1:edcf8ffa69319cd5cb038124bd3878f254f97056</id>
<content type='text'>
Remove the "Please send email to devel@edk2.groups.io" message
from the unhandled exception handlers in build.py, GenFds.py,
Trim.py, and the UPT tools. Also remove the now-unused
MSG_EDKII_MAIL_ADDR and MSG_SEARCH_FOR_HELP constants from
Common/DataType.py and UPT/Logger/StringTable.py.

Signed-off-by: Vishal Oliyil Kunnil &lt;vishalo@qti.qualcomm.com&gt;
</content>
</entry>
<entry>
<title>BaseTools/Trim.py: Strip "#pragma once" from inlined ASL content</title>
<updated>2026-07-17T21:50:16+00:00</updated>
<author>
<name>Michael Kubacki</name>
<email>michael.kubacki@microsoft.com</email>
</author>
<published>2026-06-11T19:27:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=a59064933f698e7c192063d04157c302d3efc257'/>
<id>urn:sha1:a59064933f698e7c192063d04157c302d3efc257</id>
<content type='text'>
When Trim processes an ASL file (`--asl-file`), it textually inlines
the body of every `Include()`'d file directly into the constructed
preprocessor input, once per include site.

Its has duplicate protection in the form of a circular-include stack
(`gIncludedAslFile`), that prevents A-&gt;B-&gt;A cycles. But, as far as
the script is concerned, each `Include()` is a unique include site.

Various combinations of includes and file types are possible and
handled slightly differently.

Starting with file types as defined in
BaseTools\Conf\build_rule.template:

- `.aslc`, `.act` files fall under `Acpi-Table-Code-File` and are
  compiled, linked, and processed by genfw.
- `.asl`, `.Asl`, and `.ASL` files fall in `Acpi-Source-Language-File`
  and are processed by Trim:
  1. `Trim --asl-file` to produce a single combined .i file with
     includes inlined.
  2. `ASLPP` (ASL preprocessor, a C preprocessor) on the output of
     Trim to produce a .iii file with all macros expanded and
     conditional branches resolved. AutoGen.h is also included and
     processed here to resolve fixed PCD values if needed.
  3. `Trim --source-code` which takes the pre-processed .iii file and
     produces a .iiii file with content like linemarkers cleaned up.
  4. The ACPI compiler compiles the .iiii file to produce AML bytecode
     in a .aml file.

Because the `.aslc`/`.act` files are directly passed to normal C
processing tools, they are not part of the Trim change made in this
commit and the remainder of this message focuses on the ACPI Source
Language File case.

ASL files can use either an ASL `Include()` directive or a C-style
`#include` directive. In addition, different file types may be
included such as a `.asl` file or a `.h` file.

`Trim` handles these cases differently:

- For ASL `Include()` directives, `Trim` inlines the content of the
  included file directly into the output at the include site. This is
  done for all included ASL files regardless of their extension. The
  inlining is purely textual and does not attempt to resolve or
  preserve any preprocessor directives such as `#pragma once` or
  include guards.
- For C-style `#include` directives, `Trim` checks the file extension
  of the included file. If the file is an ASL file (`.asl` or `.asi`),
  `Trim` treats the file the same as the `Include()` case. Otherwise,
  `Trim` passes the directive through verbatim to the output, allowing
  the downstream C preprocessor (`ASLPP`) to handle it according to
  normal C preprocessor rules.

This creates a situtation in which the resulting `.i` might include:

- Inlined file content (from a `.asl` or `.h` file) depending on the
  include type and file extension.
- Verbatim `#include` directives for non-ASL files which will be
  processed by the C preprocessor.

Focusing on the "inlined" case, historically `.h` files would have
traditional C include guards (`#ifndef`/`#define`, `#endif`). However,
files might also include `#pragma once` as a guard.

In that case, the inlined content of the `.i` file could contain
multiple `#pragma once` directives, one per include site. When the
C preprocessor (`ASLPP`) processes the `.i` file, it sees multiple
`#pragma once` directives in what it considers the main file, and
could emit a warning like the following from gcc:

  warning: '#pragma once' in main file [-Wpragma-once-outside-header]

The remainder of this commit message describes the change made to
address this warning.

This change strips "#pragma once" lines on the ASL content path in
`DoInclude()` in `Trim.py` so the directive is removed before it
reaches the C preprocessor.

  - "#include" directives for non-ASL files are still passed through
    verbatim for the C preprocessor to resolve where the contents of
    those .h files might contain "#pragma once" or traditional guards.
  - Traditional include guards are untouched and continue to behave as
    before where multiple include sites might inline the same content
    in the .i file before reaching the C preprocessor.

The change:

In the case that a file is inlined with a `#pragma once` directive,
the directive is stripped from the inlined content which prevents the
warning.

This is considered acceptable because it only removes the
`#pragma once` directive from the inlined content for these specific
cases. So, the `.i` file might contain multiple inlined copies of the
same header content (like always in this inline case) but without the
`#pragma once` directives. Because actual C content was already not
processed or trimmed out (e.g. `typedef struct`) duplicate content is
not considered to be a problem (`#define` multiple times is not a
problem for the C preprocessor).

Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
</content>
</entry>
<entry>
<title>BaseTools/Source/Python/Trim: Add -f/--source-code-format option</title>
<updated>2026-03-06T19:47:31+00:00</updated>
<author>
<name>Michael D Kinney</name>
<email>michael.d.kinney@intel.com</email>
</author>
<published>2026-01-31T22:34:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=e22f4a61c9e68fdf18e5dc202c9b1495f5cdca05'/>
<id>urn:sha1:e22f4a61c9e68fdf18e5dc202c9b1495f5cdca05</id>
<content type='text'>
Add --source-code-format option that can be NASM or not
specified. This can be used for file format specific actions
when --source-code is used.

A NASM specific action is added to convert #line to %line to
preserve reference the originating NASM source file for source
level debug in NASM format.

Without this change, the source level debug of NASM files
loads the generated intermediate file in the build output
directory.

Signed-off-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Trim: Add header/footer for ASL include</title>
<updated>2024-08-31T04:58:54+00:00</updated>
<author>
<name>Joey Vagedes</name>
<email>joey.vagedes@gmail.com</email>
</author>
<published>2024-06-27T18:22:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=95ee7f3ef7a34773e0528410fd0178aecfdd89b5'/>
<id>urn:sha1:95ee7f3ef7a34773e0528410fd0178aecfdd89b5</id>
<content type='text'>
When including one ASL file in another, add a header / footer to the
included file to easily tell where the included file starts and ends.

Signed-off-by: Joey Vagedes &lt;joey.vagedes@gmail.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Resolve regex syntax warnings</title>
<updated>2023-12-21T00:33:31+00:00</updated>
<author>
<name>Joey Vagedes via groups.io</name>
<email>joeyvagedes=microsoft.com@groups.io</email>
</author>
<published>2023-12-06T20:27:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=9f0061a03b61d282fbc0ba5be22155d06a5e64a1'/>
<id>urn:sha1:9f0061a03b61d282fbc0ba5be22155d06a5e64a1</id>
<content type='text'>
Switches regex patterns to raw text to resolve python 3.12 syntax
warnings in regards to invalid escape sequences, as is suggested by the
re (regex) module in python.

Cc: Rebecca Cran &lt;rebecca@bsdio.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Bob Feng &lt;bob.c.feng@intel.com&gt;
Cc: Yuwei Chen &lt;yuwei.chen@intel.com&gt;
Signed-off-by: Joey Vagedes &lt;joey.vagedes@gmail.com&gt;
Reviewed-by: Rebecca Cran &lt;rebecca@bsdio.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: trim warning to error</title>
<updated>2023-10-18T18:17:19+00:00</updated>
<author>
<name>Yuwei Chen</name>
<email>yuwei.chen@intel.com</email>
</author>
<published>2023-09-22T06:47:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=b75d9f556d6f290a4037064a2b934f5a3396328c'/>
<id>urn:sha1:b75d9f556d6f290a4037064a2b934f5a3396328c</id>
<content type='text'>
As the error is changed to warning, Trim.py will skip the build
error when the source code have exactly issue.
This patch change warning to error to opens the checking.

Cc: Rebecca Cran &lt;rebecca@bsdio.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Bob Feng &lt;bob.c.feng@intel.com&gt;
Signed-off-by: Yuwei Chen &lt;yuwei.chen@intel.com&gt;
Reviewed-by: Rebecca Cran &lt;rebecca@bsdio.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Incremental build issue for included ASI file's deletion.</title>
<updated>2020-11-10T00:24:06+00:00</updated>
<author>
<name>Mingyue Liang</name>
<email>mingyuex.liang@intel.com</email>
</author>
<published>2020-11-09T02:51:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=0af7f8e6a9253960ba820cd6ddfd8c36543d30cb'/>
<id>urn:sha1:0af7f8e6a9253960ba820cd6ddfd8c36543d30cb</id>
<content type='text'>
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2972

When using incremental build to delete an included xxx.asi file from
the ASL file, the xxx.asl.trim.deps file generated by previous build
process will not be deleted from the OUTPUT directory, which caused
the dependency file still include the xxx.asl.trim.deps file.

If the include file is deleted and DEPs is empty.

Signed-off-by: Mingyue Liang &lt;mingyuex.liang@intel.com&gt;
Cc: Bob Feng &lt;bob.c.feng@intel.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Yuwei Chen &lt;yuwei.chen@intel.com&gt;

Reviewed-by: Bob Feng &lt;bob.c.feng@intel.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Warn user the file not found issue instead of break build.</title>
<updated>2020-06-07T13:36:33+00:00</updated>
<author>
<name>Bob Feng</name>
<email>bob.c.feng@intel.com</email>
</author>
<published>2020-06-01T06:40:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=cfd73e0065f523e1d56bb32b5c9d48e162c903f8'/>
<id>urn:sha1:cfd73e0065f523e1d56bb32b5c9d48e162c903f8</id>
<content type='text'>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2770

The Trim.py would break the build process when the file not found
issue occures, however sometimes we do not care about this issue.
This patch changes the error with warning in order to solve this
kind of break.

Cc: Bob Feng &lt;bob.c.feng@intel.com&gt;
Cc: Liming Gao &lt;liming.gao@intel.com&gt;
Signed-off-by: Yuwei Chen &lt;yuwei.chen@intel.com&gt;
Reviewed-by: Bob Feng&lt;bob.c.feng@intel.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Generate dependent files for ASL and ASM files</title>
<updated>2019-12-10T01:31:55+00:00</updated>
<author>
<name>Bob Feng</name>
<email>bob.c.feng@intel.com</email>
</author>
<published>2019-11-20T02:58:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=e6edbe315fc3fbd02783cb4faa9284f8d05c410d'/>
<id>urn:sha1:e6edbe315fc3fbd02783cb4faa9284f8d05c410d</id>
<content type='text'>
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2311

Implement the function in Trim tool to get the included
file list for ASL and ASM file.

Signed-off-by: Bob Feng &lt;bob.c.feng@intel.com&gt;

Cc: Liming Gao &lt;liming.gao@intel.com&gt;
Cc: Steven Shi &lt;steven.shi@intel.com&gt;
Reviewed-by: Liming Gao &lt;liming.gao@intel.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Fixed a typo in Trim.py</title>
<updated>2019-08-01T16:18:00+00:00</updated>
<author>
<name>Feng, Bob C</name>
<email>bob.c.feng@intel.com</email>
</author>
<published>2019-08-01T13:23:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=83d6207f99021ac9b2990fc9d66bab3cb3ae5f26'/>
<id>urn:sha1:83d6207f99021ac9b2990fc9d66bab3cb3ae5f26</id>
<content type='text'>
This is a regression issue introduced
by commit 307e1650be267b67db7be1089e0979ace460d83

This patch is to fix this issue.

Cc: Liming Gao &lt;liming.gao@intel.com&gt;
Signed-off-by: Bob Feng &lt;bob.c.feng@intel.com&gt;
Reviewed-by: Jaben Carsey &lt;jaben.carsey@intel.com&gt;
Reviewed-by: Philippe Mathieu-Daude &lt;philmd@redhat.com&gt;
Reviewed-by: Liming Gao &lt;liming.gao@intel.com&gt;
</content>
</entry>
</feed>
