Do not lookup files from args in search paths#1058
Merged
Conversation
davidlattimore
approved these changes
Aug 20, 2025
| File(Box<Path>), | ||
| Lib(Box<str>), | ||
| /// Name of the library and whether it already has suffix and prefix. | ||
| Lib(Box<str>, bool), |
Member
There was a problem hiding this comment.
I wonder how it might look if instead of adding a bool to this variant, we had a separate variant. e.g. Search(Box<str>) which indicates to search for a file with the indicated name.
Fixes a regression from wild-linker#610 that manifests in cups source code. Minimised reproducer: ```sh $ mkdir bad_foo $ touch bad_foo/foo.o $ echo 'int main() { return 0; }' > main.c $ gcc -c main.c -o foo.o ❯ gcc -B ~/Projects/wild/fakes-debug/ -pie foo.o -Lbad_foo/ wild: error: Undefined symbol main, referenced by /usr/lib/gcc/x86_64-pc-linux-gnu/15.2.1/../../../../lib/Scrt1.o collect2: error: ld returned 255 exit status ``` The problem was due to `bad_foo/foo.o` being preferred over `./foo.o`.
bfdf0db to
9a5c120
Compare
davidlattimore
approved these changes
Aug 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a regression from #610 that manifests in cups source code.
Minimised reproducer:
The problem was due to
bad_foo/foo.obeing preferred over./foo.o.Created on top of #1057