Skip to content

buck2 audit output and ctx.audit().output(...) do not support toolchain-deps' paths #1264

@lf-

Description

@lf-

Throw this (admittedly somewhat contrived and using a made-up path copy pasted from another project) bxl into //test.bxl:

def _inspect_path(ctx: bxl.Context):
    audit = ctx.audit()
    out = audit.output("buck-out/v2/gen/gh_facebook_buck2/bef66bd6acb1c0aa-5c5f7478adf1e00e/__haskell__/__action___0__/th-expand-syns/out.link")

main = bxl.main(
    impl = _inspect_path,
    cli_args = {},
)

Output:

$ buck2 bxl //test.bxl:main
File changed: gh_facebook_buck2//test.bxl
Traceback (most recent call last):
  File <builtin>, in <module>
  * test.bxl:3, in _inspect_path
      out = audit.output("buck-out/v2/gen/gh_facebook_buck2/bef66bd6acb1c0aa-5c5f74...

error: Malformed buck-out path. Expected format: `buck-out/<isolation_prefix>/<gen|tmp|test|gen-anon|gen-bxl>/<cell_name>/<cfg_hash>/<target_path?>/__<target_name>__/<__action__i
d__?>/<outputs>`. Actual path was: `buck-out/v2/gen/gh_facebook_buck2/bef66bd6acb1c0aa-5c5f7478adf1e00e/__haskell__/__action___0__/th-expand-syns/out.link`
 --> test.bxl:3:11
  |
3 |     out = audit.output("buck-out/v2/gen/gh_facebook_buck2/bef66bd6acb1c0aa-5c5f7478adf1e00e/__haskell__/__action___0__/th-expand-syns/out.link")
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |

Caused by:
    Path does not have a platform configuration or content-based hash
Build ID: f3945808-c611-4857-a063-ed4340af82c9
Command: bxl.                                                                                                                                                                    
Time elapsed: 0.0s
BXL FAILED

$ buck2 audit output buck-out/v2/gen/gh_facebook_buck2/bef66bd6acb1c0aa-5c5f7478adf1e00e/__haskell__/__action___0__/th-expand-syns/out.link
Malformed buck-out path. Expected format: `buck-out/<isolation_prefix>/<gen|tmp|test|gen-anon|gen-bxl>/<cell_name>/<cfg_hash>/<target_path?>/__<target_name>__/<__action__id__?>/<
outputs>`. Actual path was: `buck-out/v2/gen/gh_facebook_buck2/bef66bd6acb1c0aa-5c5f7478adf1e00e/__haskell__/__action___0__/th-expand-syns/out.link`

Caused by:
    Path does not have a platform configuration or content-based hash
Build ID: 68142a87-1d72-4a2f-8232-cbd4bc699605
Command: audit.                                                                                                                                                                  
Time elapsed: 0.0s

I would expect that audit output knows how to deal with toolchain deps that have these two platforms. It seems that the parser code isn't expecting the same format as the creation code.

Version:
a72a88b

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions