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

bored-glass-58755

07/08/2022, 6:00 PM
Hi, I am trying to create a plugin which will trigger a homegrown system to create venvs for libraries (inside libraries' root folder) in the monorepo. I am going about creating a
Process
and
await Get
the
ProcessResult
but the plugin is ending in following error:
Error launching process: Os { code: 2, kind: NotFound, message: "No such file or directory" }
. I am also having a hard time in providing a workspace folder location to the Process. Could anyone please help me with the above error and providing a workspace folder?
h

happy-kitchen-89482

07/08/2022, 6:47 PM
Hi! This will be much easier to help with if you can provide a little repo with a full example, there are too many moving parts to be able to solve the problem based on just the information you posted.
b

bored-glass-58755

07/08/2022, 7:26 PM
Hi Benny, thanks a lot for your response! I will need to figure out how do I provide info in the best manner so that we are able to work it out. I will get back to you on this.
h

happy-kitchen-89482

07/08/2022, 9:14 PM
Great! We're happy to help, but just need more to go on.
Especially when it comes to plugins, where there can be a lot going on
Can you also explain what you mean by "workspace folder location"? A Process always runs in a sandbox directory that pants creates.
b

bored-glass-58755

07/11/2022, 2:06 PM
Hi Benjy, thanks that you asked. I think I should have been clearer on that. So, the Process has all these attributes to pass along (argv, env, working_directory, etc.). When I said workspace, I meant working_directory. I want to be able to run that process in a working_directory that I provide. I am aware of the sandbox nature of the Process but is there a way to be able to pass in a directory where the process should be running?
h

happy-kitchen-89482

07/11/2022, 6:27 PM
There isn't, but if you run with --no-process-cleanup Pants will preserve the sandbox dirs and print them out, so you can poke around in them for debugging
this isn't intended for regular use though, just for debugging
What is your use-case for setting the sandbox dir?
b

bored-glass-58755

07/12/2022, 1:10 PM
We have a proprietary tool to build venv for python libraries. That tool needs to be triggered from the same directory for which we want to create a venv. The tool reads a .json file from the library root along with couple of other files to create the venv. This is one of the applications for that tool. But what's the use case for the attribute workspace_directory if there isn't way to run a process in a user provided directory?
5 Views