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

Debug windows failures for localization changes #114228

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Oct 30, 2024

No description provided.

Copy link

github-actions bot commented Oct 30, 2024

⚠️ Python code formatter, darker found issues in your code. ⚠️

You can test this locally with the following command:
darker --check --diff -r 6563ed3162d16e7f067dda554e96d0c9d476f207...7dfae2ca2b99949f374264906923d230306c27e5 libcxx/test/libcxx/clang_modules_include.gen.py libcxx/utils/libcxx/test/format.py
View the diff from darker here.
--- test/libcxx/clang_modules_include.gen.py	2024-10-30 13:26:24.000000 +0000
+++ test/libcxx/clang_modules_include.gen.py	2024-10-30 16:52:14.401347 +0000
@@ -18,11 +18,12 @@
 import sys
 sys.path.append(sys.argv[1])
 from libcxx.header_information import lit_header_restrictions, public_headers
 
 for header in public_headers:
-  print(f"""\
+    print(
+        f"""\
 //--- {header}.compile.pass.cpp
 // RUN: %{{cxx}} %s %{{flags}} %{{compile_flags}} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only
 
 // Older macOS SDKs were not properly modularized, which causes issues with localization.
 // This feature should instead be based on the SDK version.
@@ -45,11 +46,12 @@
 // UNSUPPORTED: LIBCXX-PICOLIBC-FIXME
 
 {lit_header_restrictions.get(header, '')}
 
 #include <{header}>
-""")
+"""
+    )
 
 print(
     f"""\
 //--- import_std.compile.pass.mm
 // RUN: %{{cxx}} %s %{{flags}} %{{compile_flags}} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only
--- utils/libcxx/test/format.py	2024-10-30 13:56:06.000000 +0000
+++ utils/libcxx/test/format.py	2024-10-30 16:52:14.505545 +0000
@@ -285,12 +285,14 @@
 
     def execute(self, test, litConfig):
         supportsVerify = "verify-support" in test.config.available_features
         filename = test.path_in_suite[-1]
 
-        if filename != 'getloc.pass.cpp':
-            return lit.Test.Result(lit.Test.UNSUPPORTED, "not the test we're looking for")
+        if filename != "getloc.pass.cpp":
+            return lit.Test.Result(
+                lit.Test.UNSUPPORTED, "not the test we're looking for"
+            )
 
         if re.search("[.]sh[.][^.]+$", filename):
             steps = []  # The steps are already in the script
             return self._executeShTest(test, litConfig, steps)
         elif filename.endswith(".compile.pass.cpp") or filename.endswith(

Copy link

github-actions bot commented Oct 30, 2024

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 6563ed3162d16e7f067dda554e96d0c9d476f207 7dfae2ca2b99949f374264906923d230306c27e5 --extensions h,,cpp -- libcxx/include/__locale_dir/locale_base_api.h libcxx/include/__locale_dir/locale_base_api/bsd_locale_defaults.h libcxx/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h libcxx/include/locale libcxx/src/locale.cpp libcxx/src/support/win32/locale_win32.cpp libcxx/test/std/re/re.traits/getloc.pass.cpp
View the diff from clang-format here.
diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index 9553027cc0..b6f51779e2 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -233,14 +233,14 @@ locale::__imp::__imp(const string& name, size_t refs) : facet(refs), facets_(N),
       if (facets_[i])
         facets_[i]->__add_shared();
 
-#define _DOIT(...)                                            \
-    do {                                                      \
-      std::fprintf(stderr, "Creating " #__VA_ARGS__ "\n");    \
-      auto* the_facet = new __VA_ARGS__(name_);               \
-                                                              \
-      std::fprintf(stderr, "Installing " #__VA_ARGS__ "\n");  \
-      install(the_facet);                                     \
-    } while (false)
+#define _DOIT(...)                                                                                                     \
+  do {                                                                                                                 \
+    std::fprintf(stderr, "Creating " #__VA_ARGS__ "\n");                                                               \
+    auto* the_facet = new __VA_ARGS__(name_);                                                                          \
+                                                                                                                       \
+    std::fprintf(stderr, "Installing " #__VA_ARGS__ "\n");                                                             \
+    install(the_facet);                                                                                                \
+  } while (false)
 
     _DOIT(collate_byname<char>);
 #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
diff --git a/libcxx/src/support/win32/locale_win32.cpp b/libcxx/src/support/win32/locale_win32.cpp
index cdef5417b2..ba387e7da8 100644
--- a/libcxx/src/support/win32/locale_win32.cpp
+++ b/libcxx/src/support/win32/locale_win32.cpp
@@ -7,10 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 #include <cstdarg> // va_start, va_end
+#include <cstdio>
 #include <locale>
 #include <memory>
 #include <type_traits>
-#include <cstdio>
 
 #include <__locale_dir/locale_guard.h>
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant