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

[libc] newheadergen: created sys folder for yaml files, make appropriate updates to CMake file for sys folder #98693

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
header: sys-auxv.h
standards:
- GNUExtensions
macros: []
types: []
enums: []
Expand Down
9 changes: 9 additions & 0 deletions libc/newhdrgen/yaml_to_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,15 @@ def main(yaml_file, h_def_file, output_dir, add_function=None):
output_file_name = Path(h_def_file).stem
output_file_path = Path(output_dir) / output_file_name

# with open(yaml_file, "r") as f:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean to leave this in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as a placeholder for now while I wait for the CMake to come out. I'm not sure if I can manually add sys to the file path here or if I will have to make an alternate path in the CMake file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in that case I'd say it's probably best to leave this out of this patch. Commented out code is often confusing when reading a file

# yaml_data = yaml.safe_load(f)

# header_name = yaml_data[header]
# if len(header_name) >= 6 and header_name[0:4] == "sys-":
# output_file_path = Path(output_dir) / sys / output_file_name
# or maybe:
# output_file_path = Path(other_output_dir) / output_file_name

with open(output_file_path, "w") as f:
f.write(final_header_content)

Expand Down
Loading