https://pantsbuild.org/ logo
#general
Title
# general
c

clean-animal-18291

01/27/2022, 5:44 PM
We're trying to run pants on M1 mac (using rosetta terminal) but its always failing with following stacktrace. Would really appreciate if someone can help out on this. Is there something which we're doing wrong? Let me know if there's already a thread somewhere related to it which I can refer to.
Copy code
#9 597.1 Failed to begin watching the filesystem: Bad file descriptor (os error 9)
#9 597.1 Traceback (most recent call last):
#9 597.1   File "/home/ripplinguser/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/bin/pants_loader.py", line 95, in run_default_entrypoint
#9 597.1     exit_code = runner.run(start_time)
#9 597.1   File "/home/ripplinguser/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/bin/pants_runner.py", line 97, in run
#9 597.1     runner = LocalPantsRunner.create(
#9 597.1   File "/home/ripplinguser/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/bin/local_pants_runner.py", line 119, in create
#9 597.1     options_initializer = options_initializer or OptionsInitializer(options_bootstrapper)
#9 597.1   File "/home/ripplinguser/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/init/options_initializer.py", line 101, in __init__
#9 597.1     self._bootstrap_scheduler = create_bootstrap_scheduler(options_bootstrapper, executor)
#9 597.1   File "/home/ripplinguser/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/init/options_initializer.py", line 74, in create_bootstrap_scheduler
#9 597.1     EngineInitializer.setup_graph(
#9 597.1   File "/home/ripplinguser/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/init/engine_initializer.py", line 181, in setup_graph
#9 597.1     return EngineInitializer.setup_graph_extended(
#9 597.1   File "/home/ripplinguser/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/init/engine_initializer.py", line 285, in setup_graph_extended
#9 597.1     scheduler = Scheduler(
#9 597.1   File "/home/ripplinguser/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/engine/internals/scheduler.py", line 209, in __init__
#9 597.1     self._py_scheduler = native_engine.scheduler_create(
#9 597.1 ValueError: Failed to begin watching the filesystem: Bad file descriptor (os error 9)
h

hundreds-father-404

01/27/2022, 5:53 PM
Hello, welcome! Hm, I use an M1 and haven't seen this error before. I imagine it's enough to run
./pants --version
for this to reproduce? Could you please also try running
./pants --no-pantsd --version
?
c

clean-animal-18291

01/28/2022, 6:32 AM
Thanks Eric for the quick response. Yes I tried running with this flag as well. The above specific error doesn't go away. 😅
h

hundreds-father-404

01/28/2022, 1:02 PM
Oh! Are you using Docker? I see Linux in the error message, even though you're on an M1
c

clean-animal-18291

01/28/2022, 1:03 PM
Yes. I'm using docker and its running inside a container.
h

hundreds-father-404

01/28/2022, 1:04 PM
Ah ha, that explains it. Try `PANTS_WATCH_FILESYSTEM=false PANTS_PANTSD=false ./pants --version`: https://www.pantsbuild.org/docs/reference-global#section-watch-filesystem. Docker for Linux Intel x86 images and M1s still don't play nicely together with file watching
c

clean-animal-18291

01/31/2022, 9:32 AM
Thanks @hundreds-father-404 This worked. 👍
❤️ 1
h

hundreds-father-404

02/08/2022, 9:51 PM
Hey @clean-animal-18291, fyi this is now documented in the tool tip on M1s: https://www.pantsbuild.org/v2.10/docs/prerequisites#macos Thanks for asking about this!
🙌 1
2 Views