-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Open
Labels
clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl''clang' and 'clang++' user-facing binaries. Not 'clang-cl'clang:modulesC++20 modules and Clang Header ModulesC++20 modules and Clang Header Modules
Description
To reproduce:
touch a.h
clang++ -x c++-header a.h -Xclang -fmodule-file-home-is-cwd -o a.pcm
clang++ -module-file-info a.pcm | grep "Input file"
Got: /absolute/path/to/a.h
Want: a.h
The same applies to input pcm files, though I don't have a simple reproducer for that.
When I add -fmodule-file=obj/buildtools/third_party/libc++/std/module.pcm
, I find that the module info output contains Imports module 'std': /absolute/path/to/obj/buildtools/third_party/libc++/std/module.pcm
(And yes, I checked - the file itself contains absolute paths, it's not just output by the tool)
This is a problem for us, because we want to use remote execution, which requires that our paths be relative.
Metadata
Metadata
Assignees
Labels
clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl''clang' and 'clang++' user-facing binaries. Not 'clang-cl'clang:modulesC++20 modules and Clang Header ModulesC++20 modules and Clang Header Modules
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
llvmbot commentedon Jun 17, 2025
@llvm/issue-subscribers-clang-driver
Author: Matt (matts1)
Got:
/absolute/path/to/a.h
Want:
a.h
The same applies to input pcm files, though I don't have a simple reproducer for that.
When I add
-fmodule-file=obj/buildtools/third_party/libc++/std/module.pcm
, I find that the module info output containsImports module 'std': /absolute/path/to/obj/buildtools/third_party/libc++/std/module.pcm
(And yes, I checked - the file itself contains absolute paths, it's not just output by the tool)
This is a problem for us, because we want to use remote execution, which requires that our paths be relative.
llvmbot commentedon Jun 17, 2025
@llvm/issue-subscribers-clang-modules
Author: Matt (matts1)
Got:
/absolute/path/to/a.h
Want:
a.h
The same applies to input pcm files, though I don't have a simple reproducer for that.
When I add
-fmodule-file=obj/buildtools/third_party/libc++/std/module.pcm
, I find that the module info output containsImports module 'std': /absolute/path/to/obj/buildtools/third_party/libc++/std/module.pcm
(And yes, I checked - the file itself contains absolute paths, it's not just output by the tool)
This is a problem for us, because we want to use remote execution, which requires that our paths be relative.
matts1 commentedon Jun 18, 2025
After hooking up a debugger, root cause appears to be that:
-x c++-header
is set becausePP.getLangOpts().isCompilingModule()
returns false.ASTWriter.WritingModule
, which checks ifWritingModule
is null before configuring path normalization.Also, I considered using relocatable precompiled headers, but looking at the documentation, they appear to serve a completely different purpose.
[-][clang] fmodule-file-home-is-cwd doesn't work[/-][+][clang] No relative path support for precompiled headers[/+]matts1 commentedon Jun 20, 2025
I think that we should allow the use of
-fmodule-file-home-is-cwd
when using precompiled headers as well as modules.