bernd / fpm-cookery

A tool for building software packages with fpm.
Other
460 stars 88 forks source link

Stack overflow #173

Open lordnynex opened 7 years ago

lordnynex commented 7 years ago

Hello,

I am experimenting with master because I'm excited to see the expanded hiera support. All seems to be working ok'ish, except chain recipes seem to cause an infinite loop until ruby halts

/var/lib/gems/2.3.0/gems/hiera-1.3.4/lib/hiera/interpolate.rb:22:in `match': stack level too deep (SystemStackError)
    from /var/lib/gems/2.3.0/gems/hiera-1.3.4/lib/hiera/interpolate.rb:22:in `match'
    from /var/lib/gems/2.3.0/gems/hiera-1.3.4/lib/hiera/interpolate.rb:22:in `do_interpolation'
    from /var/lib/gems/2.3.0/gems/hiera-1.3.4/lib/hiera/interpolate.rb:14:in `block in interpolate'
    from /var/lib/gems/2.3.0/gems/hiera-1.3.4/lib/hiera/interpolate.rb:13:in `gsub'
    from /var/lib/gems/2.3.0/gems/hiera-1.3.4/lib/hiera/interpolate.rb:13:in `interpolate'
    from /var/lib/gems/2.3.0/gems/hiera-1.3.4/lib/hiera/backend.rb:125:in `parse_string'
    from /var/lib/gems/2.3.0/gems/hiera-1.3.4/lib/hiera/backend.rb:136:in `parse_answer'
    from /var/lib/gems/2.3.0/gems/hiera-1.3.4/lib/hiera/backend/yaml_backend.rb:35:in `block in lookup'
     ... 10348 levels...
    from /var/lib/gems/2.3.0/gems/clamp-1.0.1/lib/clamp/command.rb:133:in `run'
    from /home/nynex/.bundle/ruby/2.3.0/fpm-cookery-739ec6c44d46/bin/fpm-cook:7:in `<top (required)>'
    from /var/lib/gems/2.3.0/bin/fpm-cook:23:in `load'
    from /var/lib/gems/2.3.0/bin/fpm-cook:23:in `<main>'

To reproduce this, I specify a hiera yml config that contains 'chain_package: true' and 'chain_recipes: [ ... ]'. Because I'm unclear about how chained recipes function in hiera, the chained recipe does not use any yaml configuration at all. What follows is an infinite loop saying 'Located recipe at ..../.rb for child recipe ; starting build.'

tomeon commented 7 years ago

@lordnynex -- could you post up your recipes? I would like to try reproducing the issue. Thanks!