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

All Swift files, despite not being any relation between them, get compiled again in an app project when only one was modified #662

Open
Luki120 opened this issue Aug 31, 2022 · 3 comments

Comments

@Luki120
Copy link

Luki120 commented Aug 31, 2022

What are the steps to reproduce this issue?

  1. Make new project
  2. Add a few Swift files
  3. Compile
  4. Modify only one
  5. Compile again

What happens?

  • All files get compiled again

What were you expecting to happen?

  • For the files that haven't been modified to get cached, like it happens when writing Objective-C

Paste any relevant logs, error output, etc.

Additional context

What OS are you seeing the problem on?

Linux/WSL

What OS version does it have installed?

Kubuntu 21.04

What toolchain and version are you using?

Kabir's Swift 5.6.1 toolchain

Which SDK version are you using?

iOS 15.5

What OS is your client device running?

iOS

What OS version does it have installed?

iOS 14.5.1

Which device model is it?

iPod Touch 7th generation

Which jailbreak is it using (if relevant)?

checkra1n

@kirb
Copy link
Member

kirb commented Oct 31, 2022

This is somewhat correct behavior, by changing one file you might be changing characteristics other files in the project depend on, e.g. function signature, the exact address to a function, etc. Swift is just going to be like this because of its lack of headers, and stronger leaning on static compile-time constants rather than runtime lookups as ObjC is. swiftc's makedeps output drives this. It's still possible that it could be somehow implemented wrong in Theos though.

@kabiroberai
Copy link
Member

Are you on the Orion branch? We pass all swift files to the compiler invocation like @kirb mentioned, but swiftc itself should skip files that have no changes/changed dependencies, and you shouldn't see the "Compiling Foo.swift" line in Theos' output

@Luki120
Copy link
Author

Luki120 commented Oct 31, 2022

Yeah, I'm on the Orion branch. Here's a live showcase of the behavior

@Luki120 Luki120 changed the title All Swift files get compiled again in an app project when only one was modified All Swift files, despite not being any relation between them, get compiled again in an app project when only one was modified Nov 20, 2022
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

No branches or pull requests

3 participants