salmon-nest-5801
05/05/2021, 11:41 PMrequest.target.address
of the BUILD file? I've tried using await Get(DigestContents, ...)
targeting a PathGlob to that file path, but it causes infinite errors complaining about the file system changing 🤔happy-kitchen-89482
05/05/2021, 11:47 PMhundreds-father-404
05/05/2021, 11:47 PMhundreds-father-404
05/05/2021, 11:48 PMsalmon-nest-5801
05/05/2021, 11:53 PMfrom pants.backend.python.goals.setup_py import SetupKwargs, SetupKwargsRequest
from pants.engine.fs import DigestContents, GlobMatchErrorBehavior, PathGlobs
from pants.engine.rules import Get, collect_rules, rule
from pants.engine.target import Target
from pants.engine.unions import UnionRule
class DeclarativeSetupKwargsRequest(SetupKwargsRequest):
@classmethod
def is_applicable(cls, _: Target) -> bool:
return True
def rules():
return [
*collect_rules(),
UnionRule(SetupKwargsRequest, DeclarativeSetupKwargsRequest),
]
@rule
async def setup_kwargs_plugin(request: DeclarativeSetupKwargsRequest) -> SetupKwargs:
digest_contents = await Get(
DigestContents,
PathGlobs(
[f"{request.target.address.spec_path}/setup.cfg"],
description_of_origin="python declarative setup plugin",
glob_match_error_behavior=GlobMatchErrorBehavior,
),
)
declarative_setup_contents = digest_contents[0].content.decode()
print(declarative_setup_contents)
return SetupKwargs({**request.explicit_kwargs}, address=request.target.address)
salmon-nest-5801
05/05/2021, 11:55 PM(vims-next) C02F9412MD6R-ML:vims-next taylocj1$ ./pants package backend/base
19:52:14.66 [ERROR] panic at 'called `Result::unwrap()` on an `Err` value: "Could not get field `value`: PyErr { ptype: <class \'AttributeError\'>, pvalue: Some(AttributeError(\'value\')), ptraceback: Some(<traceback object at 0x10e710380>) }"', src/externs/mod.rs:225
19:52:14.66 [ERROR] Please set RUST_BACKTRACE=1, re-run, and then file a bug at <https://github.com/pantsbuild/pants/issues>.
19:52:14.66 [INFO] Filesystem changed during run: retrying `@rule(pants.backend.python.goals.setup_py.package_python_dist)` in 500ms...
repeatedly, over and over, until you manually kill the buildsalmon-nest-5801
05/05/2021, 11:55 PMhundreds-father-404
05/06/2021, 12:38 AMGlobMatchErrorBehavior
should be GlobMatchErrorBehavior.error
. Sorry that's an atrocious error message, that's from the Rust FFI boundarysalmon-nest-5801
05/06/2021, 1:46 PMhundreds-father-404
05/06/2021, 2:37 PM