-
Couldn't load subscription status.
- Fork 516
Open
Labels
Description
Populating CARGO_MANIFEST_DIR in cargo_build_script will not clean the path like in rust.bzl and rustc.bzl.
rules_rust/rust/private/rustc.bzl
Lines 908 to 911 in 478cef4
| # Both ctx.label.workspace_root and ctx.label.package are relative paths | |
| # and either can be empty strings. Avoid trailing/double slashes in the path. | |
| components = "${{pwd}}/{}/{}".format(ctx.label.workspace_root, ctx.label.package).split("/") | |
| env["CARGO_MANIFEST_DIR"] = "/".join([c for c in components if c]) |
rules_rust/rust/private/rust.bzl
Lines 461 to 462 in 478cef4
| components = "{}/{}".format(ctx.label.workspace_root, ctx.label.package).split("/") | |
| env["CARGO_MANIFEST_DIR"] = "/".join([c for c in components if c]) |
rules_rust/cargo/private/cargo_build_script.bzl
Lines 328 to 340 in 478cef4
| if not incompatible_runfiles_cargo_manifest_dir: | |
| script_data.append(ctx.attr.script[DefaultInfo].default_runfiles.files) | |
| manifest_dir = "{}.runfiles/{}/{}".format(script.path, workspace_name, ctx.label.package) | |
| else: | |
| runfiles_dir, runfiles_inputs, runfiles_args = _create_runfiles_dir( | |
| ctx = ctx, | |
| script = ctx.attr.script, | |
| retain_list = ctx.attr._cargo_manifest_dir_filename_suffixes_to_retain[BuildSettingInfo].value, | |
| ) | |
| manifest_dir = "{}/{}/{}".format(runfiles_dir.path, workspace_name, ctx.label.package) | |
| extra_args.append(runfiles_args) | |
| extra_inputs.append(runfiles_inputs) | |
| extra_output = [runfiles_dir] |
I think the paths.normalize should be used in all these cases.