Closed aakarsh-sasi closed 2 years ago
Hi, I'll look at that for you. seems like any parent directory of the project with an @ in the name could be causing the problem.
Yes that or the ".". Any workaround apart from creating new account?
I'll look at it in the next couple of days as it doesn't seem to be an easy fix for various reasons. There should be a new release coming up with new functionality soon.
It may be while before I make this new release, so if you're in a hurry, you can clone the project (with --recurse-submodules and change file InjectionIII/HotReloading/Sources/HotReloading/SwiftEval.swift, line 639 to:
elsif ($line =~ m{\#(regexp.escaping("\"$"))}oi and $line =~ " \#(arch)"\#(swiftpm)) {
Build the project and create a symbolic link from /Applications/InjectionIII.app to the Xcode built version.
Thanks a lot @johnno1962. We are using a script to download your latest release from GitHub releases and install it. It will get updated whenever you create the next release!
Will close the issue when release is available Does that work?
Sure, that's fine. I've released something new to the related HotReloading project and roll a new version of the app tomorrow.
I've published the binary release ahead of time: https://github.com/johnno1962/InjectionIII/releases/tag/4.0.0RC1
Let me know if this doesn't fix the issue!
Will update you on Monday!
Hey, sorry for the delay @johnno1962 . So I checked it today using version 4.1.3 but it still fails with the same error. Tried clean build and rebuild. (Didn't try clearing derived data)
:syringe: :warning: Could not locate compile command for /Users/xyz@gmail.com/Desktop/MyProj/ViewController.swift
This could be due to one of the following:
1. Injection does not work with Whole Module Optimization.
2. There are restrictions on characters allowed in paths.
3. File paths in the simulator are case sensitive.
Try a build clean then rebuild to make logs available or
consult: "/Users/xyz@gmail.com/Library/Developer/CoreSimulator/Devices/C7B1560A-76AF-4999-A5DE-20FB4C8FC241/data/Containers/Data/Application/05C9D81C-13F2-4B54-AAC9-E2345CF264D5/tmp/command.sh".
# search through build logs, most recent first
cd "/Users/xyz@gmail.com/Library/Developer/Xcode/DerivedData/MyProj-dqximnbwagqxsqeaiwkdmvtuwrhh/Logs/Build" &&
for log in `ls -t *.xcactivitylog`; do
#echo "Scanning $log"
/usr/bin/env perl "/Users/xyz@gmail.com/Library/Developer/CoreSimulator/Devices/C7B1560A-76AF-4999-A5DE-20FB4C8FC241/data/Containers/Data/Application/05C9D81C-13F2-4B54-AAC9-E2345CF264D5/tmp/eval101.pl" "$log" >"/Users/xyz@gmail.com/Library/Developer/CoreSimulator/Devices/C7B1560A-76AF-4999-A5DE-20FB4C8FC241/data/Containers/Data/Application/05C9D81C-13F2-4B54-AAC9-E2345CF264D5/tmp/eval101.sh" && exit 0
done
exit 1;
You may need to move the project out of the ~/Desktop folder as it has special permissions. The @ fix should be in the 4.1.3 version.
Hey, i have my project in Desktop and it seems to work for me. But not for the fellow dev who has email as username
Hi, What is the current error your colleague is getting? Are they using 4.1.3? Is their project in ~/Desktop?
Hey, sorry for the delay @johnno1962 . So I checked it today using version 4.1.3 but it still fails with the same error. Tried clean build and rebuild. (Didn't try clearing derived data)
:syringe: :warning: Could not locate compile command for /Users/xyz@gmail.com/Desktop/MyProj/ViewController.swift This could be due to one of the following: 1. Injection does not work with Whole Module Optimization. 2. There are restrictions on characters allowed in paths. 3. File paths in the simulator are case sensitive. Try a build clean then rebuild to make logs available or consult: "/Users/xyz@gmail.com/Library/Developer/CoreSimulator/Devices/C7B1560A-76AF-4999-A5DE-20FB4C8FC241/data/Containers/Data/Application/05C9D81C-13F2-4B54-AAC9-E2345CF264D5/tmp/command.sh".
@johnno1962 this is the error in 4.1.3 too, just that there are syring and warning emojis now 😄
Can you please tell him to move it out of the Desktop folder. This may work for you but can cause problems.
Sure, checking this. Which directory should the project be moved to so that this issue won't be in question?
Just not ~/Desktop or ~/Downloads as these directories have special significance for macOS in terms of permissions.
Hey, tried with 4.1.3 while having the project in Documents/. Still same error :/
Seems to work for non-email usernames in all the directories
Any directory other than ~/Downloads or ~/Desktop please. One problem at a time. With regards to the @ in the home directory problem can you $ bash ... run the script it mentions from the command line and you should see what the error is in the file it redirects the output to or the console. If you could let me know what the error is in that file it would be a great help.
OK, I've reviewed the code and found a second place that needs to be fixed specifically when @ is used in a home directory (I was unable to test this as macOS doesn't even seem to allow this as you create an account.) Please try out this release https://github.com/johnno1962/InjectionIII/releases/tag/4.1.4 and let me know if it fixes the problem.
Hey, sorry couldn’t reply sooner. Will test and get back to you asap
Hey, still didn't work. Tried different directories including Documents Desktop and Downloads but no luck. Here is what is available on opening command.sh
# search through build logs, most recent first
cd "/Users/xyz@gmail.com/Library/Developer/Xcode/DerivedData/Zomato-dqximnbwagqxsqeaiwkdmvtuwrhh/Logs/Build" &&
for log in `ls -t *.xcactivitylog`; do
#echo "Scanning $log"
/usr/bin/env perl "/Users/xyz@gmail.com//Library/Developer/CoreSimulator/Devices/C7B1560A-76AF-4999-A5DE-20FB4C8FC241/data/Containers/Data/Application/2C2EED94-A256-4EBD-BD64-A3AC25C859D0/tmp/eval101.pl" "$log" >"/Users/xyz@gmail.com//Library/Developer/CoreSimulator/Devices/C7B1560A-76AF-4999-A5DE-20FB4C8FC241/data/Containers/Data/Application/2C2EED94-A256-4EBD-BD64-A3AC25C859D0/tmp/eval101.sh" && exit 0
done
exit 1;
😟 Can you run the command.sh from the command line and tell me the output please?
$ bash /Users/xyz@gmail.com/Library/.../tmp/command.sh
Or paste/send me the perl file it mentions in the script: /Users/xyz@gmail.com//Library/Developer/CoreSimulator/Devices/C7B1560A-76AF-4999-A5DE-20FB4C8FC241/data/Containers/Data/Application/2C2EED94-A256-4EBD-BD64-A3AC25C859D0/tmp/eval101.pl
OK, another release https://github.com/johnno1962/InjectionIII/releases/tag/4.1.6. If you could give it a try perhaps we can get sort this out. The problem is InjectionIII uses perl to "grep" the build logs to find the command to recompile a file and @ is a special character like $ or \ It's been very tricky to get the escaping just right for this to work. If it doesn't work please run the command.sh file it mentions and send me the output (not the file itself) or send me the .pl perl script it mentions so I can see what there errors is. Cheers.
Worked in 4.1.6 😄 🎉
What did we change exactly?
Hooray! It was a minor change in the end though there was another change required that sabotaged the original fix specific to home directories. Sorry it took two months to get there! https://github.com/johnno1962/HotReloading/blob/main/Sources/HotReloading/SwiftEval.swift#L649
Hi @johnno1962,
Few of my fellow devs started facing this issue on a project we are working on. On debugging we found that it happens when your username is an email i.e has a special character. The error message in the debugger was helpful is finding this out! Just wanted to know why does injector fail in this case and if we can do something to solve it?