Hi, I am trying to create a plugin which will tri...
# general
b
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
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
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
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
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
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
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?