https://pantsbuild.org/ logo
#development
Title
# development
b

bitter-ability-32190

11/17/2022, 8:59 PM
I might need someone with a Mac to help me debug the failure on this PR: https://github.com/pantsbuild/pants/pull/17563
🫠 1
👀 1
oh nevermind I think I know th ebug perhaps
👀 2
oops, lol was on the wrong branch. Still no clue 😅
w

wide-midnight-78598

11/17/2022, 9:10 PM
I’m invested in this roller coaster
b

bitter-ability-32190

11/17/2022, 9:10 PM
I want off Mr. Bones' Wild Ride
I believe the correct command is
./pants run build-support/bin/_release_helper.py -- build-wheels
Oh huh I can reproduce. Thats a start. Why'd it pass on Linux in CI?!
Oh:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp5oeg4q6d/entry_8/pants/VERSION'
OK so on
main
the
VERSION
file is not part of
testutil
, so why is it failing now?
Oh @ancient-vegetable-10556 I'm suspecting this is due to
read_resource
perhaps?
a

ancient-vegetable-10556

11/17/2022, 9:26 PM
HRRRRM MAYBE
b

bitter-ability-32190

11/17/2022, 9:29 PM
aha, yes. Replacing the code in
version.py
with the old code gets past this issue seemingly? (although I get a different error)
a

ancient-vegetable-10556

11/17/2022, 9:29 PM
I have forgotten a lot of this over the last couple of months, short of keeping everything working as best I could
b

bitter-ability-32190

11/17/2022, 9:31 PM
We call
read_resource
in 8 places. I wonder what would happen if we replaced the internals with just
pkgutil.get_data
a

ancient-vegetable-10556

11/17/2022, 9:31 PM
it would return to working just fine
note that
pkgutil.get_data
is somewhat broken (again, in ways I don’t remember)
that whole pyox process was difficult. I tried too many things for notetaking to be effective
b

bitter-ability-32190

11/17/2022, 9:41 PM
ah iunderstand now
Oh it says so in your pr: `Resources can only be loaded from packages that contain an
__init__.py
file or namespace packages that do not contain `__init__.py``
You mind if I back that PR out?
a

ancient-vegetable-10556

11/17/2022, 9:49 PM
IMHO there should be a very good reason, since
read_resource
exists to support an enduring API in Python, and
pkgutil.get_data
is deprecated and could go away
b

bitter-ability-32190

11/17/2022, 9:50 PM
a

ancient-vegetable-10556

11/17/2022, 9:51 PM
iirc we’re using a backport that fixes that ticket, but don’t quote me on that
b

bitter-ability-32190

11/17/2022, 10:07 PM
Well this is becoming quite the ball to untangle
😢 1
w

wide-midnight-78598

11/17/2022, 10:45 PM
🎢
b

bitter-ability-32190

11/18/2022, 3:39 PM
So, one way to fix this is just to throw out PEP 420, since neither Pants-wheel'd nor Pants-PEXd are actually PEP 420 packages.
__file__
loading for
VERSION
would work
Or maybe a judicious symlink? 🤔
Wait a minute, I edited
version.py
but the line it complains on when I run
./pants run build-support/bin/_release_helper.py -- build-wheels
still has the old code. What gives?
Have I been making changes and testing nothing? 🤯
ah weird cache issue. huzzah
a

ancient-vegetable-10556

11/18/2022, 4:05 PM
wheeeee 😕
b

bitter-ability-32190

11/18/2022, 4:05 PM
OK so I'm just gonna use a subdir and call it a day
Say hello to
pants/_version
a

ancient-vegetable-10556

11/18/2022, 4:06 PM
oh. Um, we also didn’t do that for a reason 🙂
b

bitter-ability-32190

11/18/2022, 4:06 PM
🫠
a

ancient-vegetable-10556

11/18/2022, 4:06 PM
b

bitter-ability-32190

11/18/2022, 4:07 PM
I'm willing to change that and force
PANTS_FROM_SHA
users to update their script. I don't think we can expect the
./pants
shim to never change (especially considering it's about to change A BUNCH in the scie world)
a

ancient-vegetable-10556

11/18/2022, 4:08 PM
We really need a way to propagate updates to the launcher script, tbqh
b

bitter-ability-32190

11/18/2022, 4:08 PM
I don't disagree, but it's a chicken and egg problem 😛
a

ancient-vegetable-10556

11/18/2022, 4:08 PM
not really, it’s a thing you can put into Pants itself
b

bitter-ability-32190

11/18/2022, 4:08 PM
Also, the reality seems ot be that loading resources from the topmost namespace of a namespace package is a HUGE recipe for disaster
a

ancient-vegetable-10556

11/18/2022, 4:09 PM
yeah, agreed
b

bitter-ability-32190

11/18/2022, 4:09 PM
Because there is no answer to "who owns
pants
?" when
pants
is a namespace package
a

ancient-vegetable-10556

11/18/2022, 4:09 PM
Right, that’s basically the definition of namespace packages
b

bitter-ability-32190

11/18/2022, 4:09 PM
🙂
So I'll update the PR and lay out clearly this will break
PANTS_FROM_SHA
and then also PR the wrapper script
a

ancient-vegetable-10556

11/18/2022, 4:10 PM
anyway, I would also be in favour of moving it for a specific version, but we should also push out a fix in 2.13/2.14 telling people to upgrade the wrapper script
b

bitter-ability-32190

11/18/2022, 4:11 PM
I'm neutral on that I think. Whats the utility of backporting?
We can also do the symlink thing if the pain is real...
a

ancient-vegetable-10556

11/18/2022, 4:12 PM
so that they update before they move to a release where it’s broken
b

bitter-ability-32190

11/18/2022, 4:12 PM
If they're using
PANTS_FROM_SHA
they're already updating 😉
Let's have this discussion in GH, though so it's carved more into stone than sand
a

ancient-vegetable-10556

11/18/2022, 4:13 PM
We never assessed the level of pain, we just tried to keep things working as best as they can
I agree keeping it for posterity is good
b

bitter-ability-32190

11/18/2022, 4:15 PM
Actually though yeah since this is PANTS_FROM_SHA, backporting will do almost nothing
That only helps the people using `PANTS_FROM_SHA`for a commit on those branches which should be extremely rare
a

ancient-vegetable-10556

11/18/2022, 4:16 PM
OK
b

bitter-ability-32190

11/18/2022, 4:17 PM
But also doesn't hurt. I'm back to neutral 🙂
a

ancient-vegetable-10556

11/18/2022, 4:18 PM
I think this is a feature we should eventually have, and this is a good opportunity to at least create the ticket 🙂
b

bitter-ability-32190

11/18/2022, 4:18 PM
The updater/checker?
a

ancient-vegetable-10556

11/18/2022, 4:18 PM
right
b

bitter-ability-32190

11/18/2022, 4:19 PM
You making it? 😛
a

ancient-vegetable-10556

11/18/2022, 4:19 PM
sure
b

bitter-ability-32190

11/18/2022, 4:19 PM
🎉
Actually wait, yeah backporting is the "nice" thing to do, jus tin case. Thanks for the callout
a

ancient-vegetable-10556

11/18/2022, 4:32 PM
Soooo, I think we might actually need to make the
PANTS_FROM_SHA
functionality a bit smarter, because it’s going to break if you’re testing commits a few months either side of now 🫠
b

bitter-ability-32190

11/18/2022, 4:35 PM
or just another way of getting the version
a

ancient-vegetable-10556

11/18/2022, 4:36 PM
yeah
Let’s see if I can come up with an approach
b

bitter-ability-32190

11/18/2022, 4:37 PM
I'm thinking we don't need to know the version up front. Name the bootstrap folder related ot the SHA, download Pants at that SHA, then we can get the version from the installed code
It's probably doable. Let's move to DM