Skip to content

util/order.jam (and engine/mod_order.cpp) review#593

Open
paolopas wants to merge 2 commits intobfgroup:mainfrom
paolopas:jamme-5
Open

util/order.jam (and engine/mod_order.cpp) review#593
paolopas wants to merge 2 commits intobfgroup:mainfrom
paolopas:jamme-5

Conversation

@paolopas
Copy link
Copy Markdown
Contributor

@paolopas paolopas commented Apr 20, 2026

  • restored Jam add-pair method, for better error control (Jam does a syntax check for arguments at call site with relative error message emission) and better preconditions checkings too: avoid null arguments, avoid duplicate constraints (which led to edge duplication in final graph,) and avoid self referencing (which led to cycles in final graph.) The old add-pair was even broken, since it spelled .constraits instead of .constraints
  • removed stale order method implementation, fully replaced by native one
  • removed all other stale methods, no more useful/functional

mod_order.cpp rewritten

  • to implement the topological sort algorithm using std::vector instead of mem.h
  • also removed jam_strings.h include
  • prepared for future warning emission on "cyclic dependency"[1]
  • no more need for native add_pair

[1]

I am waiting for #581 to be able to use the outerr warning function.

+ restored Jam add-pair method, for better error control (Jam does a
syntax check for arguments at call site with relative error message emission)
and better preconditions checkings too: avoid null arguments, avoid duplicate
constraints (which led to edge duplication in final graph,) and avoid
self referencing (which led to cycles in final graph.) The old add-pair
was even broken, since it spelled .constraits instead of .constraints
+ removed stale order method implementation, fully replaced by native one
+ removed all other stale methods, no more useful/functional

mod_order.cpp rewritten

+ to implement the topological sort algorithm using std::vector instead
of mem.h
+ also removed jam_strings.h include
+ prepared for future warning emission on "cyclic dependency"
+ no more need for native add_pair
@paolopas
Copy link
Copy Markdown
Contributor Author

paolopas commented Apr 20, 2026

Well, the 237df2b tests went fine, so there were no problems with Boost ≥ 1.66.

Important

René, if you think there might be backwards compatibility issues due to the removal of the native add-pair rule (which was required in order.jam without a HAS_NATIVE_RULE guard), then please add 925cbc5 which restores it otherwise don't include it.

Removing the native add-pair could create problems if a new engine (without the native add-pair) deals with old jamfiles, which require it (without checking for its existence.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant