Hi, I am relatively new to Pants and have been try...
# general
b
Hi, I am relatively new to Pants and have been trying to troubleshoot an unmatched glob from the default resolve in our pants.toml when running
pants export
from the root of the projects directory. This is on Apple silicone, the file does exist, I have tried deleting it and regenerating. I can see all of the build targets when running
pants list ::
. Seems to only be an issue with
pants export
. Has anyone else had this issue with MacOS/ARM? Thanks in advance. Happy to provide more information.
g
Can you share exactly what the message is? I don't quite get why it would only happens with export; but unmatched globs generally just means you have a target (
python_sources
, f.ex.) that doesn't catch any files -- for me these happen when I move files and leave a BUILD file but no Python files in a directory.
b
Absolutely.
Copy code
15:23:28.33 [ERROR] 1 Exception encountered:

Engine traceback:
  in `export` goal

IntrinsicError: Unmatched glob from the resolve `default`: "lockfiles/python.lock"

Do the file(s) exist? If so, check if the file(s) are in your `.gitignore` or the global `pants_ignore` option, which may result in Pants not being able to see the file(s) even though they exist on disk. Refer to <https://www.pantsbuild.org/troubleshooting#pants-cannot-find-a-file-in-your-project>.
Not seeing any misplaced BUILD files.
Please let me know if you would like the verbose run, appreciate your time.
g
Ah, have you generated lockfiles?
pants generate-lockfiles --resolve=default
b
I have, but not with that specific flag, just
pants generate-lockfiles
. Let me give that a try and get back to you. Thanks!
g
It should be the same, the flag just limits what resolves we generate for, default should be all. I get now that this is what you meant in your original message with deleting and regenerating. Is the file under
.gitignore
or some other such list? If you try
pkill pantsd
and then
pants export
, does that change anything?
b
Got it. The file is not in the
.gitignore
, running
pkill pantsd
followed by
pants export
still results in the same
Unmatched glob...
error. Let me know if there is any more information I could provide.
g
Can you change the resolve path in your pants.toml, maybe removing all the path parts (e.g., just
python.lock
), then moving the file there?
b
Wow, the file was recognized immediately. Not clear why
g
Ok, something seems wonky with the
lockfiles
dir. Is it spelled that way, including case? Any weird permissions/ownership? I'm not that familiar with Apple devices so not sure what could be causing it there if it's not in gitignore or pants-ignore
b
Spelling matches the
.toml
file case and all. Nothing strange with the permissions/ownership. Puzzling, but I do appreciate the temporary fix. I will probably have to play around with my local config to figure out whats going wrong. Thank you Tom!
g
If you can't figure it out, a repro repository would be helpful to debug further. Maybe running it under Linux would be interesting too; if you have containers or a Linux machine available.
b
If I could not get this working by the end of the day, I was planning to spin up a dev container from a separate machine (x86). I will be sure to follow up when I'm able to pin it down. Really appreciate your time
👍 1
An interesting update, if I create a new folder named anything other than
lockfiles
and modify
pants.toml
to point to the new directory containing the lockfiles, it works without a hitch. If I rename the directory back to
lockfiles
, pants is unable to find it. I am using Pants version 2.23.2.