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

Avoid ambiguity warning for bundled modules #25415

Merged
merged 6 commits into from
Jul 2, 2024

Conversation

mppf
Copy link
Member

@mppf mppf commented Jul 2, 2024

Follow-up to PR #25125.

Adjusts getExistingFileInModuleSearchPath to avoid issuing an ambiguity warning for CHPL_LOCALE_MODEL=gpu where it is intentional that

modules/internal/localeModels/gpu/ChapelGpuSupport.chpl

is used instead of the fallback

modules/internal/ChapelGpuSupport.chpl

It does that by fixing getExistingFileInModuleSearchPath to avoid the warning if both are bundled modules. However, for this to work in a straightforward manner, I needed also to improve some of the related code, which was not handling cases such as "." being a module search path (because it was using prefix checks rather than something file-path aware).

Reviewed by @dlongnecke-cray - thanks!

  • ambiguity warning no longer issued when compiling with CHPL_LOCALE_MODEL=gpu
  • full comm=none testing

mppf added 6 commits July 2, 2024 09:29
Adjusts getExistingFileInModuleSearchPath to avoid issuing an ambiguity
warning for CHPL_LOCALE_MODEL=gpu where it is intentional that

  modules/internal/localeModels/gpu/ChapelGpuSupport.chpl

is used instead of the fallback
  modules/internal/ChapelGpuSupport.chpl

---
Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
---
Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
---
Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
---
Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
---
Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
---
Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
Copy link
Contributor

@dlongnecke-cray dlongnecke-cray left a comment

Choose a reason for hiding this comment

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

LGTM

dirPath.push_back('/');

// now, check that 'dirPath' is a prefix or equal to 'path'
return dirPath.size() <= path.size() &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use llvm::sys::path::starts_with?

Copy link
Member Author

Choose a reason for hiding this comment

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

It'd be nice to add a TODO comment but I am short on time at the moment and so I'm going to merge this without it.

@mppf mppf merged commit 96ee9b5 into chapel-lang:main Jul 2, 2024
7 checks passed
@mppf mppf deleted the follow-25125-gpu branch July 2, 2024 19:03
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