INNER CODE UNIT · Python
absorb_dereferenced_links
uxlfoundation/oneDAL · dev/release_tests/compare_release_trees.py:336
def absorb_dereferenced_links(make_root, make_files, bazel_root, bazel_links, limit):
"""Reconcile symlinks a transport turned into copies on the Make side.
`actions/upload-artifact` stores the *contents* a symlink points at, so a
Make release that travels through a GitHub artifact arrives with
`libonedal.so` and `libonedal.so.4` as ordinary files -- the tree the
makefile built (`makefile:975` does `cp` plus two `ln -sf`) has them as
symlinks, exactly as Bazel stages them. Comparing the two verbatim reports
every such entry twice, as a Make-only file and a Bazel-only symlink, and
hides whatever else level 1 would have found.
Where Bazel has a symlink and Make a plain file at the same path, the pair is
removed from level 1 and checked the only way the transport still permits:
the Make file must be byte-identical to the file the *Make* tree holds at the
path the Bazel symlink resolves to. That is precisely what the symlink
asserted before the transport flattened it -- `libonedal.so` and
`libonedal.so.4` carried the bytes of `libonedal.so.4.0` -- and it still
catches a Bazel tree whose link points somewhere else.