Describe the bug
I have two directory structures that are, essentially, mirrors of one another. A recursive diff ran on both directories identifies no differences, except a few files that tuist generate
created when it was run successfully in the one directory. Since it would not run successfully in the other, the files do not exist there.
I described the problem originally in this post.
To Reproduce
The best I can offer, so far, is to have these two directory trees that I cannot share due to them being large and containing confidential files. I'll see if I can boil it down to its essence later.
cd dirA; tuist clean; tuist generate
and see it workcd dirB; tuist clean; tuist generate
and see it failThe error itself is a swift compiler generated error without any further context from tuist. It would be helpful if tuist would output the command and reason for it when it sees such a failure.
Here is what it looks like:
% tuist generate --verbose
Checking if /Users/test/.tuist exists... true
Checking if /Users/test/.tuist/Versions exists... true
Checking if /Users/test/.tuist/Cache exists... true
Checking if /Users/test/Documents/Failing/Projects/Project1/Project.swift exists... true
Checking if /Users/test/Documents/Failing/Projects/Project1/Workspace.swift exists... false
Checking if /Users/test/Documents/Failing/Projects/Project1/Config.swift exists... false
Checking if /Users/test/Documents/Failing/Projects/Project1/Setup.swift exists... false
Checking if /Users/test/Documents/Failing/Projects/Project1/Template.swift exists... false
Checking if /Users/test/Documents/Failing/Projects/Project1/Galaxy.swift exists... false
Checking if /Users/test/Documents/Failing/Projects/Project1/Project.swift exists... true
Checking if /Users/test/Documents/Failing/Projects/Project1/Tuist exists... false
Checking if /Users/test/Documents/Failing/Projects/Project1/Tuist/ProjectDescriptionHelpers exists... false
Checking if /Users/test/.tuist/Cache/Manifests/1.29f6c14d6a5476fcf021f7e37203fd78 exists... false
Checking if /Users/test/Documents/Failing/Projects/Project1/Project.swift exists... true
Checking if /Users/test/.tuist/Versions/1.12.2/ProjectDescription.framework exists... false
Checking if /Users/test/.tuist/Versions/1.12.2/libProjectDescription.dylib exists... true
Checking if /Users/test/Documents/Failing/Projects/Project1/Project.swift/Tuist exists... false
Checking if /Users/test/Documents/Failing/Projects/Project1/Tuist exists... false
Checking if /Users/test/Documents/Failing/Projects/Project1/Tuist/ProjectDescriptionHelpers exists... false
The 'swiftc' command exited with error code 1 and message:
/Users/test/Documents/Failing/Projects/Project1/Project.swift:2:8: error: no such module 'ProjectDescriptionHelpers'
import ProjectDescriptionHelpers
^
In the successful case the same segment looks like this:
% tuist generate --verbose
Checking if /Users/test/.tuist exists... true
Checking if /Users/test/.tuist/Versions exists... true
Checking if /Users/test/.tuist/Cache exists... true
Checking if /Users/test/Documents/Working/Projects/Project1/Project.swift exists... true
Checking if /Users/test/Documents/Working/Projects/Project1/Workspace.swift exists... false
Checking if /Users/test/Documents/Working/Projects/Project1/Config.swift exists... false
Checking if /Users/test/Documents/Working/Projects/Project1/Setup.swift exists... false
Checking if /Users/test/Documents/Working/Projects/Project1/Template.swift exists... false
Checking if /Users/test/Documents/Working/Projects/Project1/Galaxy.swift exists... false
Checking if /Users/test/Documents/Working/Projects/Project1/Project.swift exists... true
Checking if /Users/test/Documents/Working/Projects/Project1/Tuist exists... false
Checking if /Users/test/Documents/Working/Projects/Tuist exists... false
Checking if /Users/test/Documents/Working/Tuist exists... true
Checking if /Users/test/Documents/Working/Tuist/ProjectDescriptionHelpers exists... true
/usr/bin/xcrun swift --version
Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
Target: x86_64-apple-darwin19.5.0
Checking if /Users/test/.tuist/Cache/Manifests/1.7ffe209b25c44891cc42a0996d5e7219 exists... false
Checking if /Users/test/Documents/Working/Projects/Project1/Project.swift exists... true
Checking if /Users/test/.tuist/Versions/1.12.2/ProjectDescription.framework exists... false
Checking if /Users/test/.tuist/Versions/1.12.2/libProjectDescription.dylib exists... true
Checking if /Users/test/Documents/Working/Projects/Project1/Project.swift/Tuist exists... false
Checking if /Users/test/Documents/Working/Projects/Project1/Tuist exists... false
Checking if /Users/test/Documents/Working/Projects/Tuist exists... false
Checking if /Users/test/Documents/Working/Tuist exists... true
Checking if /Users/test/Documents/Working/Tuist/ProjectDescriptionHelpers exists... true
/usr/bin/xcrun swift --version
Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
Target: x86_64-apple-darwin19.5.0
It seems relevant that the process of looking upwards in the directory tree fails to proceed up in the failing case, but succeeds in the other case.
Expected behavior
tuist generate
should work and behave identically in identical trees.
Directory Structure
The identical directory structure, in both cases:
.
βββ Projects
β βββ Project1
β βββ Derived
β βββ Headers
β βββ Project.swift
β βββ Sources
β βββ UnitTests
βββ Setup.swift
βββ Tuist
β βββ Config.swift
β βββ ProjectDescriptionHelpers
β β βββ Project+Templates.swift
β βββ Templates
β βββ framework
β βββ Template.swift
β βββ project.stencil
βββ Workspace.swift
System Info:
Additional context
While the diff shows virtually no differences, and certainly not any that seem relevant, there are some differences in the trees. I suspected a file permission problem or something similar and inspected with ls -l@
and discovered some cases where a file had some xattrs
in one tree, but not in another. All these cases seem harmless apple originated metadata.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too