You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, packagist has version 0.8.0 of the PHP runtime for Antlr. That corresponds to Antlr 4.12.0. We have a new version for Antlr 4.13.0, and there should be a new version of the PHP runtime for Antlr. But, it would be best to have antlr4-php-runtime use version numbers correspond exactly to Antlr tool version, and which are used in all the other targets, e.g., 4.13.0. Antlr programs cannot use different runtime versions with the tool.
Motivation
Dependabot in Github parses build specification files and issues update PRs when an Antlr runtime is released. But, building an Antlr program also requires the Antlr tool version to match. I can run the antlr4 tool with a -v 4.13.0 option, where the version is extracted from a PHP Composer file, but I then have to map the runtime version string there for PHP Antlr of 0.9.0 to 4.13.0. This makes Dependabot useless for PHP because I don't know what the mapping is aprori. Will 0.10.0 map to 4.14.0 or 4.13.1 or what??? I don't know the mapping until the PHP Antlr runtime is actually released.
Alternatives
Manually update the PHP Antlr version and Antlr tool version in the templates for grammars-v4, and don't let Dependabot analyse PHP Composer files.
Additional context
Templates for PHP are here. The Dependabot update for PHP is here.
The text was updated successfully, but these errors were encountered:
I am planning to re-add the testing of PHP targets for grammars-v4, fixing antlr/grammars-v4#3125
I have a workaround that finds the tool version that corresponds to the Antlr PHP runtime version in the composer.json file for a PHP driver. Not pretty, but it'll work as long as there are no major changes in how the package is published, how it is stored in the repo, and the version string in the source code.
The workaround involves a Bash script to extract the tool version from the source at
But, this is not easy. And, it is fragile. But, there is no other solution. Every target tested in grammars-v4 is with potentially a different version of Antlr because the runtimes are published independently of each other.
Script:
# Find runtime version in composer.json file.
runtime_version=`grep antlr4 composer.json | awk '{print $2}' | tr -d '\r' | tr -d '\n' | tr -d ',' | tr -d '"'`
# Get from online sources the commit version number that corresponds to the runtime version.
rm -rf antlr4-php-runtime
wget "https://packagist.org/packages/antlr/antlr4-php-runtime#$runtime_version"
commit_version=`grep BSD-3-Clause antlr4-php-runtime | awk '{print $NF}' | sed 's/<.*//'`
# Checkout the sources from the php runtime repo.
rm -rf antlr4-php-runtime
git clone https://github.com/antlr/antlr-php-runtime
cd antlr-php-runtime
git checkout $commit_version
# Extract the tool version this damn runtime version corresponds to.
tool_version=`grep 'public const VERSION' src/RuntimeMetaData.php | awk '{print $NF}' | sed "s/'//g" | sed 's/;//'`
# Run the antlr4 tool.
# antlr4 -version $tool_version ......
✨ Feature request
Right now, packagist has version 0.8.0 of the PHP runtime for Antlr. That corresponds to Antlr 4.12.0. We have a new version for Antlr 4.13.0, and there should be a new version of the PHP runtime for Antlr. But, it would be best to have antlr4-php-runtime use version numbers correspond exactly to Antlr tool version, and which are used in all the other targets, e.g., 4.13.0. Antlr programs cannot use different runtime versions with the tool.
Motivation
Dependabot in Github parses build specification files and issues update PRs when an Antlr runtime is released. But, building an Antlr program also requires the Antlr tool version to match. I can run the antlr4 tool with a
-v 4.13.0
option, where the version is extracted from a PHP Composer file, but I then have to map the runtime version string there for PHP Antlr of0.9.0
to4.13.0
. This makes Dependabot useless for PHP because I don't know what the mapping is aprori. Will 0.10.0 map to 4.14.0 or 4.13.1 or what??? I don't know the mapping until the PHP Antlr runtime is actually released.Alternatives
Manually update the PHP Antlr version and Antlr tool version in the templates for grammars-v4, and don't let Dependabot analyse PHP Composer files.
Additional context
Templates for PHP are here. The Dependabot update for PHP is here.
The text was updated successfully, but these errors were encountered: