Support GN response_file_contents in gn_processor.py
Categories
(Core :: Graphics, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox153 | --- | fixed |
People
(Reporter: jnicol, Assigned: jnicol)
References
Details
Attachments
(1 file)
| Assignee | ||
Comment 1•1 month ago
|
||
Some GN actions pass large lists of input files through a response file
rather than directly on the command line. We need to support this in
order to build ANGLE with moz.build files generated by gn_processor.py.
The only case we currently need to support is ANGLE's
angle_program_version_id action. The response_file_contents field in
this case is a list of relative paths from the GN gen dir to files in
the source tree, but the action is executed at build time with a cwd in
the objdir. At vendor time, gn_processor.py cannot know the eventual
source directory, object directory, or relative path between the two.
To handle this, gn_processor.py encodes those paths into a vendored
.rsp.in sidecar file using mozbuild-style path prefixes. At build time,
a new write_path_list.py action converts the .rsp.in file into a real
response file in the objdir, resolving those prefixes to absolute paths
and shlex-quoting them for the ANGLE script's response-file parser. A
second GeneratedFile invokes the original action through a new
file_generate_wrapper.py entry point, substituting the
{{response_file_name}} placeholder with that generated response file
input.
GeneratedFiles is now emitted as a list so a GN action can produce both
the response file and the action output. The stale generated-file
cleanup is also updated to retain these extra sidecar files while still
removing stale generated outputs.
Additionally, we must make the raw project.json path rewriting more
specific. The previous broad target_dir replacements could modify paths
in response_file_contents and make them point at files that do not
exist.
Note that a response file can technically contain arbitrary data, but
this currently only supports the case where it is a list of paths. If we
need to support arbitrary response file contents in the future then this
will need to be adapted.
Updated•1 month ago
|
Comment 3•1 month ago
|
||
| bugherder | ||
Updated•29 days ago
|
Description
•