Closed Paar86 closed 8 months ago
I will look into it.
Thanks, hopefully you'll find something.
It seems we've had this problem for a while. In a build, the Antlr4BuildTasks package downloaded the Java JRE .zip for running the Antlr tool, but then tries to extract the file in a multi-process environment trying to compete for the .zip. The easiest is to unzip the file to some directory, find the java.exe, and make sure the PATH environment contains the directory containing that executable.
Good to know it's not a problem on my end. Will you be fixing the issue in the near future? I'll try the solution you suggest in meantime.
Seeing the same issue on GitHub Actions. Since updating to the latest version, our project will not build.
Seeing the same issue on GitHub Actions. Since updating to the latest version, our project will not build.
Reproducing it now. Looking at it.
Have you tried the work around? (Install a JRE -- see list here https://github.com/kaby76/Antlr4BuildTasks/blob/72071e1842cc6f26886ea6ecf80c3c495bf64fe7/Antlr4BuildTasks/Tasks/RunAntlrTool.cs#L43 or install an OpenJDK and add the directory containing java to your path, then try again.)
Have you tried the work around?
No; how exactly do you do that on a GitHub server where you don't have shell access to install things?
No; how exactly do you do that on a GitHub server where you don't have shell access to install things?
It's not hard. Just copy these lines to your .github/workflows/main.yml file to install and test the java installation. https://github.com/antlr/grammars-v4/blob/caf66c3d8a4657a4871a539fa8de9c9a6b5a8b1b/.github/workflows/main.yml#L83-L92 . Github Actions has a number of different shells to install what you want if you need to do things via a shell script.
OK, that does seem to be an effective workaround.
Meanwhile, I've been trying different versions. The problem doesn't seem to exist in v12.5 and earlier, so whatever caused it is a pretty recent change.
Meanwhile, I've been trying different versions. The problem doesn't seem to exist in v12.5 and earlier, so whatever caused it is a pretty recent change.
Something changed with .NET version 8 that I haven't accounted for yet.
Found a problem. USERPROFILE not being expanded with env info.
File is being downloaded but it's zero bytes at the time of decompressing. Logic to wait for the completion of the download broken. I changed the code from WebClient() to DownloadFileAsync() because WebClient() is obsolete and was replaced. The Wait() isn't working, probably because DownloadFileAsync doesn't return a completion object that makes any sense. https://github.com/kaby76/Antlr4BuildTasks/blob/72071e1842cc6f26886ea6ecf80c3c495bf64fe7/Antlr4BuildTasks/Tasks/RunAntlrTool.cs#L808C85-L808C85 . The TimeSpan seems to be correct (hours, minutes, seconds) https://learn.microsoft.com/en-us/dotnet/api/system.timespan.-ctor?view=net-8.0#system-timespan-ctor(system-int32-system-int32-system-int32)
Fixed version 12.8. Let me know if it fails.
Hi. I'm using the package in my company's project and it was a success for a long time. However after updating to .NET 8 and the latest version of Antlr4BuildTasks I'm getting errors when building the project in Azure DevOps:
The build task successfully downloads the JRE installer but is unable to extract the .zip file because somethings keeps it locked. Has there been any change in the package that could result in such behavior?
This is what we've been using previously with .NET 7:
Currently we're using .NET 8 with:
Thanks for any input!