spdx / tools-golang

Collection of Go packages to work with SPDX files
Other
116 stars 54 forks source link

Tag Value output sorts some elements by SPDXID #206

Open kzantow opened 1 year ago

kzantow commented 1 year ago

When outputting Tag Value format, some elements like Files are being sorted before being output, and these seem to be sorted by SPDXID. This causes a bit of a stability issue that a subsequent run, if an SPDXID is not stable (e.g. someone generating a UUID or other type of hashing function), elements are reordered in unexpected ways.

I believe these elements should be sorted by some type of primary field (like a file name) and subsequently by SPDXID for duplicates.

lumjjb commented 1 year ago

hmmm, order shouldn't matter in spec, so this would be more for convenience.. but yea i think if its more convenient to have a bit more consistency, dont see why not... however, this could lead to the output document not being reproducible (unless we take the ordering of names followed by SPDX ID if tied).

Besides the reproducibility, i have no issue with changing the order.