Menu

#1866 Make autogenerated file output more stable

3.6.0
closed-fixed
nobody
Blade Center Plugin
5
2015-08-10
2015-02-03
Darix
No

As reported in https://bugzilla.opensuse.org/show_bug.cgi?id=915949, it seems that some autogenerated files have a random order for the autogenerated code.

Would it be easy to make that autogenerated code more stable.

As a background: we rebuild our packages when ever one of their dependencies change. we have a script called build-compare to find out if the newly build rpms differ from the previous build. if that is the case we skip the current build and do not trigger packages that depend on the current package. the random order of the lines in the generated files kind of break that optimization.

1 Attachments

Discussion

  • dr_mohan

    dr_mohan - 2015-02-03
    • Subsystem: OpenHPI Daemon --> Blade Center Plugin
     
  • dr_mohan

    dr_mohan - 2015-02-03

    The initial analysis shows the following command autogenerates a el2event.c file
    ../../../scripts/text2cstr.pl -s eventxml event.xml > el2event.c
    ../../scripts/text2cstr.pl -s eventxml event.xml > el2event.c
    The attached file shows the difference in one instance. Even though the source is not changed, looks like the generated file has jumbled lines. The input to this perl script, event.xml, is also an autogenerated file. This was generated by eventmap2code.pl using snmp_bc_event.map which are checked in files.
    ../../../plugins/snmp_bc/eventmap2code.pl -xml -idir ../../../plugins/snmp_bc -mapfile snmp_bc_event.map
    ../../plugins/snmp_bc/eventmap2code.pl -xml -idir ../../plugins/snmp_bc -mapfile snmp_bc_event.map

    The attached file shows the differences.
    Any one who is familier with perl and/or blade center plugin could help by creating a patch.

     
  • Anton Pak

    Anton Pak - 2015-02-03

    Please try the attached patch

     
  • Anton Pak

    Anton Pak - 2015-02-03

    The keys of a hash are returned in an apparently random order. The actual random order is subject to change in future versions of Perl, but it is guaranteed to be the same order as either the values or each function produces (given that the hash has not been modified). Since Perl 5.8.1 the ordering is different even between different runs of Perl for security reasons.

    http://www.perlmonks.org/?node_id=1005122

     
  • dr_mohan

    dr_mohan - 2015-02-03

    The patch works well on SLES12 which has perl > 5.18.1. Could some one else test it too?

     

    Last edit: dr_mohan 2015-02-04
  • dr_mohan

    dr_mohan - 2015-02-04

    Anton's patch works well. It was tested on SLES12 where perl version is >5.18.1. Darix confirmed with his testing that patch works well

     
  • dr_mohan

    dr_mohan - 2015-02-04
     
  • dr_mohan

    dr_mohan - 2015-02-04
    • status: open --> closed-fixed
     
  • dr_mohan

    dr_mohan - 2015-02-04

    Fixed with checkin #7617

     
  • dr_mohan

    dr_mohan - 2015-08-10
    • labels: --> Blade Center Plugin