Bug 1947247 - Force sorted individual-files-list in moz.yaml. r=tjr

This commit forces the invidual-files-list in moz.yaml files to be
sorted. This mimics SOURCES behavior in moz.build files. It makes it
easier to keep the list sorted across patches while gradually creating
a moz.yaml file when vendoring a new project.

Differential Revision: https://phabricator.services.mozilla.com/D237603
This commit is contained in:
Yannis Juglaret
2025-02-11 08:22:32 +00:00
parent 3edb00f8e4
commit e3ffd28c28
4 changed files with 37 additions and 24 deletions

View File

@@ -31,8 +31,6 @@ vendoring:
individual-files-default-upstream: 'lib/msun/src/'
individual-files-default-destination: '{vendor_dir}/'
individual-files-list:
- math_private.h
- math.h
- e_acos.c
- e_acosf.c
- e_acosh.c
@@ -45,10 +43,10 @@ vendoring:
- e_expf.c
- e_hypot.c
- e_hypotf.c
- e_log.c
- e_log10.c
- e_log10f.c
- e_log2.c
- e_log.c
- e_logf.c
- e_pow.c
- e_powf.c
@@ -67,6 +65,8 @@ vendoring:
- k_sinf.c
- k_tan.c
- k_tanf.c
- math.h
- math_private.h
- s_asinh.c
- s_atan.c
- s_atanf.c
@@ -76,9 +76,9 @@ vendoring:
- s_copysign.c
- s_cos.c
- s_cosf.c
- s_expm1.c
- s_exp2.c
- s_exp2f.c
- s_expm1.c
- s_fabs.c
- s_fabsf.c
- s_floor.c

View File

@@ -964,7 +964,7 @@ bugzilla:
"flavor": "individual-files",
"individual-files-default-destination": "bar",
"individual-files-default-upstream": "foo",
"individual-files-list": ["foo", "bar"],
"individual-files-list": ["bar", "foo"],
"update-actions": [
{"action": "move-file", "from": "foo", "to": "bar"}
],
@@ -989,8 +989,8 @@ vendoring:
individual-files-default-upstream: foo
individual-files-default-destination: bar
individual-files-list:
- foo
- bar
- foo
update-actions:
- action: move-file
from: foo
@@ -1086,8 +1086,8 @@ vendoring:
flavor: individual-files
indidivudal-files-default-destination: foo
individual-files-list:
- foo
- bar
- foo
update-actions:
- action: move-file
from: foo

View File

@@ -378,6 +378,19 @@ def _schema_1_additional(filename, manifest, require_license_file=True):
raise ValueError(
"individual-files-default-destination must be used with individual-files-list"
)
misplaced = []
previous = None
for current in manifest["vendoring"]["individual-files-list"]:
if previous is not None and not (previous.lower() <= current.lower()):
misplaced.append(current)
else:
previous = current
if len(misplaced) > 0:
raise ValueError(
"individual-files-list must be sorted, the following files are misplaced: {}".format(
", ".join(misplaced)
)
)
if "updatebot" in manifest:
# If there are Updatebot tasks, then certain fields must be present and

View File

@@ -24,13 +24,13 @@ vendoring:
individual-files-default-upstream: ""
individual-files-default-destination: "{vendor_dir}/"
individual-files-list:
- base/at_exit.cc
- base/at_exit.h
- base/atomic_ref_count.h
- base/atomic_sequence_num.h
- base/atomicops.h
- base/atomicops_internals_portable.h
- base/atomicops_internals_x86_msvc.h
- base/atomic_ref_count.h
- base/atomic_sequence_num.h
- base/at_exit.cc
- base/at_exit.h
- base/base_export.h
- base/base_paths.h
- base/base_paths_win.h
@@ -39,8 +39,8 @@ vendoring:
- base/bind.h
- base/bind_helpers.h
- base/bind_internal.h
- base/bits.h
- base/bit_cast.h
- base/bits.h
- base/callback.h
- base/callback_forward.h
- base/callback_internal.cc
@@ -65,9 +65,9 @@ vendoring:
- base/debug/profiler.h
- base/environment.cc
- base/environment.h
- base/file_descriptor_posix.h
- base/files/file_path.h
- base/files/file_path_constants.cc
- base/file_descriptor_posix.h
- base/format_macros.h
- base/guid.h
- base/hash/hash.cc
@@ -127,11 +127,11 @@ vendoring:
- base/rand_util_win.cc
- base/scoped_clear_last_error.h
- base/scoped_clear_last_error_win.cc
- base/sequenced_task_runner.h
- base/sequenced_task_runner_helpers.h
- base/sequence_checker.h
- base/sequence_checker_impl.h
- base/sequence_token.h
- base/sequenced_task_runner.h
- base/sequenced_task_runner_helpers.h
- base/single_thread_task_runner.h
- base/stl_util.h
- base/strings/char_traits.h
@@ -142,8 +142,6 @@ vendoring:
- base/strings/safe_sprintf_unittest.cc
- base/strings/string16.cc
- base/strings/string16.h
- base/strings/stringprintf.cc
- base/strings/stringprintf.h
- base/strings/string_number_conversions.cc
- base/strings/string_number_conversions.h
- base/strings/string_piece.cc
@@ -156,10 +154,12 @@ vendoring:
- base/strings/string_util_constants.cc
- base/strings/string_util_posix.h
- base/strings/string_util_win.h
- base/strings/utf_string_conversions.cc
- base/strings/utf_string_conversions.h
- base/strings/stringprintf.cc
- base/strings/stringprintf.h
- base/strings/utf_string_conversion_utils.cc
- base/strings/utf_string_conversion_utils.h
- base/strings/utf_string_conversions.cc
- base/strings/utf_string_conversions.h
- base/synchronization/atomic_flag.h
- base/synchronization/condition_variable.h
- base/synchronization/condition_variable_posix.cc
@@ -185,6 +185,7 @@ vendoring:
- base/third_party/superfasthash/superfasthash.c
- base/third_party/valgrind/LICENSE
- base/third_party/valgrind/valgrind.h
- base/thread_annotations.h
- base/threading/platform_thread.cc
- base/threading/platform_thread.h
- base/threading/platform_thread_internal_posix.cc
@@ -205,7 +206,6 @@ vendoring:
- base/threading/thread_local_storage_win.cc
- base/threading/thread_restrictions.cc
- base/threading/thread_restrictions.h
- base/thread_annotations.h
- base/time/time.cc
- base/time/time.h
- base/time/time_exploded_posix.cc
@@ -237,8 +237,8 @@ vendoring:
- base/win/windows_types.h
- base/win/windows_version.cc
- base/win/windows_version.h
- build/buildflag.h
- build/build_config.h
- build/buildflag.h
- LICENSE
- sandbox/linux/bpf_dsl/bpf_dsl.cc
- sandbox/linux/bpf_dsl/bpf_dsl.h
@@ -303,13 +303,13 @@ vendoring:
- sandbox/win/src/crosscall_server.h
- sandbox/win/src/eat_resolver.cc
- sandbox/win/src/eat_resolver.h
- sandbox/win/src/file_policy_test.cc
- sandbox/win/src/filesystem_dispatcher.cc
- sandbox/win/src/filesystem_dispatcher.h
- sandbox/win/src/filesystem_interception.cc
- sandbox/win/src/filesystem_interception.h
- sandbox/win/src/filesystem_policy.cc
- sandbox/win/src/filesystem_policy.h
- sandbox/win/src/file_policy_test.cc
- sandbox/win/src/handle_closer.cc
- sandbox/win/src/handle_closer.h
- sandbox/win/src/handle_closer_agent.cc
@@ -449,11 +449,11 @@ vendoring:
- sandbox/win/src/unload_dll_test.cc
- sandbox/win/src/win2k_threadpool.cc
- sandbox/win/src/win2k_threadpool.h
- sandbox/win/src/window.cc
- sandbox/win/src/window.h
- sandbox/win/src/win_utils.cc
- sandbox/win/src/win_utils.h
- sandbox/win/src/win_utils_unittest.cc
- sandbox/win/src/window.cc
- sandbox/win/src/window.h
# Apply patches that are taken from upstream first as these will not be
# needed at some point, so we want subsequent patches to work after the