Skip to content

Need links are not sorted in needs.json #1371

@arwedus

Description

@arwedus

Hi @chrisjsewell ,

in our project, we need a reproducible build, i.e. the needs builder must generate the same output if fed with the same input. That's why we have set reproducible_needs_json = True.
We noticed, however, that lists of linked needs (e.g. our "implements" or "derives" options) are not alphabetically sorted. We hoped that the order in which the links are added is stable, but noted that the order of the linked need ID entries changes depending on whether we add an external needs source (with needs_external_needs). However, the change has no influence on the elements contained in the list of IDs, it just changes the order.

Is this a known "feature" (i.e. the needs json builder does not sort the link list to save run-time) or is this a regression? I actually thought that your argument for reproducible build output was that all lists are sorted anyways, which I've shown you (see internal chat) that it's not the case with sphinx-needs 4.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E4Low efforts (2-3 days)P2High priority

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions