1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-05 19:55:47 +03:00

getdeps: add env subcommand

Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/1025

Add getdeps.py `env` subcommand to get the environment from getdeps in a sourcable form so that its easier to run/test/debug the binaries

There is an existing `debug` subcommand, but it starts an interactive shell inside getdeps, which isn't so useful for programatic use.

To get the output clean enough to source I switched getdeps print() logging to go to stderr.

example usage:
```
$ (source <(./build/fbcode_builder/getdeps.py --allow-system-packages env mononoke_integration); which mononoke)
```

Reviewed By: jdelliot

Differential Revision: D64982397

fbshipit-source-id: 65212936d42185e4d395557b56d3dba499caa128
This commit is contained in:
Alex Hornby
2024-10-27 05:01:22 -07:00
committed by Facebook GitHub Bot
parent ee3c033775
commit 5a007c0e3b
5 changed files with 72 additions and 16 deletions

View File

@@ -923,6 +923,27 @@ class DebugCmd(ProjectCmdBase):
self.create_builder(loader, manifest).debug(reconfigure=False)
@cmd(
"env",
"print the environment in a shell sourceable format",
)
class EnvCmd(ProjectCmdBase):
def setup_project_cmd_parser(self, parser):
parser.add_argument(
"--os-type",
help="Filter to just this OS type to run",
choices=["linux", "darwin", "windows"],
action="store",
dest="ostype",
default=None,
)
def run_project_cmd(self, args, loader, manifest):
if args.ostype:
loader.build_opts.host_type.ostype = args.ostype
self.create_builder(loader, manifest).printenv(reconfigure=False)
@cmd("generate-github-actions", "generate a GitHub actions configuration")
class GenerateGitHubActionsCmd(ProjectCmdBase):
RUN_ON_ALL = """ [push, pull_request]"""