Skip to content

Conversation

plemarquand
Copy link
Contributor

The target file that could not be found was printing Path(_str: "libclang.so") instead of libclang.so.

Add the .str to the Path so just the filename is printed.

The target file that could not be found was printing
`Path(_str: "libclang.so")` instead of `libclang.so`.

Add the `.str` to the `Path` so just the filename is printed.
case let .unableToFind(subject, operatingSystem, searchPaths):
let candidates = searchPaths.flatMap { $0.paths.map { $0.join(subject.fileName(operatingSystem: operatingSystem)).str }}
return "unable to find \(subject.fileName(operatingSystem: operatingSystem)) among search paths: \(candidates.joined(separator: ", "))"
return "unable to find \(subject.fileName(operatingSystem: operatingSystem).str) among search paths: \(candidates.joined(separator: ", "))"
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: could we add a small test to ensure we don't regress here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know if it's worth it because the string form of error messages is not considered stable -- if we changed it again we'd just change the test here too and break downstream anyways.

@owenv
Copy link
Collaborator

owenv commented Sep 5, 2025

@swift-ci test

case let .unableToFind(subject, operatingSystem, searchPaths):
let candidates = searchPaths.flatMap { $0.paths.map { $0.join(subject.fileName(operatingSystem: operatingSystem)).str }}
return "unable to find \(subject.fileName(operatingSystem: operatingSystem)) among search paths: \(candidates.joined(separator: ", "))"
return "unable to find \(subject.fileName(operatingSystem: operatingSystem).str) among search paths: \(candidates.joined(separator: ", "))"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know if it's worth it because the string form of error messages is not considered stable -- if we changed it again we'd just change the test here too and break downstream anyways.

@plemarquand plemarquand merged commit 94711fa into swiftlang:main Sep 5, 2025
37 checks passed
@plemarquand plemarquand deleted the fixup-stacked-search-paths-lookup-error-message branch September 5, 2025 16:54
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.

4 participants