Darwin Build Environment Help Center

Builder gets stuck when exporting UnityFramework Swift module

append delete daki

• Windows version: Windows 11 Home
• Builder version (from the builder UI title bar): Builder v3.79
• SDK version (from the builder UI title bar): iOS 26.0 sdk

Log:
https://pmbaty.com/paste/?6e562bc7024dd624#7cs5Egfvw5LqprqQEGH9Ye1RX55YxqsBQUhFjPyb2JZb

I'm struggling with an issue that my builder gets stuck when it faces ' + Exporting UnityFramework Swift module...'.
I've run it and went to sleep, but when I'm back(passed almost 12 hours), it's still on this status.
I tried 'Try to fix unresolved symbols automatically' even if I know that it is not involved in this matter, and didn't work as well.

I updated the builder 2 days ago, then this issue is made. It successfully worked before I updated it.
I don't remember what's the exact version of previous one was... I installed that on July.

Reply RSS

Replies

append delete #1. daki

Actually I tried not one but more times. It is certain that it stops(or something) at that period.

append delete #2. Pierre-Marie Baty

Hello

This situation happens around line 3829 of the master build script (the "build.cmd" file in the builder's install directory). I suspect the "xcopy" command to fail.

Let's try this: open the "build.cmd" file with your favourite text editor, go to line 3825 and replace this block:

% build.cmd lines 3825-3830
		rem // copy the Swift module files in the framework's Modules subdirectory if we have one
		call :test_if_dir "!TARGET_BUILD_DIR!\!PRODUCT_NAME!.swiftmodule" && (
			echo  + Exporting !PRODUCT_NAME! Swift module...
			mkdir "!OUTDIR!\Modules" > nul 2>&1
			xcopy "!TARGET_BUILD_DIR!\!PRODUCT_NAME!.swiftmodule" "!OUTDIR!\Modules\!PRODUCT_NAME!.swiftmodule" /d /e /i /y > nul || ( set ERROR_TAG=20250925131400& goto :exit_error )
		)
%

with this one:

% build.cmd lines 3825-3830 (patched)
		rem // copy the Swift module files in the framework's Modules subdirectory if we have one
		call :test_if_dir "!TARGET_BUILD_DIR!\!PRODUCT_NAME!.swiftmodule" && (
			echo  + Exporting !PRODUCT_NAME! Swift module...
			mkdir "!OUTDIR!\Modules" > nul 2>&1
			mkdir "!OUTDIR!\Modules\!PRODUCT_NAME!.swiftmodule" > nul 2>&1
			copy /y /b "!TARGET_BUILD_DIR!\!PRODUCT_NAME!.swiftmodule\"*.* "!OUTDIR!\Modules\!PRODUCT_NAME!.swiftmodule\" > nul || ( set ERROR_TAG=20250925131400& goto :exit_error )
		)
%

Just copy/paste. Save and exit. Rebuild. Does it fix it?

append delete #3. daki

It's still stuck on the same period.
How much time is it supposed to take? I've waited almost 30 minutes this time.

append delete #4. Pierre-Marie Baty

It should be immediate. There is clearly something wrong here.

Would you mind sending me this Xcode project so I can reproduce the problem ? Send it to pm at this domain. Delete the "build" and "Pods" directories to save space in the zip.

Alternatively, if you feel confident enough, you try inserting blocks of

% build.cmd
			echo Reached line XXX
			pause
%

statements (with X equal to the line number in the script where you're pasting these blocks), so that when the build script executes near these lines, you can follow its path down to the line that blocks exactly. When you've reached it, see if it has "null redirections" (" > nul" and/or "> nul 2>&1"); these hide the output of the command that's being run. Remove these redirections (simply remove the "> nul" string bit) and let the script run again: hopefully the failing command will display something.

Let me know

append delete #5. daki

You inspired me a lot! I really appreciate you. Thank you.

I put some log on Swift Module exporting part, and I realized that it's not the problem.
After exporting swift module successfully,
' {some code} > "!OUTDIR!\module.modulemap" '
I guessed this part made the issue.

So I fixed it as:
https://pmbaty.com/paste/?2b132d230aa08434#5tDwUGQVJQSCqtA8PmW2rjnCYCiPb1hbg4GrDmtAnkmk

Then it passed the problematic part, and it seems like it solved.
But new problem has arisen.
https://pmbaty.com/paste/?f479178eb29629c4#2QKgojhACLHCfpkcZYVvjJ2WyDYZLtQGdG3qPbN9ZthV

I'm afraid that my solution may made the process wrong.
If it's not, could you led me how can I solve this?

p.s.
If I don't clear the cache(project dir/build/), then I try to build, it stops very early:
' + Generating module map for mixed-language target using supplied umbrella header: headers-public/UnityFramework/UnityFramework.h '
almost in the opening part.
Is this associated with the problem I wrote above? Or because of it wasn't just built completely?

Thanks for helping me. It's sincere.

append delete #6. Pierre-Marie Baty

So the problem is the "dash -c" call not returning. That's a bug I must fix, but I must understand *why* it behaves this way.

By disabling module map generation like you did in your changes (commenting out the lines that look for umbrella header files) you won't be able to build mixed-source (Swift+ObjC) projects, and many of them are nowadays. So your fix didn't really fix things, but congratulations for the attempt at debugging it on your side.

Yes, both problems are linked. There is definitely *something* in your Xcode project that makes the build script derail, and I'd love to be able to reproduce that in vitro to understand the cause of the problem and fix it properly. Can't you really send me that Xcode project ? Confidentiality is guaranteed (I can sign a NDA if necessary). Not being able to reproduce the problem makes the whole process a lot harder.

If you prefer to continue debugging it on your side, you may attempt a fresh build (all caches cleared) in verbose mode, by holding the Shift key when you click the Build button. This will display a lot more info, including the command interpreter's environment variables at each relevant step of the build. I suspect one of them might contain something that isn't well digested by the build script. Also, when debugging something, it is essential that you stay focused on the first error that shows up (warnings excluded), because errors usually cascade and it's no point wasting time trying to "fix" the final error when it's being caused by an earlier one.

append delete #7. daki

I just sent mail, but I've forgotten to post comment here.

I worried that this could be annoying to you, so I tried everything I can do.
Your comment was critical, and I re-installed the builder to initialize it again.

Thanks for your excuse.

append delete #8. Pierre-Marie Baty

Thank you for having sent me the project.

I am surprised - I could build your project successfully, the error doesn't show up.

I just made one observation though: you don't use CocoaPods (I see you renamed the Podfile in Podfile.bak), so while adding the Firebase frameworks by hand, you must also add the -ObjC linker flag as per Google's instructions. You also need to copy the frameworks yourself in the compiled app using a pre-packaging script (i.e. copy the necessary Firebase *.framework directories in build\Release-iphoneos\Unity-iPhone\TacTiles.app\Frameworks).

But this does not explain the error you're having, because your error occurs before that step.

I suspect something in your command line environment variables that's not digested by the build script. It might be something related to your computer's locale (language settings).

The build script expects path separators to be the '\' character, but in some countries I have been told that another character is used as path separator. This might be the problem.

As it turns out I cannot reproduce that on my computer, I will need your help to debug it.

Please do a full rebuild in *verbose mode* (hold down the Shift key when you click Build), then send me the resulting log file. If you're concerned about privacy (the information displayed may contain your private key passphrase), you may send me the build.log file by email instead of posting it on the forum.

append delete #9. daki

Understood! I built in verbose mode, and this is the log(SUPER long).
https://pmbaty.com/paste/?9e31a3389b454ebf#4pewYjDTK1xDsUCtCneCbKuq8nLmrJqXD3KbLezjgvV1

+
I've been put these on the 'flags'.
https://pmbaty.com/paste/?45929d46b12056f6#6Yzm9M4Uwm895ywQgEyxWCcHetejmzM9kukjrmXumKbz
It worked well on the previous version, but it might causes error now. Could you check this please?

append delete #10. Pierre-Marie Baty

These flags are good.

But the log you posted isn't the full log. It's as if you copy/pasted the contents of the window. The full build log is much longer, it's stored in the "build.log" file at the root of the Xcode project. When you build in verbose mode, in that file there will be a dump of your environment settings, and that's what I'm interested in seeing.

append delete #11. daki

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Moderators: Pierre-Marie Baty