hundreds-father-404
11/10/2020, 8:02 PM▶ ./pants test src/python/pants/util/strutil_test.py src/python/pants/util:tests
...
✓ src/python/pants/util/strutil_test.py:tests succeeded.
✓ src/python/pants/util/strutil_test.py:tests succeeded.
That is, the result shows up twice for the same file address. That’s because TargetRootsToFieldSets
stores a mapping of TargetsWithOrigin
to FieldSet
, and this is the same target but two distinct origins
The fix is simple for this if we can get rid of TargetsWithOrigin
et al. We no longer use that mechanism anymore, and it has some weight to support.
What do we think about shedding the ability to use WithOrigin
? In the past, we used it for globbing semantics, to only error if a certain type of spec was used. Since then, we’ve made globbing semantics more uniform to never error and only ever run on things we are able towooden-thailand-8386
11/10/2020, 9:16 PMFIXTURE_PORT=8080 ./pants run projects/dapi_fixture_api:dapi_fixture_api_pex
and that worked fine, hit it as expected, no issues there.
Then I killed it with Ctrl+C
and my terminal was back to normal…
but when I tried running it again.. it said “Address already in use” and I go check and the API is still running 😐 and yup, it’s there on my ps aux
output:
lzfnyy 85055 0.0 0.4 4415100 61256 ?? S 4:09PM 0:25.07 /Users/lzfnyy/.pyenv/versions/3.7.8/bin/python3.7 /Users/lzfnyy/Projects/clueless/.pants.d/tmpw5l_14lu/dapi_fixture_api_pex.pex
hundreds-father-404
11/11/2020, 6:56 PMfast-nail-55400
11/13/2020, 11:59 PMMultiple copies of pants.pex found at <s3://ci-public.pantsbuild.org/daily/36505/201391758/pants.pex.py36.osx>. This is not allowed as a security precaution. This likely happened from restarting the bootstrap shards in the same Travis build. Instead, initiate a new build by either pulling from master or pushing an empty commit (`git commit --allow-empty`).
chilly-magazine-21545
11/14/2020, 2:41 AMwooden-thailand-8386
11/16/2020, 6:22 PMwitty-crayon-22786
11/16/2020, 9:06 PMhundreds-father-404
11/16/2020, 11:23 PMFrozenDict
is ordered? Right now, our __eq__
requires the same ordering, but idk if it mattershappy-kitchen-89482
11/17/2020, 3:23 AMhappy-kitchen-89482
11/17/2020, 3:23 AMhappy-kitchen-89482
11/17/2020, 3:23 AMhappy-kitchen-89482
11/17/2020, 3:24 AMhundreds-father-404
11/18/2020, 10:49 PMdir/foo.proto
and ábč.proto
from this string:
import "dir/foo.proto"; import "ábč.proto";
NB the unicode, it’s important that the file name can be any unicode character iiuc.
This regex does not work if >1 target:
import "(.+\.proto)";
The .+
is too permissive and results in the first group being dir/foo.proto"; import "ábč.proto
.
But I don’t want to enumerate all valid chars - that’s not feasible with unicode. In Python, \w
works with unicode chars, so maybe I use something like \w+
and some of the other valid symbols like -
and /
?hundreds-father-404
11/18/2020, 10:49 PMfast-nail-55400
11/18/2020, 10:50 PMfast-nail-55400
11/18/2020, 10:51 PMhundreds-father-404
11/18/2020, 10:51 PMhundreds-father-404
11/18/2020, 10:52 PMalso what language are you doing this in?In Python, for import analysis of
.proto
files
you can configure multi-match modeYeah, but I’m not sure that’s relevant because you can have multiple import statements on the same line in Protobufs. It’s
;
delimited, rather than newlinefast-nail-55400
11/18/2020, 10:52 PMhundreds-father-404
11/18/2020, 10:52 PMre.findall()
fast-nail-55400
11/18/2020, 10:54 PM.*?
which would consume lazilyflat-zoo-31952
11/18/2020, 10:54 PM.+?
in the quantifierflat-zoo-31952
11/18/2020, 10:54 PMflat-zoo-31952
11/18/2020, 10:54 PMIn [4]: re.findall(r'import "(.+?\.proto)"', s)
Out[4]: ['dir/foo.proto', 'ábč.proto']
hundreds-father-404
11/18/2020, 10:55 PMwitty-crayon-22786
11/19/2020, 12:28 AM--changed
: have been thinking about it for a while, and finally spent the time to put it on paper: https://github.com/pantsbuild/pants/issues/11206fast-nail-55400
11/19/2020, 4:30 PMhundreds-father-404
11/19/2020, 7:00 PMfrom __future__ import annotations
in Pants code, as the master branch now requires 3.7 or 3.8 to runhappy-kitchen-89482
11/21/2020, 5:36 AMhundreds-father-404
11/21/2020, 5:37 AM