Feature #19068
closedUpgrades required Bison version for development
Description
Background¶
Printing node type, e.g. NODE_LIT
, for yydebug
option is helpful when developing parse.y.
Before:
Reducing stack by rule 639 (line 5062):
$1 = token "integer literal" (1.0-1.1: 1)
-> $$ = nterm simple_numeric (1.0-1.1: )
After:
Reducing stack by rule 641 (line 5078):
$1 = token "integer literal" (1.0-1.1: 1)
-> $$ = nterm simple_numeric (1.0-1.1: NODE_LIT)
Consideration¶
IIRC, CRuby tries to keep it be able to build with old Bison, I guess this is because default Bison for Mac is very old (might be 2.3).
However Bison is still developed and new version has new feature. Therefore I want to confirm it is able to update Bison version required for CRuby development.
Implementation¶
Updated by yui-knk (Kaneko Yuichiro) about 2 years ago
- Subject changed from Print NODE type with yydebug option to Upgrades required Bison version for development
Updated by matz (Yukihiro Matsumoto) about 2 years ago
Sounds reasonable. What version are you going to use?
Matz.
Updated by yui-knk (Kaneko Yuichiro) about 2 years ago
Regarding Bison version, I expect Bison 3.0 or later at the moment.
Updated by matz (Yukihiro Matsumoto) about 2 years ago
OK. Go ahead.
Matz.
Updated by yui-knk (Kaneko Yuichiro) about 2 years ago
- Status changed from Open to Closed
Applied in changeset git|f7db1affd10767d729866e95c02ffb26266829ab.
Set default %printer for NODE nterms
Before:
Reducing stack by rule 639 (line 5062):
$1 = token "integer literal" (1.0-1.1: 1)
-> $$ = nterm simple_numeric (1.0-1.1: )
After:
Reducing stack by rule 641 (line 5078):
$1 = token "integer literal" (1.0-1.1: 1)
-> $$ = nterm simple_numeric (1.0-1.1: NODE_LIT)
"<*>"
is supported by Bison 2.3b (2008-05-27) or later.
https://git.savannah.gnu.org/cgit/bison.git/commit/?id=12e3584054c16ab255672c07af0ffc7bb220e8bc
Therefore developers need to install Bison 2.3b+ to build ruby from
source codes if their Bison is older.
Minimum version requirement for Bison is changed to 3.0.
See: https://bugs.ruby-lang.org/issues/19068 [Feature #19068]
Updated by yui-knk (Kaneko Yuichiro) about 2 years ago
[note]
Updated rbenv/ruby-build wiki page.
Updated by Eregon (Benoit Daloze) about 2 years ago
This broke ruby-dev-builder: https://github.com/ruby/ruby-dev-builder/actions/runs/3464389673/jobs/5785863246
I'll try if brew install bison
is enough.
I hope it isn't needed to prepend bison to PATH, otherwise we'll need changes in all Ruby installers.
For reference, the commit on GitHub: https://github.com/ruby/ruby/commit/f7db1affd10767d729866e95c02ffb26266829ab
Updated by Eregon (Benoit Daloze) about 2 years ago
@yui-knk (Kaneko Yuichiro) Just installing bison is not enough on macOS:
https://github.com/ruby/ruby-dev-builder/actions/runs/3471482135/jobs/5801034797
So I think you need to make PRs to all Ruby installers otherwise Ruby 3.2 won't build anymore on macOS.
This is quite unfortunate, IMHO it might be reason enough to revert this change, because it's going to be messy to deal with this in every script building Ruby.
Updated by Eregon (Benoit Daloze) about 2 years ago
Although because bison
is only needed for development/non-release builds it's a smaller concern.
So then it's needed to fix ruby-build 3.2.0-dev some/prefix
and rvm install ruby-head
to use the Homebrew bison on macOS.
Updated by yui-knk (Kaneko Yuichiro) about 2 years ago
Thanks for sharing.
I think brew install bison
is enough because the command install bison@3.8
now.
It seems your fix works well, https://github.com/ruby/ruby-dev-builder/commit/1cdfbf1ebb4d417d43f968b35a416fba5987a3f0.