Navigation Menu

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-1468] SwiftPM not building path with spaces after file changes #801

Closed
Bouke opened this issue May 10, 2016 · 13 comments
Closed

[SR-1468] SwiftPM not building path with spaces after file changes #801

Bouke opened this issue May 10, 2016 · 13 comments
Assignees

Comments

@Bouke
Copy link

Bouke commented May 10, 2016

Previous ID SR-1468
Radar None
Original Reporter @Bouke
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s llbuild
Labels Bug
Assignee @Bouke
Priority Medium

md5: db2a6bb7da3124dae779be30458770d2

is duplicated by:

  • SR-1467 SwiftPM not building on iCloud Drive after file changes

Issue Description:

➜  ~ mkdir "my swift projects"
➜  ~ cd my\ swift\ projectsmy swift projects mkdir myprojectmy swift projects cd myprojectmyproject swift build --init
Creating executable package: myproject
Creating Package.swift
Creating .gitignore
Creating Sources/
Creating Sources/main.swift
Creating Tests/
➜  myproject swift build
Compile Swift Module 'myproject' (1 sources)
Linking .build/debug/myprojectmyproject touch Sources/main.swiftmyproject swift buildmyproject 

(note: no build)

Expected:

➜  ~ cd DeveloperDeveloper mkdir myprojectDeveloper cd myprojectmyproject swift build --init
Creating executable package: myproject
Creating Package.swift
Creating .gitignore
Creating Sources/
Creating Sources/main.swift
Creating Tests/
➜  myproject swift build
Compile Swift Module 'myproject' (1 sources)
Linking .build/debug/myprojectmyproject touch Sources/main.swiftmyproject swift build
Compile Swift Module 'myproject' (1 sources)
Linking .build/debug/myprojectmyproject
@abertelrud
Copy link
Contributor

I've reproduced this using top-of-tree swiftpm. There doesn't appear to be anything wrong with how the llbuild YAML file is produced; indeed, it does work fine the first time. Visual inspection of the .yaml also shows that it's correct.

Using dtruss on swift-build-tool, however, shows this, among other things:

 2906/0x2ab3b:  stat64("/private/tmp/2/my\\ swift\\ projects/myproject/Sources/main.swift\0", 0x7FFF514D3F68, 0x7FFF514D3B34)        = -1 Err#2

So there seems to be incorrect escaping going on inside of swift-build-tool.

@abertelrud
Copy link
Contributor

The unit tests don't catch this because this only shows up when it's comparing the touched source file with what's in the database, and it seems that the unit tests only verify that building from clean works. We should add unit tests for iterative builds too.

@abertelrud
Copy link
Contributor

Sending to llbuild.

@abertelrud
Copy link
Contributor

@aciidb0mb3r

@ankitspd
Copy link
Member

I did some investigation and it looks like the dependency parser is returning escaped paths for eg:

("/Users/aciid/mycode/my\\ swift\\ project/myproj/Sources/main.swift") 

which is being stored in the db.

What is the correct way to solve this? Should the parser return unescaped strings or Buildsystem should remove the escape char?

@ddunbar
Copy link
Member

ddunbar commented May 14, 2016

The parser for deps is supposed to handle this, it should return in in escaped strings. I could have sworn we had implementation and test cases for this. 🙁

@abertelrud
Copy link
Contributor

Ankit: Since quotes and escapes are an artifact of the text-based file format, the parser should be interpreting them and returning unescaped strings.

@ankitspd
Copy link
Member

PR #30

@abertelrud
Copy link
Contributor

Great, thanks for the fix, Ankit. I'm sending this to Daniel to merge since it's in llbuild.

@ddunbar
Copy link
Member

ddunbar commented Jul 29, 2016

Fixed in 26206ba

@abertelrud
Copy link
Contributor

Yay

@ddunbar
Copy link
Member

ddunbar commented Jul 29, 2016

Actually, that just fixes the makefile deps parsing issue... it doesn't look like that completely resolves this so I need to investigate further.

@ddunbar
Copy link
Member

ddunbar commented Jul 29, 2016

Never mind, it does resolve it, I just forgot my local toolchain doesn't automatically pick up my llbuild rebuilds.

@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
This issue was closed.
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

4 participants