Open gabriel-ocp opened 2 years ago
The problem seems to how the temporary file, which is used for combining multiple maps, is written and read.
https://stackoverflow.com/questions/18052966/ruby-how-to-write-to-tempfile recommends .close or .rewind
https://ruby-doc.org/stdlib-2.5.3/libdoc/tempfile/rdoc/Tempfile.html recommends .rewind
So the solution seems to be to add a tf.rewind after writing to the tmp file, before trying to read from it.
@gabriel-ocp I assume you have been able to test this?
I have replicated the issue with my local asciibinder build. Using @gabriel-ocp's container image with his updated version of asciibinder, I verified the fixes worked as expected.
Using the map in https://github.com/gabriel-ocp/ocp-bare-bones/blob/main/_topic_map.yml:
The exact steps for reproducing the problem are available at:
https://source.redhat.com/groups/public/gabrielocp/videos/ab_part01_reproducing_build_issuesmp4~1