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

scripts/*syscalls.py: sort os.walk() for a more deterministic build #13446

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 6 additions & 2 deletions scripts/parse_syscalls.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def analyze_headers(multiple_directories):
ret = []

for base_path in multiple_directories:
for root, dirs, files in os.walk(base_path):
for root, dirs, files in os.walk(base_path, topdown=True):
dirs.sort()
files.sort()
for fn in files:

# toolchain/common.h has the definition of __syscall which we
Expand Down Expand Up @@ -52,7 +54,9 @@ def parse_args():
formatter_class=argparse.RawDescriptionHelpFormatter)

parser.add_argument("-i", "--include", required=True, action='append',
help="Base include directory")
help='''include directories recursively scanned
for .h files. Can be specified multiple times:
-i topdir1 -i topdir2 ...''')
parser.add_argument(
"-j", "--json-file", required=True,
help="Write system call prototype information as json to file")
Expand Down
3 changes: 2 additions & 1 deletion scripts/subfolder_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def main():
else:
dirlist.extend(args.directory)
dirlist.extend(os.linesep)
for root, dirs, files in os.walk(args.directory):
for root, dirs, _ in os.walk(args.directory, topdown=True):
dirs.sort()
for subdir in dirs:
if(args.create_links is not None):
directory = os.path.join(root, subdir)
Expand Down