Skip to content
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

Piping pantsd stdout doesn't work when running in Python 3.8 #10438

Closed
stuhood opened this issue Jul 23, 2020 · 14 comments
Closed

Piping pantsd stdout doesn't work when running in Python 3.8 #10438

stuhood opened this issue Jul 23, 2020 · 14 comments

Comments

@stuhood
Copy link
Sponsor Member

stuhood commented Jul 23, 2020

./pants --pantsd list :: > $file works in 3.6/3.7 but not 3.8, in the example repo and at least one consumer repo.

@stuhood stuhood added this to the 2.0.0.alpha0 milestone Jul 23, 2020
@stuhood stuhood added this to To do in Pants 2.0 via automation Jul 23, 2020
@stuhood stuhood added this to TODO in Pants Daemon via automation Jul 23, 2020
@benjyw benjyw self-assigned this Jul 24, 2020
@benjyw
Copy link
Sponsor Contributor

benjyw commented Jul 27, 2020

I can't reproduce this in the example repo. What demonstrates this?

@stuhood
Copy link
Sponsor Member Author

stuhood commented Jul 27, 2020

I think that that might mean it is specific to our own repo then. Thanks for confirming!

@stuhood stuhood closed this as completed Jul 27, 2020
Pants Daemon automation moved this from TODO to Done Jul 27, 2020
Pants 2.0 automation moved this from To do to Done Jul 27, 2020
@benjyw
Copy link
Sponsor Contributor

benjyw commented Jul 27, 2020

We should still get to the bottom of this, no? In our repo I can see

$ ./pants --pantsd list src/python/:: > /tmp/foo
19:43:12 [INFO] initializing pantsd...
19:43:13 [INFO] pantsd initialized.

hanging forever, but it works if pantsd was already running, and it doesn't hang without the redirect. I see the same phenomenon if I pipe to less instead of redirect to a file. If I ctrl-c out then I see /tmp/foo has the content I expect.

Is that the phenomenon this ticket was opened for?

@stuhood
Copy link
Sponsor Member Author

stuhood commented Jul 27, 2020

Yes, that.

@benjyw
Copy link
Sponsor Contributor

benjyw commented Jul 27, 2020

OK, so I can repro this on Python 3.8 but not Python 3.7. Interesting.

@benjyw
Copy link
Sponsor Contributor

benjyw commented Jul 27, 2020

I can repro this on Python 3.8 (but not 3.6 or 3.7) in the example repo. So I think we have to say that 3.8 just isn't supported yet for running Pants?

@Eric-Arellano
Copy link
Contributor

So I think we have to say that 3.8 just isn't supported yet for running Pants?

Note that we don't yet test 3.8 in CI.

@benjyw benjyw reopened this Jul 28, 2020
Pants Daemon automation moved this from Done to TODO Jul 28, 2020
Pants 2.0 automation moved this from Done to In progress Jul 28, 2020
@benjyw benjyw changed the title Piping pantsd stdout works upstream, but not in consumer repositories Piping pantsd stdout doesn't work when running in Python 3.8 Jul 28, 2020
@stuhood stuhood modified the milestones: 2.0.0.alpha0, 2.0.x Jul 28, 2020
@stuhood
Copy link
Sponsor Member Author

stuhood commented Aug 4, 2020

Mmm... I think that this also extends to integration tests that attempt to run pantsd. Many PantsRunIntegrationTests (which will use pantsd under the hood by default) hang under 3.8.

@gshuflin gshuflin assigned gshuflin and unassigned benjyw Sep 9, 2020
@benjyw benjyw assigned benjyw and unassigned benjyw Sep 9, 2020
@gshuflin
Copy link
Contributor

gshuflin commented Sep 9, 2020

I can't reproduce this in the example repo:

at 14:29:07 ➤ ./pants --pantsd list :: > /tmp/file
at 14:29:13 ➤ cat /tmp/file 
//:ansicolors
//:protobuf
//:requirements.txt
//:setuptools
//:translate
helloworld:config
helloworld:config_file
helloworld:helloworld
helloworld:helloworld-awslambda
helloworld:helloworld_py2
helloworld/greet:greet
helloworld/greet:tests
helloworld/greet_py2:greet_py2
helloworld/util:config_loader_test_data
helloworld/util:tests
helloworld/util:util
helloworld/util/proto:proto
at 14:29:15 ➤ python --version
Python 3.8.5

Is it possible that the bug only manifests itself with a specific patch version of 3.8?

@benjyw
Copy link
Sponsor Contributor

benjyw commented Sep 11, 2020

python --version may not prove that ./pants is running 3.8. Try hand-editing ./pants to force it to run on 3.8.

@gshuflin
Copy link
Contributor

python --version may not prove that ./pants is running 3.8. Try hand-editing ./pants to force it to run on 3.8.

I explicitly set the PYTHON environment variable to /usr/bin/python3.8 on my system and confirmed that ./pants is using that specific binary path, and still couldn't reproduce. Is it possible that this python 3.8 wierdness only manifests itself on a mac, and not linux? Also what is the behavior that pants does do in the case where you can reproduce it?

@benjyw
Copy link
Sponsor Contributor

benjyw commented Sep 14, 2020

Huh, I can no longer reproduce this on a mac either. I think we can close this for now, and reopen if we see more reports of this in the wild.

Pants Daemon automation moved this from TODO to Done Sep 15, 2020
Pants 2.0 automation moved this from In progress to Done Sep 15, 2020
@stuhood
Copy link
Sponsor Member Author

stuhood commented Sep 17, 2020

python --version may not prove that ./pants is running 3.8. Try hand-editing ./pants to force it to run on 3.8.

I explicitly set the PYTHON environment variable to /usr/bin/python3.8 on my system and confirmed that ./pants is using that specific binary path, and still couldn't reproduce. Is it possible that this python 3.8 wierdness only manifests itself on a mac, and not linux? Also what is the behavior that pants does do in the case where you can reproduce it?

The relevant env var is PY:

# Locate the binary's path to log to user or die gracefully if not found.
if command -v "${PY}" >/dev/null; then
PY="$(command -v "${PY}")"
else
die "No ${PY} interpreter found on the path. Python will not work!"
fi

The repro also seems to have changed a little bit: the following hangs:

cat <(PY=python3.8 ./pants list 3rdparty/::)

@stuhood stuhood reopened this Sep 17, 2020
Pants Daemon automation moved this from Done to TODO Sep 17, 2020
Pants 2.0 automation moved this from Done to In progress Sep 17, 2020
@stuhood stuhood assigned stuhood and unassigned gshuflin Sep 17, 2020
@stuhood
Copy link
Sponsor Member Author

stuhood commented Sep 17, 2020

Ok, false alarm... the cat <(./pants list 3rdparty/::) case is a separate issue that has been open a while: #5510, and it repros on any python version. So yea, it does appear that this particular issue is resolved.

@stuhood stuhood closed this as completed Sep 17, 2020
Pants Daemon automation moved this from TODO to Done Sep 17, 2020
Pants 2.0 automation moved this from In progress to Done Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Pants 2.0
  
Done
Pants Daemon
  
Done
Development

No branches or pull requests

4 participants