-
-
Notifications
You must be signed in to change notification settings - Fork 643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pants export-codegen fails with "Error copying bytes" when run across entire repo #21771
Comments
Sorry for the trouble. When you see this error, can you manipulate that file directly (in the same shell running Pants)? For instance #19826 is potentially slightly related? |
Also, can you work out what targets are generating the file? If so, can you share their definitions here (and |
Yes, I can copy it:
It's hard to identify the targets because as I said, the module that's causing problems doesn't have any codegen targets, and if I specify just the one that has protobuf targets, the bug does not appear. I cannot directly attach *.toml files, so I have provided pants.toml inline here: [GLOBAL]
pants_version = "2.23.0"
backend_packages = [
"pants.backend.build_files.fmt.ruff",
"pants.backend.codegen.protobuf.lint.buf",
"pants.backend.codegen.protobuf.python",
"pants.backend.docker",
"pants.backend.docker.lint.hadolint",
"pants.backend.experimental.adhoc",
"pants.backend.experimental.java",
"pants.backend.experimental.openapi",
"pants.backend.experimental.openapi.lint.openapi_format",
"pants.backend.experimental.python",
"pants.backend.experimental.python.lint.ruff.check",
"pants.backend.experimental.python.lint.ruff.format",
"pants.backend.experimental.terraform",
"pants.backend.experimental.terraform.lint.tfsec",
"pants.backend.experimental.tools.yamllint",
"pants.backend.python",
"pants.backend.python.typecheck.mypy",
"pants.backend.shell.lint.shfmt",
"pants.backend.tools.taplo",
]
[buf]
config = "build-support/buf.yaml"
known_versions = [
"v1.47.2|linux_arm64 |e7188833039d4e7736de517eba6141b9306f4b60b00974392dac7ce38627321e|22700012",
"v1.47.2|linux_x86_64|39716cfe0185df3cba21f66ec739620ffb6876c48b2da4338a8c68c290c9b116|24719887",
]
version = "v1.47.2"
[export]
py_editable_in_resolve = [
"serenity-base",
"serenity-base-services",
"serenity-data-client",
"serenity-data-pipelines",
"serenity-middleware",
"serenity-risk",
"serenity-specifications",
]
resolve = [
"serenity-deps"
]
[mypy]
config = "build-support/mypy.ini"
install_from_resolve = "mypy"
[pytest]
install_from_resolve = "pytest"
requirements = ["//3rdparty/python:pytest"]
[python]
default_resolve = "serenity-deps"
enable_resolves = true
interpreter_constraints = ['==3.12.*']
[python.resolves]
# tools
black = "3rdparty/python/black.lock"
flake8 = "3rdparty/python/flake8.lock"
isort = "3rdparty/python/isort.lock"
pytest = "3rdparty/python/pytest.lock"
mypy = "3rdparty/python/mypy.lock"
ruff = "3rdparty/python/ruff.lock"
# frameworks
dagster = "3rdparty/python/dagster.lock"
# modules
serenity-deps = "3rdparty/python/serenity-deps.lock"
serenity_data_pipelines-deps = "3rdparty/python/serenity_data_pipelines-deps.lock"
[python-protobuf]
infer_runtime_dependency = false
[ruff]
config = "build-support/ruff.toml"
[source]
root_patterns = [
"src/protos",
"src/python",
"tests",
"/serenity.analytics",
"/serenity.base",
"/serenity.base.services",
"/serenity.data.client",
"/serenity.data.pipelines",
"/serenity.labs",
"/serenity.middleware",
"/serenity.specifications",
"/serenity.risk",
"/serenity.seal"
]
[taplo]
glob_pattern = ["**/*.toml", "!pyproject.toml", "!.taplo.toml", "!taplo.toml"]
[test]
attempts_default = 3
[yamllint]
config_file_name = "build-support/yamllint.yml"
exclude = ["**/k8s/**/*.yaml", "**/k8s/**/*.yml"] |
Thanks for the info. Re the target, from the error message looks like the cached file is the contents of what is attempting to be |
Hi @huonw, thanks for picking this up. Here's the full BUILD under
As you can see, the place the CSV file gets picked up is in the metadata resource, which then gets used here, in
Nothing code generation related. I could certainly refine that glob to avoid picking up files under the |
Discussed in #21713
This particular repo has a number of modules, but only one has code to generate: a repo with Protobuf files. However, if I widen it and run
pants export-codegen ::
for every module, I get what looks like a race condition related to copying a CSV file. I isolated it to just one module,serenity.risk
-- it fails even if I just dopants export-codegen serenity.risk::
(1) It's unclear to me why this file would be in scope for code generation
(2) Regardless, the error itself seems like a red herring, an error changing file permissions
I tried further narrowing to sub-directories, etc., and it does seem to be this particular file.
The only notable thing about this file is its size, more than 500K:
Additional information:
jammy
imageOutput of uname -a:
Severity: very low, I can easily work around this.
The text was updated successfully, but these errors were encountered: