Skip to content

[libc++] Re-enable the clang_modules_include test for Objective-C++ #66801

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

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Sep 19, 2023

This reverts commit aa60b26, which was a temporary workaround.
The underlying issue was fixed in Clang via c2c840b.

This was originally https://reviews.llvm.org/D158694.

@ldionne ldionne requested a review from a team as a code owner September 19, 2023 18:48
@llvmbot llvmbot added clang Clang issues not falling into any other category libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. labels Sep 19, 2023
@llvmbot
Copy link
Member

llvmbot commented Sep 19, 2023

@llvm/pr-subscribers-libcxx

@llvm/pr-subscribers-clang

Changes

This reverts commit aa60b26, which was a temporary workaround.

This was originally https://reviews.llvm.org/D158694.


Full diff: https://github.com/llvm/llvm-project/pull/66801.diff

2 Files Affected:

  • (added) clang/foo ()
  • (modified) libcxx/test/libcxx/clang_modules_include.gen.py (-3)
diff --git a/clang/foo b/clang/foo
new file mode 100644
index 000000000000000..e69de29bb2d1d64
diff --git a/libcxx/test/libcxx/clang_modules_include.gen.py b/libcxx/test/libcxx/clang_modules_include.gen.py
index b4c5c79a47f6823..b4aecfe5d8faae6 100644
--- a/libcxx/test/libcxx/clang_modules_include.gen.py
+++ b/libcxx/test/libcxx/clang_modules_include.gen.py
@@ -44,11 +44,8 @@
 #include <{header}>
 """)
 
-# TODO: Remove the UNSUPPORTED{BLOCKLIT}: clang-modules-build once issues with this test have been figured out.
 print(f"""\
 //--- __std_clang_module.compile.pass.mm
-// UNSUPPORTED{BLOCKLIT}: clang-modules-build
-
 // RUN{BLOCKLIT}: %{{cxx}} %s %{{flags}} %{{compile_flags}} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only
 
 // REQUIRES{BLOCKLIT}: clang-modules-build

@ldionne
Copy link
Member Author

ldionne commented Sep 25, 2023

@mordante I'm not certain what's going on here, I get

[...]/clang_modules_include.gen.py/__std_clang_module.compile.pass.mm:22:2: error: import of module 'std' imported non C++20 importable modules
   22 | @import std;
      |  ^
1 error generated.

Can you assist? It only happens with Clang trunk.

@mordante
Copy link
Member

@mordante I'm not certain what's going on here, I get

[...]/clang_modules_include.gen.py/__std_clang_module.compile.pass.mm:22:2: error: import of module 'std' imported non C++20 importable modules
   22 | @import std;
      |  ^
1 error generated.

Can you assist? It only happens with Clang trunk.

I tested this locally and indeed it works with clang-17 and fails with clang-18

@ChuanqiXu9 This seems to be introduced in 574ee1c.

This test uses a Objective-C++ file. Is it easy for you to fix or should I file a bug report?

@ChuanqiXu9
Copy link
Member

ChuanqiXu9 commented Dec 28, 2023

@mordante I'm not certain what's going on here, I get

[...]/clang_modules_include.gen.py/__std_clang_module.compile.pass.mm:22:2: error: import of module 'std' imported non C++20 importable modules
   22 | @import std;
      |  ^
1 error generated.

Can you assist? It only happens with Clang trunk.

I tested this locally and indeed it works with clang-17 and fails with clang-18

@ChuanqiXu9 This seems to be introduced in 574ee1c.

This test uses a Objective-C++ file. Is it easy for you to fix or should I file a bug report?

The motivation of my change was that I find multiple people are trying to fake import std from clang modules. This is not wanted. So I tried to ban it. I'll try to fix it or revert it later today if I didn't.

@ChuanqiXu9
Copy link
Member

I tried to fix this in c2c840b. Sorry for disturbing.

@mordante
Copy link
Member

I tried to fix this in c2c840b. Sorry for disturbing.

Thanks for the quick fix! I've tested the fix with this patch locally and it passes.

@ldionne ldionne force-pushed the review/reenable-clang-modules-test branch from 7683064 to f056692 Compare January 16, 2024 15:48
@ldionne
Copy link
Member Author

ldionne commented Jan 16, 2024

Thanks folks! I rebased and I'm re-running the CI. I'll merge once it's green.

Copy link

github-actions bot commented Jan 16, 2024

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

You can test this locally with the following command:
darker --check --diff -r 1ec5b1f483aa154255d919af9abf5eca2fe8635c...217e8477c88eb994ae5beb14dcac9162385e1289 libcxx/test/libcxx/clang_modules_include.gen.py
View the diff from darker here.
--- clang_modules_include.gen.py	2024-03-11 13:54:19.000000 +0000
+++ clang_modules_include.gen.py	2024-03-11 13:57:33.782661 +0000
@@ -45,11 +45,12 @@
 {lit_header_restrictions.get(header, '')}
 
 #include <{header}>
 """)
 
-print(f"""\
+print(
+    f"""\
 //--- __std_clang_module.compile.pass.mm
 // RUN{BLOCKLIT}: %{{cxx}} %s %{{flags}} %{{compile_flags}} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only
 
 // REQUIRES{BLOCKLIT}: clang-modules-build
 
@@ -69,6 +70,7 @@
 // TODO: Investigate this failure
 // UNSUPPORTED{BLOCKLIT}: LIBCXX-FREEBSD-FIXME
 
 @import std;
 
-""")
+"""
+)

@ldionne ldionne force-pushed the review/reenable-clang-modules-test branch from bb67a57 to e638ee5 Compare January 30, 2024 13:47
@ldionne
Copy link
Member Author

ldionne commented Jan 30, 2024

I rebased again. Last time I rebased there was still the same Clang issue.

@mordante
Copy link
Member

mordante commented Feb 2, 2024

I rebased again. Last time I rebased there was still the same Clang issue.

I guess nobody ever updated our Docker image. I want to look at that soon so we can start testing LLVM-19 in the CI.

@ldionne ldionne force-pushed the review/reenable-clang-modules-test branch from e638ee5 to b5ee867 Compare February 29, 2024 15:54
This reverts commit aa60b26, which was a temporary workaround.
@ldionne ldionne force-pushed the review/reenable-clang-modules-test branch from b5ee867 to 217e847 Compare March 11, 2024 13:54
@ldionne
Copy link
Member Author

ldionne commented Mar 11, 2024

Merging since the relevant tests have passed.

@ldionne ldionne merged commit d2e57c5 into llvm:main Mar 11, 2024
@ldionne ldionne deleted the review/reenable-clang-modules-test branch March 11, 2024 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants