-
-
Notifications
You must be signed in to change notification settings - Fork 524
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
TargetScript output files are ignored if the files don't exist at generate time #5925
Comments
/bounty 100 |
💎 $100 bounty • TuistSteps to solve:
Thank you for contributing to tuist/tuist! Add a bounty • Share on socials
|
@fortmarek can i get this assigned? |
seems like this would need a more deep dive in the codebase than i expected, unassigning myself as of now. |
Hello 👋 I did some debugging and this is where we're loosing My first idea to fix that, was to take all targets scripts in /attempt #5925 Options |
What happened?
If a
TargetScript
specifies an output file it is not added to the script's output files in the generated project unless it already exists at the timetuist generate
is run. Similarly, a file that does not exist at generate time is not added to theCompile Sources
phase.My use case here is that I have a target script that runs on build, specifying its output file. The file is added to the
Compile Sources
phase, and all is well: the script generates the file, so it exists by the time sources are compiled. With Tuist, this is not possible. In my own project I have hacked around it by usingFileManager
to create the file prior to returning the script, but that is super fragile and can break due to project caching.A
TargetScript
requiring output files to exist to be included is definitely a bug, and in Tuist 4 is even more of a bug as files that exist are not included in output files for some reason.For the
Compile Sources
part, I believe Tuist should, or should have the option to, include files inCompile Sources
that do not exist, as it is perfectly reasonable for a script to generate those missing files.Sample projects:
tuist3.zip
tuist4.zip
How do we reproduce it?
Tuist 3
tuist generate
on the attached sampletuist3.zip
TuistScriptOutputFiles
target, and expand theTouch File.swift for TuistScriptOutputFiles
phase under Build PhasesOutput Files
is emptyCompile Sources
under Build PhasesFile.swift
is not includedtuist generate
againOutput Files
is no longer emptyFile.swift
is now included inCompile Sources
phaseTuist 4
tuist generate
on the attached sampletuist4.zip
TuistScriptOutputFiles
target, and expand theTouch File.swift for TuistScriptOutputFiles
phase under Build PhasesOutput Files
is emptyCompile Sources
under Build PhasesFile.swift
is not includedtuist generate
againOutput Files
is still emptyFile.swift
is now included inCompile Sources
phaseError log
No errors
macOS version
14.3.1
Tuist version
3.42.3, 4.1.2
Xcode version
15.2
The text was updated successfully, but these errors were encountered: