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

$PWD ends up in IDxcIncludeHandler::LoadSource when compiling DXIL on Linux #4212

Closed
MarijnS95 opened this issue Jan 27, 2022 · 0 comments · Fixed by #4265
Closed

$PWD ends up in IDxcIncludeHandler::LoadSource when compiling DXIL on Linux #4212

MarijnS95 opened this issue Jan 27, 2022 · 0 comments · Fixed by #4265

Comments

@MarijnS95
Copy link
Contributor

While compiling DXIL on Linux through the COM API (of libdxcompiler.so) we get strange IDxcIncludeHandler callbacks with the current working directory as file path - which is definitely not a header file to be included. It seems to be happening while retrieving information about the current working directory, following the stacktrace below:

..
load_source (.cargo/registry/src/github.com-1ecc6299db9ec823/hassle-rs-0.7.0/src/wrapper.rs:187)
dxcutil::DxcArgsFileSystemImpl::TryFindOrOpen(wchar_t const*, unsigned long&) (@dxcutil::DxcArgsFileSystemImpl::TryFindOrOpen(wchar_t const*, unsigned long&):45)
dxcutil::DxcArgsFileSystemImpl::GetFileAttributesW(wchar_t const*) (@dxcutil::DxcArgsFileSystemImpl::GetFileAttributesW(wchar_t const*):74)
dxcutil::DxcArgsFileSystemImpl::Stat(char const*, stat*) (@dxcutil::DxcArgsFileSystemImpl::Stat(char const*, stat*):48)
llvm::sys::fs::status(llvm::Twine const&, llvm::sys::fs::file_status&) (@llvm::sys::fs::status(llvm::Twine const&, llvm::sys::fs::file_status&):24)
llvm::sys::fs::current_path(llvm::SmallVectorImpl<char>&) (@llvm::sys::fs::current_path(llvm::SmallVectorImpl<char>&):48)
clang::CodeGen::CGDebugInfo::getCurrentDirname() (@clang::CodeGen::CGDebugInfo::getCurrentDirname():29)
clang::CodeGen::CGDebugInfo::CreateCompileUnit() (@clang::CodeGen::CGDebugInfo::CreateCompileUnit():125)
clang::CodeGen::CGDebugInfo::CGDebugInfo(clang::CodeGen::CodeGenModule&) (@clang::CodeGen::CGDebugInfo::CGDebugInfo(clang::CodeGen::CodeGenModule&):87)
clang::CodeGen::CodeGenModule::CodeGenModule(clang::ASTContext&, clang::HeaderSearchOptions const&, clang::PreprocessorOptions const&, clang::CodeGenOptions const&, llvm::Module&, llvm::DataLayout const&, clang::DiagnosticsEngine&, clang::CoverageSourceInfo*) (@clang::CodeGen::CodeGenModule::CodeGenModule(clang::ASTContext&, clang::HeaderSearchOptions const&, clang::PreprocessorOptions const&, clang::CodeGenOptions const&, llvm::Module&, llvm::DataLayout const&, clang::DiagnosticsEngine&, clang::CoverageSourceInfo*):305)
(anonymous namespace)::CodeGeneratorImpl::Initialize(clang::ASTContext&) (@(anonymous namespace)::CodeGeneratorImpl::Initialize(clang::ASTContext&):60)
clang::BackendConsumer::Initialize(clang::ASTContext&) (@clang::BackendConsumer::Initialize(clang::ASTContext&):24)
clang::Sema::Initialize() (@clang::Sema::Initialize():13)
clang::Parser::Initialize() (@clang::Parser::Initialize():66)
clang::ParseAST(clang::Sema&, bool, bool) (@clang::ParseAST(clang::Sema&, bool, bool):56)
clang::FrontendAction::Execute() (@clang::FrontendAction::Execute():22)
DxcCompiler::Compile(DxcBuffer const*, wchar_t const**, unsigned int, IDxcIncludeHandler*, _GUID const&, void**) (@DxcCompiler::Compile(DxcBuffer const*, wchar_t const**, unsigned int, IDxcIncludeHandler*, _GUID const&, void**):2882)
hlsl::DxcCompilerAdapter::WrapCompile(bool, IDxcBlob*, wchar_t const*, wchar_t const*, wchar_t const*, wchar_t const**, unsigned int, DxcDefine const*, unsigned int, IDxcIncludeHandler*, IDxcOperationResult**, wchar_t**, IDxcBlob**) (@hlsl::DxcCompilerAdapter::WrapCompile(bool, IDxcBlob*, wchar_t const*, wchar_t const*, wchar_t const*, wchar_t const**, unsigned int, DxcDefine const*, unsigned int, IDxcIncludeHandler*, IDxcOperationResult**, wchar_t**, IDxcBlob**):288)

Related: Traverse-Research/hassle-rs#27

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 a pull request may close this issue.

1 participant