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

[SR-3374] swift build fails due to path name #795

Open
swift-ci opened this issue Dec 8, 2016 · 3 comments
Open

[SR-3374] swift build fails due to path name #795

swift-ci opened this issue Dec 8, 2016 · 3 comments

Comments

@swift-ci
Copy link

swift-ci commented Dec 8, 2016

Previous ID SR-3374
Radar None
Original Reporter --marc (JIRA User)
Type Bug
Environment

macOS 10.11.6

terminal shell: /bin/zsh

Apple Swift version 3.0.2 (swiftlang-800.0.61 clang-800.0.42.1)
Target: x86_64-apple-macosx10.9

Apple Swift Package Manager - Swift 3.0.2 (swiftpm-11750)

Additional Detail from JIRA
Votes 0
Component/s llbuild
Labels Bug
Assignee None
Priority Medium

md5: 182b030cfd483551acc4eff9abb03d93

Issue Description:

swift build fails due to path name. Discovered when following the Swift Getting Started Using the Package Manager.

Example parent folder name which causes swift build fail: 4`2/`6=Test Case

TEST CASE

Uses /bin/zsh shell

# create parent folder which will cause a build fail
export UNICODE1=`echo '\x60'`
cd ~/Desktop
mkdir 4${UNICODE1}2:${UNICODE1}6=Test\ Case
cd 4\`2:\`6=Test\ Case/
# follow Getting Started steps 
mkdir Hello
cd Hello
swift package init
swift build

RESULTING ERROR

Compile Swift Module 'Hello' (1 sources)
<unknown>:0: error: error reading dependency file: '/Users/me/Desktop/4`2:`6=Test Case/Hello/.build/debug/Hello.build/Hello.d' (missing ':' following rule)
<unknown>:0: error: error reading dependency file: '/Users/me/Desktop/4`2:`6=Test Case/Hello/.build/debug/Hello.build/Hello.d' (missing ':' following rule)
<unknown>:0: error: error reading dependency file: '/Users/me/Desktop/4`2:`6=Test Case/Hello/.build/debug/Hello.build/Hello.d' (missing ':' following rule)
<unknown>:0: error: build had 1 command failures
error: exit(1): /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/me/Desktop/4`2:`6=Test\ Case/Hello/.build/debug.yaml
@ankitspd
Copy link
Member

hah fun, this might be an issue in llbuild, need to investigate

@ankitspd
Copy link
Member

if there is a directory named = swift creates a dependency file:

/private/tmp/Hello/=/.build/debug/_.build/main.swift.o : /private/tmp/Hello/=/Sources/main.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule
/private/tmp/Hello/=/.build/debug/_.build/main~partial.swiftmodule : /private/tmp/Hello/=/Sources/main.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule
/private/tmp/Hello/=/.build/debug/_.build/main~partial.swiftdoc : /private/tmp/Hello/=/Sources/main.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule

But the llbuild makedeps parser considers = invalid word char:
https://github.com/apple/swift-llbuild/blob/master/lib/Core/MakefileDepsParser.cpp#L34

@ddunbar suggestions?

@ddunbar
Copy link
Member

ddunbar commented Dec 20, 2016

This may not be solvable without changing the compiler, I don't know if the makefile can actually represent this (IIRC, there are some "unrepresentable" characters).

The right thing to do here is move to a "real" format for communicating dependencies between the compiler and the build system.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants