calm-ambulance-65371
04/19/2022, 5:06 PM2.10.1rc0
(and 2.10.0
) where a python_distribution
will generate a .tar.gz
which gets enumerated by isolate_local_dist_wheels
and subsequently fails when unzip -Z1
returns a non 0 exit code because it has no idea what to do with a .tar.gz
calm-ambulance-65371
04/19/2022, 5:07 PMcalm-ambulance-65371
04/19/2022, 5:08 PMpython_distribution
, however there's a lot of dependencies I'd have to clean up, and relying on the dist is conceptually cleaner regardlesshappy-kitchen-89482
04/19/2022, 5:13 PMcalm-ambulance-65371
04/19/2022, 5:14 PMhappy-kitchen-89482
04/19/2022, 5:15 PMsdist=False
on the python_distribution, so it doesn't generate the sdist in the first place. But that is only a hack, this bug (as you can see from my comments on it) is very befuddling because we filter on the .whl
suffix, so I cannot understand how this is happening at all...happy-kitchen-89482
04/19/2022, 5:15 PMenough-analyst-54434
04/19/2022, 5:20 PMcalm-ambulance-65371
04/19/2022, 5:20 PMhappy-kitchen-89482
04/19/2022, 5:21 PMcalm-ambulance-65371
04/19/2022, 5:22 PMcalm-ambulance-65371
04/19/2022, 5:22 PMhappy-kitchen-89482
04/19/2022, 5:23 PMhappy-kitchen-89482
04/19/2022, 5:23 PMhappy-kitchen-89482
04/19/2022, 5:24 PMcalm-ambulance-65371
04/19/2022, 5:24 PMhappy-kitchen-89482
04/19/2022, 5:27 PMhappy-kitchen-89482
04/19/2022, 5:28 PMwheels_snapshot.files
contains anything that doesn't end with .whl
then that is pretty bad...calm-ambulance-65371
04/19/2022, 5:30 PMcalm-ambulance-65371
04/19/2022, 5:30 PMimport pdb; pdb.set_trace()
happy-kitchen-89482
04/19/2022, 5:30 PMhappy-kitchen-89482
04/19/2022, 5:31 PMcalm-ambulance-65371
04/19/2022, 5:31 PMhappy-kitchen-89482
04/19/2022, 5:32 PMwheels_digest = await Get(Digest, DigestSubset(dist.digest, PathGlobs(["**/*.whl"])))
wheels_snapshot = await Get(Snapshot, Digest, wheels_digest)
And see if that makes a difference. It shouldn't, but we're already through the looking glass at this point.witty-crayon-22786
04/19/2022, 5:36 PM--no-pantsd
you’ll be more likely to succeed in `pdb`*, yea.
as to print
statements: they’ll be rendered, but prefer log statements in order to get better formattingcalm-ambulance-65371
04/19/2022, 5:37 PM12:36:04.35 [DEBUG] Wheels snapshot: ['<redacted>-py36.py3
7.py38.py39-none-any.whl', '<redacted>.tar.gz']
calm-ambulance-65371
04/19/2022, 5:37 PMcalm-ambulance-65371
04/19/2022, 5:37 PMlogger.debug("Wheels snapshot: %s", wheels)
calm-ambulance-65371
04/19/2022, 5:40 PMcalm-ambulance-65371
04/19/2022, 5:40 PMwheels_digest = await Get(Digest, DigestSubset(dist.digest, PathGlobs(["**/*.whl"])))
wheels_snapshot = await Get(Snapshot, Digest, wheels_digest)
this onecalm-ambulance-65371
04/19/2022, 5:45 PMDigestSubset
live?enough-analyst-54434
04/19/2022, 5:47 PMhappy-kitchen-89482
04/19/2022, 5:49 PMcalm-ambulance-65371
04/19/2022, 5:49 PMhappy-kitchen-89482
04/19/2022, 5:49 PMcalm-ambulance-65371
04/19/2022, 6:03 PMcalm-ambulance-65371
04/19/2022, 6:03 PMcalm-ambulance-65371
04/19/2022, 6:14 PMcurved-television-6568
04/19/2022, 6:18 PMMODE=debug
https://www.pantsbuild.org/v2.11/docs/contributions-rust#compilecalm-ambulance-65371
04/19/2022, 6:38 PMGlobs:PreparedPathGlobs {
include: [
PathGlobIncludeEntry {
input: GlobParsedSource(
"**/*.whl",
),
globs: [
DirWildcard {
canonical_dir: Dir(
"",
),
symbolic_path: "",
wildcard: Pattern {
original: "*",
tokens: [
AnySequence,
],
is_recursive: false,
},
remainder: [
Pattern {
original: "**",
tokens: [
AnyRecursiveSequence,
],
is_recursive: true,
},
Pattern {
original: "*.whl",
tokens: [
AnySequence,
Char(
'.',
),
Char(
'w',
),
Char(
'h',
),
Char(
'l',
),
],
is_recursive: false,
},
],
},
Wildcard {
canonical_dir: Dir(
"",
),
symbolic_path: "",
wildcard: Pattern {
original: "*.whl",
tokens: [
AnySequence,
Char(
'.',
),
Char(
'w',
),
Char(
'h',
),
Char(
'l',
),
],
is_recursive: false,
},
},
],
},
],
exclude: GitignoreStyleExcludes {
patterns: [],
gitignore: Gitignore {
set: GlobSet {
len: 0,
strats: [],
},
root: "",
globs: [],
num_ignores: 0,
num_whitelists: 0,
matches: None,
},
},
strict_match_behavior: Ignore,
conjunction: AnyMatch,
patterns: [
Pattern {
original: "**/*.whl",
tokens: [
AnyRecursiveSequence,
AnySequence,
Char(
'.',
),
Char(
'w',
),
Char(
'h',
),
Char(
'l',
),
],
is_recursive: true,
},
],
},
Digest:Digest {
hash: Fingerprint<934af979fdb5a823fc6de3e173933a839503470e4b796a608731c01a741ab70f>,
size_bytes: 350,
}
calm-ambulance-65371
04/19/2022, 6:55 PMcalm-ambulance-65371
04/19/2022, 7:30 PMsdist=false
to my python_distributions
and it seems to get me past that. Now I'm seeing another error:
ERROR: Package 'common' requires a different Python: 3.8.10 not in '>=3.6'
calm-ambulance-65371
04/19/2022, 7:30 PMcalm-ambulance-65371
04/19/2022, 7:32 PMhappy-kitchen-89482
04/19/2022, 7:36 PMpath_stats
and files
in the rust code, right at the end before the call to DigestTrie::from_path_stats
happy-kitchen-89482
04/19/2022, 7:36 PMcalm-ambulance-65371
04/19/2022, 7:41 PMsnapshot_glob_match
looks a bit different: https://github.com/pantsbuild/pants/blob/release_2.10.1rc0/src/rust/engine/fs/store/src/snapshot_ops.rs#L502happy-kitchen-89482
04/19/2022, 7:48 PMhappy-kitchen-89482
04/19/2022, 7:51 PMcalm-ambulance-65371
04/19/2022, 7:52 PMhappy-kitchen-89482
04/19/2022, 7:52 PMhappy-kitchen-89482
04/19/2022, 7:52 PMcalm-ambulance-65371
04/19/2022, 7:53 PMcalm-ambulance-65371
04/19/2022, 7:53 PMhappy-kitchen-89482
04/19/2022, 7:55 PMwitty-crayon-22786
04/19/2022, 7:56 PMcalm-ambulance-65371
04/19/2022, 7:57 PMcalm-ambulance-65371
04/19/2022, 7:59 PMBinaryPathRequest
moved 😐curved-television-6568
04/19/2022, 8:02 PMcurved-television-6568
04/19/2022, 8:03 PMhappy-kitchen-89482
04/19/2022, 8:10 PMhappy-kitchen-89482
04/19/2022, 8:10 PMcalm-ambulance-65371
04/19/2022, 8:44 PMDuplicateNameError
due to python_requirements
apparently there's a naming conflict but I can't give the python_requirements
a different name 😕calm-ambulance-65371
04/19/2022, 8:44 PMDuplicateNameError: A target already exists at 'common/BUILD' with name 'common' and target type 'python_requirements'. The 'python_distribution' target cannot use the same name.
calm-ambulance-65371
04/19/2022, 8:49 PMpython_requirements
targets at the same level (rather common for things such as test requirements) in pants 2.11
calm-ambulance-65371
04/19/2022, 8:50 PM2.10
and possibly older versions, I'm not sure what we can do at this pointhappy-kitchen-89482
04/19/2022, 9:20 PMpython_requirements
, @hundreds-father-404 knows the details. I think it's in the error message?calm-ambulance-65371
04/19/2022, 9:20 PMcalm-ambulance-65371
04/19/2022, 9:20 PMhappy-kitchen-89482
04/19/2022, 9:27 PMhappy-kitchen-89482
04/19/2022, 9:27 PMhappy-kitchen-89482
04/19/2022, 9:30 PM[GLOBAL]
use_deprecated_python_macros = false
happy-kitchen-89482
04/19/2022, 9:30 PMname=
to your python_requirements
to differentiate themhundreds-father-404
04/19/2022, 9:39 PMFurther, it seems we can't support multiple python_requirements targets at the same level (rather common for things such as test requirements) in pants 2.11Before pants 2.10, this was indeed impossible. It was a major issue we wanted to solve. It is possible in 2.10+ via
use_deprecated_python_macros
. That defaults to true in 2.10, but false in 2.11
There is indeed an awkward dance to migrate to the new system. The instructions should have been logged to you, but here they are https://github.com/pantsbuild/pants/blob/f50c6744243e0d8eac0d8e9fb715a6290585f397/src/python/pants/option/global_options.py#L1653calm-ambulance-65371
04/19/2022, 9:40 PM2.2
for awhile and have had multiple python_requirements
living along-side each other for awhile. Idk if we've actually been using their generated targets thoughcalm-ambulance-65371
04/19/2022, 9:41 PMhundreds-father-404
04/19/2022, 9:42 PMhundreds-father-404
04/19/2022, 9:42 PMcalm-ambulance-65371
04/19/2022, 9:42 PMcalm-ambulance-65371
04/19/2022, 9:43 PMcalm-ambulance-65371
04/19/2022, 9:43 PMhundreds-father-404
04/19/2022, 9:58 PMcalm-ambulance-65371
04/19/2022, 9:58 PMcalm-ambulance-65371
04/19/2022, 9:58 PMYou have set interpreter constraints (`CPython<4,>=3.7`) that are not compatible with those used to generate the lockfile (`CPython<4,>=3.8 OR CPython>=3.6,>=3.8`). You can fix this by not setting `[black].interpreter_constraints`, or by using a new custom lockfile.
calm-ambulance-65371
04/19/2022, 9:58 PMhundreds-father-404
04/19/2022, 9:59 PMcalm-ambulance-65371
04/19/2022, 9:59 PMupdate-build-files --fix-python-macros
2.11.0rc3
calm-ambulance-65371
04/19/2022, 9:59 PMuse_deprecated_python_macros = false
hundreds-father-404
04/19/2022, 10:01 PM--no-fmt
, or try setting [black].interpreter_constraints
to 3.6+ and regenerate lockfilecalm-ambulance-65371
04/19/2022, 10:06 PM[black].interpreter_constraints
and regenerating appeared to fix ithundreds-father-404
04/19/2022, 10:07 PMcalm-ambulance-65371
04/19/2022, 10:07 PMcalm-ambulance-65371
04/19/2022, 10:07 PMhundreds-father-404
04/19/2022, 10:09 PMcalm-ambulance-65371
04/19/2022, 10:09 PMcommon:requests
-> common:requirements#requests
for me?hundreds-father-404
04/19/2022, 10:11 PMname=
to the python_requirements()
, but no manual changes for call sites. Just the definitionhundreds-father-404
04/19/2022, 10:12 PMcalm-ambulance-65371
04/19/2022, 10:23 PM17:19:37.39 [ERROR] 1 Exception encountered:
MappingError: Failed to parse ./interfaces/BUILD:
__call__() got an unexpected keyword argument 'name'
calm-ambulance-65371
04/19/2022, 10:23 PMpython_requirements(name="requirements")
python_sources()
hundreds-father-404
04/19/2022, 10:24 PMcalm-ambulance-65371
04/19/2022, 10:25 PM17:25:08.13 [ERROR] 1 Exception encountered:
ValueError: `--update-build-files-fix-python-macros` specified when `[GLOBAL].use_deprecated_python_macros` is already set to false, which means that there is nothing left to fix.
calm-ambulance-65371
04/19/2022, 10:25 PMcalm-ambulance-65371
04/19/2022, 10:25 PMhundreds-father-404
04/19/2022, 10:25 PMhundreds-father-404
04/19/2022, 10:25 PMhundreds-father-404
04/19/2022, 10:26 PM--fix-python-macros
hundreds-father-404
04/19/2022, 10:26 PMcalm-ambulance-65371
04/19/2022, 10:33 PMupdate-build-files --update-build-files-fix-python-macros
that I should be running to update the dependencies? I may just have gotten myself into a bad state and need to rework things myself 🙂calm-ambulance-65371
04/19/2022, 10:33 PMhundreds-father-404
04/19/2022, 10:35 PMhundreds-father-404
04/19/2022, 10:37 PMpython_requirements
in a single directory? There is this TODO that could give you trouble https://github.com/pantsbuild/pants/blob/b1fa13f8c0788f11564ef486e2f4fb5f9c56d2e8/src/python/pants/backend/python/macros/deprecation_fixers.py#L128calm-ambulance-65371
04/20/2022, 6:17 PM4: numpy
Required by:
FingerprintedDistribution(distribution=<redacted>-3136395a3be17fe9145c4a8a3d3f2d9c82fa6349 (/home/noah/.cache/pants/named_caches/pex_root/installed_wheels/537d7fc53f4f80dc839310442f7d14a3ee8b01f8ab2d929f987f1ac55cbeaf30/<redacted>-3136395a3be17fe9145c4a8a3d3f2d9c82fa6349-py3-none-any.whl), fingerprint='6e7c538bf420421cd2668a8e1db727ea763104aef000bfa4d08fec0751891228')
FingerprintedDistribution(distribution=<redacted>-3136395a3be17fe9145c4a8a3d3f2d9c82fa6349 (/home/noah/.cache/pants/named_caches/pex_root/installed_wheels/19769ef6f634442291de1989e8ece3158aa195aa05b985ff08a85c4dab4af640/<redacted>-3136395a3be17fe9145c4a8a3d3f2d9c82fa6349-py38-none-any.whl), fingerprint='d5159cf4c0d5b014f94d9b896d527ffeeb0e2596957a38aba5bd391d9b8548a1')
But this pex had no 'numpy' distributions.
calm-ambulance-65371
04/20/2022, 6:17 PMhundreds-father-404
04/20/2022, 6:22 PM/home/noah/.cache/pants/named_caches
?calm-ambulance-65371
04/20/2022, 6:30 PMcalm-ambulance-65371
04/20/2022, 6:31 PMhundreds-father-404
04/20/2022, 6:37 PMcalm-ambulance-65371
04/20/2022, 6:38 PMconstraints.txt
. Will try removingcalm-ambulance-65371
04/20/2022, 6:39 PMcalm-ambulance-65371
04/20/2022, 6:40 PMhundreds-father-404
04/20/2022, 6:41 PMhundreds-father-404
04/20/2022, 6:42 PM-ldebug
and/or --no-process-cleanup
? I am curious if this is something obvious like that we are not correctly saying to install numpy because eg deps are wrong, vs something elsecalm-ambulance-65371
04/20/2022, 7:28 PMhundreds-father-404
04/20/2022, 7:29 PMcalm-ambulance-65371
04/20/2022, 7:32 PMcalm-ambulance-65371
04/20/2022, 7:32 PMcalm-ambulance-65371
04/20/2022, 7:32 PM14:29:35.31 [ERROR] 1 Exception encountered:
ncy id: 3, and concurrency: 1
ProcessExecutionFailure: Process 'Building pytest_runner.pex' failed with exit code 1. _runner.pex under semaphore with concurre
stdout:
14:00:23.69 [INFO] Preserving local process execution dir /tmp/process-executionCURx
stderr:
calm-ambulance-65371
04/20/2022, 7:32 PMcalm-ambulance-65371
04/20/2022, 7:33 PMcalm-ambulance-65371
04/20/2022, 7:34 PMhundreds-father-404
04/20/2022, 7:34 PMcalm-ambulance-65371
04/20/2022, 7:36 PMTraceback (most recent call last):
File "/home/noah/.cache/pants/named_caches/pex_root/unzipped_pexes/aecac44135d419f932725eb33af2df4856517e99/.bootstrap/pex/pex.py", line 504, in execute
exit_value = self._wrap_coverage(self._wrap_profiling, self._execute)
File "/home/noah/.cache/pants/named_caches/pex_root/unzipped_pexes/aecac44135d419f932725eb33af2df4856517e99/.bootstrap/pex/pex.py", line 409, in _wrap_coverage
return runner(*args)
File "/home/noah/.cache/pants/named_caches/pex_root/unzipped_pexes/aecac44135d419f932725eb33af2df4856517e99/.bootstrap/pex/pex.py", line 440, in _wrap_profiling
return runner(*args)
File "/home/noah/.cache/pants/named_caches/pex_root/unzipped_pexes/aecac44135d419f932725eb33af2df4856517e99/.bootstrap/pex/pex.py", line 560, in _execute
return self.execute_entry(self._pex_info.entry_point)
File "/home/noah/.cache/pants/named_caches/pex_root/unzipped_pexes/aecac44135d419f932725eb33af2df4856517e99/.bootstrap/pex/pex.py", line 696, in execute_entry
return self.execute_pkg_resources(entry_point)
File "/home/noah/.cache/pants/named_caches/pex_root/unzipped_pexes/aecac44135d419f932725eb33af2df4856517e99/.bootstrap/pex/pex.py", line 728, in execute_pkg_resources
return runner()
File "/home/noah/.cache/pants/named_caches/pex_root/installed_wheels/fae568165f31fc90f0e75717c4271e0cfdd33bef60060cee0ed9d51279de33a0/pex-2.1.79-py2.py3-none-any.whl/pex/bin/pex.py", line 740, in main
do_main(
File "/home/noah/.cache/pants/named_caches/pex_root/installed_wheels/fae568165f31fc90f0e75717c4271e0cfdd33bef60060cee0ed9d51279de33a0/pex-2.1.79-py2.py3-none-any.whl/pex/bin/pex.py", line 761, in do_main
pex_builder = build_pex(
File "/home/noah/.cache/pants/named_caches/pex_root/installed_wheels/fae568165f31fc90f0e75717c4271e0cfdd33bef60060cee0ed9d51279de33a0/pex-2.1.79-py2.py3-none-any.whl/pex/bin/pex.py", line 686, in build_pex
pex_builder.set_script(options.script)
File "/home/noah/.cache/pants/named_caches/pex_root/installed_wheels/fae568165f31fc90f0e75717c4271e0cfdd33bef60060cee0ed9d51279de33a0/pex-2.1.79-py2.py3-none-any.whl/pex/pex_builder.py", line 348, in set_script
distributions.update(PEX(pex, interpreter=self._interpreter).resolve())
File "/home/noah/.cache/pants/named_caches/pex_root/installed_wheels/fae568165f31fc90f0e75717c4271e0cfdd33bef60060cee0ed9d51279de33a0/pex-2.1.79-py2.py3-none-any.whl/pex/orderedset.py", line 45, in update
for key in iterable:
File "/home/noah/.cache/pants/named_caches/pex_root/installed_wheels/fae568165f31fc90f0e75717c4271e0cfdd33bef60060cee0ed9d51279de33a0/pex-2.1.79-py2.py3-none-any.whl/pex/pex.py", line 121, in resolve
for dist in env.resolve():
File "/home/noah/.cache/pants/named_caches/pex_root/installed_wheels/fae568165f31fc90f0e75717c4271e0cfdd33bef60060cee0ed9d51279de33a0/pex-2.1.79-py2.py3-none-any.whl/pex/environment.py", line 492, in resolve
for fingerprinted_distribution in self.resolve_dists(all_reqs)
File "/home/noah/.cache/pants/named_caches/pex_root/installed_wheels/fae568165f31fc90f0e75717c4271e0cfdd33bef60060cee0ed9d51279de33a0/pex-2.1.79-py2.py3-none-any.whl/pex/environment.py", line 579, in resolve_dists
raise ResolveError(
pex.environment.ResolveError: Failed to resolve requirements from PEX environment @ /home/noah/.cache/pants/named_caches/pex_root/unzipped_pexes/b1f697e212f61b6154e26d9885061a3836dfb691.
Needed cp38-cp38-manylinux_2_31_x86_64 compatible dependencies for:
1: Flask
Required by:
FingerprintedDistribution(distribution=<redacted>-3136395a3be17fe9145c4a8a3d3f2d9c82fa6349 (/home/noah/.cache/pants/named_caches/pex_root/installed_wheels/b7a06d2474b32d3876949dd74da83c93f060b4a4aaf5f4b434a17085a8b40344/<redacted>-3136395a3be17fe9145c4a8a3d3f2d9c82fa6349-py3-none-any.whl), fingerprint='8e7c49e6be260ac829d0c9058bf09b8d90039ba5b010b47d7d04623778ffaf25')
But this pex had no 'Flask' distributions.
hundreds-father-404
04/20/2022, 7:37 PMhundreds-father-404
04/20/2022, 7:38 PMcalm-ambulance-65371
04/20/2022, 7:38 PMcalm-ambulance-65371
04/20/2022, 7:38 PMhundreds-father-404
04/20/2022, 7:38 PMcalm-ambulance-65371
04/20/2022, 7:39 PMhundreds-father-404
04/20/2022, 7:39 PMcalm-ambulance-65371
04/20/2022, 7:40 PMhundreds-father-404
04/20/2022, 7:43 PMpython_requirement
changes should still work
We made some changes in 2.11 so that lock files generated by pex are much more efficient. Perhaps we broke a code pathhundreds-father-404
04/20/2022, 7:45 PMyour python_requirement changes should still workyou may need to explicitly set
[GLOBAL].use_deprecated_python_macros = false
calm-ambulance-65371
04/20/2022, 7:56 PMcalm-ambulance-65371
04/20/2022, 7:59 PMcalm-ambulance-65371
04/20/2022, 9:11 PMFingerprintedDistribution
defined?calm-ambulance-65371
04/20/2022, 9:11 PMhundreds-father-404
04/20/2022, 9:16 PMhundreds-father-404
04/20/2022, 9:17 PM-ldebug
may be useful: make sure pants is correctly telling Pex to install things. you may need to use --no-pantsd --no-local-cache
calm-ambulance-65371
04/20/2022, 9:17 PMhundreds-father-404
04/20/2022, 9:18 PMcalm-ambulance-65371
04/20/2022, 9:21 PMtest
goal is completing:
16:20:23.03 [DEBUG] Completed: `test` goal
16:20:23.03 [DEBUG] Completed: Run Pytest
16:20:23.03 [DEBUG] Canceled: Run Pytest
16:20:23.03 [DEBUG] computed 1 nodes in 41.582558 seconds. there are 16938 total nodes.
16:20:23.03 [ERROR] 1 Exception encountered:
ProcessExecutionFailure: Process 'Building pytest_runner.pex' failed with exit code 1.
stdout:
hundreds-father-404
04/20/2022, 9:22 PMcalm-ambulance-65371
04/20/2022, 9:22 PM./pants test module::
(excluded the flags)calm-ambulance-65371
04/20/2022, 9:23 PMcalm-ambulance-65371
04/20/2022, 9:23 PMconstraints.txt
calm-ambulance-65371
04/20/2022, 9:24 PMhundreds-father-404
04/20/2022, 9:24 PM--print-stacktrace
set, it should show you a list of rules with the file name in parentheses
Note that pants will build multiple pytest_runner.py files. It sounds like some tests work and some down