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

Fix libc++.modules.json finding #4695

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

Arthapz
Copy link
Member

@Arthapz Arthapz commented Feb 4, 2024

when libc++.modules.json is in subdir of lib folder, it fail to find it (for example on debian platform)

@Arthapz Arthapz changed the base branch from master to modules February 4, 2024 18:15
@@ -209,7 +209,7 @@ function get_stdmodules(target)
-- @see https://github.com/llvm/llvm-project/pull/76451 (has been revert, so we need to wait)
local clang_path = path.directory(get_clang_path(target))
local clang_lib_path = path.join(clang_path, "..", "lib")
local modules_json_path = find_file("libc++.modules.json", clang_lib_path)
local modules_json_path = find_file("**.modules.json", clang_lib_path)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use -print-library-module-manifest-path?

def print_std_module_manifest_path : Flag<["-", "--"], "print-library-module-manifest-path">,
  HelpText<"Print the path for the C++ Standard library module manifest">,
  Visibility<[ClangOption, CLOption]>;

https://github.com/llvm/llvm-project/pull/76451/files

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it might also be modules-asan.json

    // For example
    //  StringRef modules = [&] {
    //    const SanitizerArgs &Sanitize = TC.getSanitizerArgs(C.getArgs());
    //    if (Sanitize.needsAsanRt())
    //      return "modules-asan.json";
    //    return "modules.json";
    //  }();

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use -print-library-module-manifest-path?

def print_std_module_manifest_path : Flag<["-", "--"], "print-library-module-manifest-path">,
  HelpText<"Print the path for the C++ Standard library module manifest">,
  Visibility<[ClangOption, CLOption]>;

https://github.com/llvm/llvm-project/pull/76451/files

it has been reverted, i plan to support it when it's re-merged
llvm/llvm-project@82f424f

@waruqi waruqi merged commit 05b80a3 into xmake-io:modules Feb 5, 2024
19 checks passed
@waruqi
Copy link
Member

waruqi commented Feb 5, 2024

ok

@Arthapz Arthapz deleted the fix-libc++.modules.json-finding branch February 5, 2024 18:30
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.

2 participants