repaired antlr4-lab - #97
Conversation
fix: make antlr4-lab run locally without root or cloud dependencies Changes to run the server locally without sudo, Maven SNAPSHOT deps, or Google Cloud credentials, with automatic SVG dependency installation. ## Core fixes - Port 80 → 8080 (configurable via -Dantlrlab.port) - Log directory /var/log/antlrlab → /tmp/antlrlab (configurable via -Dantlrlab.log.dir) - Removed us.parr:parrtlib:0.5-SNAPSHOT dependency (not in Maven Central); execInDir() and StreamVacuum inlined into GrammarProcessor - Replaced deprecated StringBufferInputStream with CharStreams.fromString() - execInDir uses ProcessBuilder with /opt/homebrew/bin added to PATH for Apple Silicon Homebrew compatibility ## SVG dependency management - ensureSVGDeps() auto-installs ps2pdf/pdf2svg via brew (macOS) or sudo apt-get (Linux); returns helpful install instructions in an error SVG for Windows and unsupported OSes - toSVG returns error SVG with guidance instead of crashing ## Share servlet - ShareServlet writes to local filesystem (/tmp/antlrlab/share/) instead of Google Cloud Storage (no GCP credentials required) ## Testing - Added JUnit 5 dependencies and test source directory - 14 unit tests covering interp(), execInDir(), commandExists(), escXml(), makeErrorSVG(), ensureSVGDeps() ## Docker - Updated ENTRYPOINT to pass -Dantlrlab.port=80 for container use ## Documentation and license - Updated README.md with local setup, configuration table, test command, and modifications summary - Added copyright notice to LICENSE - Added code comments documenting all local changes
|
Hi unfortunately that's a pretty big change and I don't really have time to see if everything is OK with it. I'm not really maintaining the project anymore except paying for the Google cloud server. sorry! |
|
For those interested, I got this PR working in NixOS by serving it in a nix develop shell. If you want to reproduce:
then
As per the instructions in the PR readme, open a web browser and go to (If you are on a client PC in your local network, and you did the optional step above of opening the port so the app is running on your server, it will be accessible at the server's ip address: I found that entering an escape key sequence to kill the app does not fully release the port, so attempting to run the Edit: I also got it running in an incus container running Alpine Linux cloud 3.24 which is the lightest weight container possible (20mb) however the build dependencies bulk it up quite a lot in terms of disk space (otherwise it's minimal cpu to run on a small server)...if you want a writeup on the incus container let me know. |
fix: make antlr4-lab run locally without root or cloud dependencies
Changes to run the server locally without sudo, Maven SNAPSHOT deps, or Google Cloud credentials, with automatic SVG dependency installation.
Core fixes
SVG dependency management
Share servlet
Testing
Docker
Documentation and license