Open illicitonion opened 1 year ago
Also, we should only do the above if we sniff the version to be Bazel 6 - in pre-Bazel 6 we'll need to keep the old behaviour (which we can do by just making the "parse out the label and resolve ourselves" stage of step 2 conditional).
https://github.com/bazelbuild/bazel/pull/13417 added the ability to find the workspace root from a
repository_ctx
, and will be in Bazel 6.Currently, if the
lockfile
orcargo_lockfile
points at a file which doesn't exist, we give a really unclear error:Instead, now that we have this API, we should be able to:
cargo_lockfile
from being anattr.label
to being anattr.string
@//
,//
, or:
), resolve it relative torepository_ctx.workspace_root
, and use that as the path; otherwise we should fall back to the existing code for remote repositories (though I'm not sure there's a reasonable use-case for using a remote repository for a lockfile).