cloud-functions-go icon indicating copy to clipboard operation
cloud-functions-go copied to clipboard

Allow setting environment variables while launching runtime

Open salrashid123 opened this issue 8 years ago • 2 comments

Suggest using

use execve instead of execv so that users can set and launch a runtime which may require specific .so files or other env variables

For example:

	char *envp[] =
	{
			"LD_LIBRARY_PATH=/user_code/lib:$LD_LIBRARY_PATH",
			NULL
	};

	execve(bin, const_cast<char* const*>(&args[0]), envp);  

salrashid123 avatar Jun 01 '17 20:06 salrashid123

Do you need to completely override the environment, or would being able to append lines be sufficient? I would like to continue to pass through the environment if possible.

iangudger avatar Jun 01 '17 20:06 iangudger

I'd prefer to pass through the env variables (I'd seek to minimize the impact to the runtime and only alter the few bits absolutely necessary and needed). In the example above, it'd be extending the LD_LIBRARY_PATH so the .so files a user would upload would be found.

salrashid123 avatar Jun 02 '17 00:06 salrashid123