Skip to content

Fix ld warning #1139

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

Merged
merged 1 commit into from
Jul 31, 2017
Merged

Fix ld warning #1139

merged 1 commit into from
Jul 31, 2017

Conversation

ianpartridge
Copy link
Contributor

When building the TestFoundation target in Xcode 9 beta 4, ld reports the following warning:

Ld /Users/ipartrid/Library/Developer/Xcode/DerivedData/Foundation-dlbuoxyagtlausbjtyopapynebeb/Build/Products/Debug/TestFoundation.app/Contents/MacOS/TestFoundation normal x86_64
    cd /Users/ipartrid/swift-corelibs-foundation
    export MACOSX_DEPLOYMENT_TARGET=10.11
    /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -L/Users/ipartrid/Library/Developer/Xcode/DerivedData/Foundation-dlbuoxyagtlausbjtyopapynebeb/Build/Products/Debug -F/Users/ipartrid/Library/Developer/Xcode/DerivedData/Foundation-dlbuoxyagtlausbjtyopapynebeb/Build/Products/Debug -F../swift-corelibs-xctest/build/Debug -filelist /Users/ipartrid/Library/Developer/Xcode/DerivedData/Foundation-dlbuoxyagtlausbjtyopapynebeb/Build/Intermediates.noindex/Foundation.build/Debug/TestFoundation.build/Objects-normal/x86_64/TestFoundation.LinkFileList -Xlinker -rpath -Xlinker @executable_path/../Frameworks -Xlinker -rpath -Xlinker @loader_path/../Frameworks -mmacosx-version-min=10.11 -Xlinker -object_path_lto -Xlinker /Users/ipartrid/Library/Developer/Xcode/DerivedData/Foundation-dlbuoxyagtlausbjtyopapynebeb/Build/Intermediates.noindex/Foundation.build/Debug/TestFoundation.build/Objects-normal/x86_64/TestFoundation_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc-link-runtime -L/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -Xlinker -add_ast_path -Xlinker /Users/ipartrid/Library/Developer/Xcode/DerivedData/Foundation-dlbuoxyagtlausbjtyopapynebeb/Build/Intermediates.noindex/Foundation.build/Debug/TestFoundation.build/Objects-normal/x86_64/TestFoundation.swiftmodule -framework SwiftFoundation -Xlinker -dependency_info -Xlinker /Users/ipartrid/Library/Developer/Xcode/DerivedData/Foundation-dlbuoxyagtlausbjtyopapynebeb/Build/Intermediates.noindex/Foundation.build/Debug/TestFoundation.build/Objects-normal/x86_64/TestFoundation_dependency_info.dat -o /Users/ipartrid/Library/Developer/Xcode/DerivedData/Foundation-dlbuoxyagtlausbjtyopapynebeb/Build/Products/Debug/TestFoundation.app/Contents/MacOS/TestFoundation

ld: warning: directory not found for option '-F../swift-corelibs-xctest/build/Debug'

As far as I can tell, this directory is just not used by the build system and I'm not sure why it's been added to the Framework Search Paths for that target.

This PR removes the references, and hence the warning. Also minor whitespace fixes which Xcode did at the same time as removing the references.

@alblue
Copy link
Contributor

alblue commented Jul 28, 2017

Do you have swift-corelibs-xctest checked out and built in the relative path indicated? This is only a warning if such a directory doesn't exist. Having said that, it does look like that it's missing a . before the build.

I'm not sure if there are other reasons why it's there; perhaps it is an historical artefact of the way the project was set up in the first place? Or something to do with how it can be built from the command line with swift pm?

@ianpartridge
Copy link
Contributor Author

Yes, swift-corelibs-xctest is in the correct location (the build wouldn't run at all if it wasn't). build/ is an SPM thing, yes, but an SPM build can't be driven from Xcode yet, so this made no sense to me.

Hopefully @parkera or @phausler know what's going on and whether it's safe to just remove the references (so far, I can't see any problems with doing so).

@ianpartridge
Copy link
Contributor Author

Hmm looks like this was added in #1038 - @spevans?

@spevans
Copy link
Contributor

spevans commented Jul 28, 2017

I think this may be something leftover from Xcode8 as I have just tried your change with Xcode9 and the tests still build and run ok. Im sure there used to be a build directory but I don't see it anymore so Im fine with this change.

@ianpartridge
Copy link
Contributor Author

@swift-ci please test

@ianpartridge ianpartridge merged commit 11ecbaf into swiftlang:master Jul 31, 2017
@ianpartridge ianpartridge deleted the ld-warning branch July 31, 2017 10:45
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.

3 participants