Open PawelLipski opened 1 year ago
Originally posted as https://github.com/VirtusLab/git-machete-intellij-plugin/issues/1383
Actually, the problem seems to be just with launcher (see https://github.com/JetBrains/intellij-community/blob/master/native/MacLauncher/Launcher.m#L478), regardless of ide-probe context etc.:
$ /var/folders/mn/7g5_8tfj05bctk7ykhk1xxzr0000gn/T/ide-probe/instances/intellij-instance-2022.3--C0bJEHhYS2OF46vHTVPrng/Contents/MacOS/idea
2022-12-19 17:09:07.594 idea[65919:1702834] allVms required (null)
2022-12-19 17:09:07.599 idea[65919:1702834] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSTaggedPointerString rangeOfString:options:range:locale:]: nil argument'
*** First throw call stack:
(
0 CoreFoundation 0x00007ff817f0943b __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007ff817a58e25 objc_exception_throw + 48
2 Foundation 0x00007ff818c8ef45 -[NSString rangeOfString:options:range:locale:] + 580
3 Foundation 0x00007ff818c8ecf2 -[NSString rangeOfString:options:range:] + 29
4 Foundation 0x00007ff818cb694f -[NSString hasPrefix:] + 60
5 idea 0x00000001085ab85a validationJavaVersion + 3418
6 idea 0x00000001085a8e23 main + 99
7 dyld 0x00007ff817a85310 start + 2432
)
libc++abi: terminating with uncaught exception of type NSException
Abort trap: 6
Reposting from https://github.com/VirtusLab/git-machete-intellij-plugin/issues/1383#issuecomment-1359138760:
Okay, the workaround is as follows:
So force using the official resolver, and .dmg
extension.
Proper solution TBD, but according to @tpasternak, instead of using the launcher, ide-probe would need to run java
using options from product-info.json: both a list of jars, and command line options
Or, see what ide-launcher
from JetBrains does (it works on Mac): intellij-ui-test-robot -> README on ide-launcher => oh, it just downloads a dmg :trollface: intellij-ui-test-robot -> IdeDownloader.kt
But there's a ready implementation using product-info.json
in gradle-intellij-plugin -> IntelliJPlatformArgumentProvider.kt
Helpful jq
:
jq '.launch[] | select(.os == "macOS" and .arch == "amd64") | .additionalJvmArguments |= sort_by(.)' < /Users/pawel_lipski/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2023.3/6105b81c6142f62379ad6c5afb542c77350a71eb/ideaIC-2023.3/product-info.json