From 88abeac81b9b6edc5f6e49cd6686d74f62c38481 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Hugly Date: Mon, 28 Oct 2024 18:30:28 +0100 Subject: [PATCH 01/10] Run gomocks from bazel, so tha the correct version of python is used, along with the dependdencies. This should also allow us to do away with pip_install as a pre-build step (and get rid of the associated shenanigans). --- Makefile | 2 +- tools/gomocks.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8a43295c70..df165739b8 100644 --- a/Makefile +++ b/Makefile @@ -88,7 +88,7 @@ protobuf: chmod 0644 pkg/proto/*/*.pb.go pkg/proto/*/*/*.pb.go mocks: - tools/gomocks.py + bazel run //tools:gomocks gazelle: go_deps.bzl bazel run //:gazelle --verbose_failures --config=quiet diff --git a/tools/gomocks.py b/tools/gomocks.py index d1ae63b163..abf1ace79a 100755 --- a/tools/gomocks.py +++ b/tools/gomocks.py @@ -27,6 +27,7 @@ def rule_to_file(rule: str) -> Tuple[str, str]: def mock_rules() -> List[str]: bazel = plumbum.local['bazel'] + os.chdir(os.environ.get("BUILD_WORKING_DIRECTORY","/nonexistium")) raw_rules = bazel("query", "filter(\"go_default_mock$\", kind(gomock, //...))") return raw_rules.splitlines() From 5f95821f63817fb1a5387796528caedd895147fc Mon Sep 17 00:00:00 2001 From: Jean-Christophe Hugly Date: Mon, 28 Oct 2024 18:37:21 +0100 Subject: [PATCH 02/10] There is no need to run env/pip/deps anymore. This is done by bazel. The only reason to do this was "make mocks" which bypassed bazel. Bazel is bypassed no-more. --- tools/install_deps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install_deps b/tools/install_deps index b43f43d756..65728d2506 100755 --- a/tools/install_deps +++ b/tools/install_deps @@ -8,4 +8,4 @@ if which apt-get >& /dev/null; then elif which yum >& /dev/null; then "$BASE/env/rhel/deps" fi -"$BASE/env/pip3/deps" + From c4876df652512cfaf96e547cf321b7e3c5d655d9 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Hugly Date: Tue, 29 Oct 2024 13:17:15 +0100 Subject: [PATCH 03/10] Also prevent the CI pipeline from running gomaocks.py directly. --- .buildkite/pipeline.yml | 2 +- Makefile | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index d3dda80ee9..86662b0cc2 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -96,7 +96,7 @@ steps: - ./tools/licenses.sh /tmp/test-artifacts/licenses - diff -rNu3 /tmp/test-artifacts/licenses ./licenses/data - echo "--- gomocks" - - ./tools/gomocks.py diff + - make gomocksdiff - echo "--- antlr" - rm -rf /tmp/test-artifacts/antlr - cp -R antlr/ /tmp/test-artifacts/antlr diff --git a/Makefile b/Makefile index df165739b8..cdae43c8f4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all build build-dev dist-deb antlr clean docker-images gazelle go.mod licenses mocks protobuf scion-topo test test-integration write_all_source_files git-version +.PHONY: all build build-dev dist-deb antlr clean docker-images gazelle go.mod licenses mocks mocksdiff protobuf scion-topo test test-integration write_all_source_files git-version build-dev: rm -f bin/* @@ -90,6 +90,9 @@ protobuf: mocks: bazel run //tools:gomocks +mocksdiff: + bazel run //tools:gomocks -- diff + gazelle: go_deps.bzl bazel run //:gazelle --verbose_failures --config=quiet ./tools/buildrill/go_integration_test_sync From 5bc80495fbacacb703ad1cbac783ad638da921be Mon Sep 17 00:00:00 2001 From: Jean-Christophe Hugly Date: Tue, 29 Oct 2024 13:25:37 +0100 Subject: [PATCH 04/10] Fix wrong make target name. --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 86662b0cc2..ca8d28325e 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -96,7 +96,7 @@ steps: - ./tools/licenses.sh /tmp/test-artifacts/licenses - diff -rNu3 /tmp/test-artifacts/licenses ./licenses/data - echo "--- gomocks" - - make gomocksdiff + - make mocksdiff - echo "--- antlr" - rm -rf /tmp/test-artifacts/antlr - cp -R antlr/ /tmp/test-artifacts/antlr From 572cbc3e40f2b7ebc48b1a40e84d7cae7c2e4d8c Mon Sep 17 00:00:00 2001 From: Jean-Christophe Hugly Date: Tue, 29 Oct 2024 17:15:50 +0100 Subject: [PATCH 05/10] Stop using undecorated python scripts from bash. scion.sh was still using togen.py, topodot.py and set_ipv6_addr.py directly; with the consequence that any significant deviation between the python environment in the build tree and that of the global environment could cause these tools to fail. Instead, we now produce py_binaries for these three tools, install them in bin/, and use them from there. To make them work when not invoked from bazel, we have to package them as self contained executables, which is achieved by adding the --build_python_zip command line flag. Suprisingly, this is the only method available. There isn't even an equivalent parameter to the py_binary rule. All other workarounds turn out to do crazy things (e.g. pkg_tar with the "include_run_files" option produces non-sense). The tools are requested as part of make all. Another case of calling python scripts outside bazel was router_benchmark/benchmark.py. For that one, I arranged so it can be invoked through bazel (like its twin brother test.py) instead of only from the command line. --- .bazelrc | 1 + BUILD.bazel | 5 ++-- Makefile | 7 ++---- acceptance/router_benchmark/BUILD.bazel | 7 ++++++ acceptance/router_benchmark/benchmark.py | 18 +++++++++----- scion.sh | 4 +-- tools/BUILD.bazel | 31 ++++++++++++++++++++++++ 7 files changed, 58 insertions(+), 15 deletions(-) diff --git a/.bazelrc b/.bazelrc index ae43f2c0dd..99ca68a9bd 100644 --- a/.bazelrc +++ b/.bazelrc @@ -18,6 +18,7 @@ build --incompatible_default_to_explicit_init_py # Enable resolution of cc toolchain by go toolchain build --incompatible_enable_cc_toolchain_resolution build --flag_alias=file_name_version=//:file_name_version +build --build_python_zip # include one of "--define gotags=sqlite_mattn" or "--define gotags=sqlite_modernc" # cannot be in common, because query chokes on it. diff --git a/BUILD.bazel b/BUILD.bazel index 0f04ad4d1e..02a6db587e 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -213,10 +213,11 @@ pkg_tar( pkg_tar( name = "scion-topo", srcs = [ - "//scion-pki/cmd/scion-pki", + "//tools:set_ipv6_addr", + "//tools:topodot", + "//tools:topogen", ], mode = "0755", - package_dir = "", ) # Nogo - Go code analysis tool diff --git a/Makefile b/Makefile index cdae43c8f4..58044869c4 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,10 @@ build-dev: rm -f bin/* - bazel build //:scion //:scion-ci + bazel build //:scion //:scion-ci //:scion-topo tar -kxf bazel-bin/scion.tar -C bin tar -kxf bazel-bin/scion-ci.tar -C bin + tar -kxf bazel-bin/scion-topo.tar -C bin build: rm -f bin/* @@ -75,10 +76,6 @@ docker-images: @echo "Load images" @bazel cquery '//docker:prod union //docker:test' --output=files 2>/dev/null | xargs -I{} docker load --input {} -scion-topo: - bazel build //:scion-topo - tar --overwrite -xf bazel-bin/scion-topo.tar -C bin - protobuf: rm -rf bazel-bin/pkg/proto/*/go_default_library_/github.com/scionproto/scion/pkg/proto/* bazel build --output_groups=go_generated_srcs //pkg/proto/... diff --git a/acceptance/router_benchmark/BUILD.bazel b/acceptance/router_benchmark/BUILD.bazel index 420219394b..ce3b4f4468 100644 --- a/acceptance/router_benchmark/BUILD.bazel +++ b/acceptance/router_benchmark/BUILD.bazel @@ -53,6 +53,13 @@ py_library( py_binary( name = "benchmark", srcs = ["benchmark.py"], + args = [ + "--brload", + "$(location //acceptance/router_benchmark/brload:brload)", + ], + data = [ + "//acceptance/router_benchmark/brload", + ], visibility = ["//visibility:public"], deps = [ "benchmarklib", diff --git a/acceptance/router_benchmark/benchmark.py b/acceptance/router_benchmark/benchmark.py index 9f942b1e92..ccb73e83d3 100755 --- a/acceptance/router_benchmark/benchmark.py +++ b/acceptance/router_benchmark/benchmark.py @@ -86,19 +86,22 @@ class RouterBMTool(cli.Application, RouterBM): log_level = cli.SwitchAttr(["l", "loglevel"], str, default='warning', help="Logging level") doit = cli.Flag(["r", "run"], - help="Run the benchmark, as opposed to seeing the instructions.") + help="Run the benchmark, as opposed to seeing the instructions") json = cli.Flag(["j", "json"], - help="Output the report in json format.") + help="Output the report in json format") # Used by the RouterBM mixin: coremark = cli.SwitchAttr(["c", "coremark"], int, default=0, - help="The coremark score of the subject machine.") + help="The coremark score of the subject machine") mmbm = cli.SwitchAttr(["m", "mmbm"], int, default=0, - help="The mmbm score of the subject machine.") + help="The mmbm score of the subject machine") packet_size = cli.SwitchAttr(["s", "size"], int, default=172, - help="Test packet size (includes all headers - floored at 154).") + help="Test packet size (includes all headers - floored at 154)") + brload_path = cli.SwitchAttr(["b", "brload"], str, default="bin/brload", + help="Relative path to the brload tool") + intf_map: dict[str, Intf] = {} - brload: LocalCommand = local["./bin/brload"] + brload: LocalCommand = None brload_cpus: list[int] = [] artifacts = f"{os.getcwd()}/acceptance/router_benchmark" prom_address: str = "localhost:9090" @@ -332,6 +335,9 @@ def instructions(self): """) def main(self, *interfaces: str): + # brload cannot be set statically. It need the cli arguments to be + # processed. + self.brload = local[self.brload_path] status = 1 try: logging.basicConfig(level=self.log_level.upper()) diff --git a/scion.sh b/scion.sh index 2d92c5d14f..a21b45b278 100755 --- a/scion.sh +++ b/scion.sh @@ -23,11 +23,11 @@ cmd_topology() { cmd_topo-clean echo "Create topology, configuration, and execution files." - tools/topogen.py "$@" + ./bin/topogen "$@" } cmd_topodot() { - ./tools/topodot.py "$@" + ./bin/topodot "$@" } start_scion() { diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel index 778182bbcf..ed0d466f8b 100644 --- a/tools/BUILD.bazel +++ b/tools/BUILD.bazel @@ -45,3 +45,34 @@ py_binary( requirement("pyyaml"), ], ) + +py_binary( + name = "topodot", + srcs = ["topodot.py"], + data = [ + ], + main = "topodot.py", + python_version = "PY3", + srcs_version = "PY3", + visibility = ["//visibility:public"], + deps = [ + "//tools/topology:py_default_library", + "@bazel_tools//tools/python/runfiles", + requirement("plumbum"), + ], +) + +py_binary( + name = "set_ipv6_addr", + srcs = ["set_ipv6_addr.py"], + data = [ + ], + main = "set_ipv6_addr.py", + python_version = "PY3", + srcs_version = "PY3", + visibility = ["//visibility:public"], + deps = [ + "//tools/topology:py_default_library", + "@bazel_tools//tools/python/runfiles", + ], +) From 74a9bda44bd19a7cba700823caaf59b7bf9cf014 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Hugly Date: Tue, 29 Oct 2024 19:26:58 +0100 Subject: [PATCH 06/10] Fix python lint. For some very mysterious reasons, flake8 gets broken by build_python_zip. I have never been able to find how exactly flake8 is made as a py binary because its creations is mediated by 6 layers of bazel code generation. But it is indeed made during the build. If I turn build_python_zip ON for the "build" config only, then flake8 is still broken, but if I turn it ON everywhere except for the "test:lint" config, then flake8 works. That makes no sense to me, but I'll be content with that. Life is short and I am sick of spending mine trying to deconstruct bazel and python frivolous and broken magic. --- .bazelrc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.bazelrc b/.bazelrc index 99ca68a9bd..747117976d 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,5 +1,5 @@ ### common options for all subcommands (help, query, build, ...) -common --show_timestamps --enable_platform_specific_config +common --show_timestamps --enable_platform_specific_config --build_python_zip # connect to buchgr/bazel-remote cache # These flags can unfortunately not be specified for `common`, as they are not accepted by all subcommands (help, version, dump) @@ -18,7 +18,6 @@ build --incompatible_default_to_explicit_init_py # Enable resolution of cc toolchain by go toolchain build --incompatible_enable_cc_toolchain_resolution build --flag_alias=file_name_version=//:file_name_version -build --build_python_zip # include one of "--define gotags=sqlite_mattn" or "--define gotags=sqlite_modernc" # cannot be in common, because query chokes on it. @@ -36,7 +35,7 @@ test:unit_all --config=unit //... test:integration --test_tag_filters=integration,-lint test:integration_all --config=integration //... -test:lint --test_tag_filters=lint,write_src --test_summary=terse --noshow_progress --experimental_convenience_symlinks=ignore +test:lint --test_tag_filters=lint,write_src --test_summary=terse --noshow_progress --experimental_convenience_symlinks=ignore --nobuild_python_zip # run quietly, only display errors common:quiet --ui_event_filters=-warning,-info,-debug,-stdout,-stderr --noshow_progress From 56ff27e2f043398fdb90450daca0a2fda8e5ebe6 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Hugly Date: Wed, 30 Oct 2024 13:55:18 +0100 Subject: [PATCH 07/10] Suppress zip py_binary for all tests. It breaks runfiles, somehow, and is not needed. --- .bazelrc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.bazelrc b/.bazelrc index 747117976d..5ac68e7012 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,5 +1,5 @@ ### common options for all subcommands (help, query, build, ...) -common --show_timestamps --enable_platform_specific_config --build_python_zip +common --show_timestamps --enable_platform_specific_config # connect to buchgr/bazel-remote cache # These flags can unfortunately not be specified for `common`, as they are not accepted by all subcommands (help, version, dump) @@ -18,6 +18,7 @@ build --incompatible_default_to_explicit_init_py # Enable resolution of cc toolchain by go toolchain build --incompatible_enable_cc_toolchain_resolution build --flag_alias=file_name_version=//:file_name_version +build --build_python_zip # include one of "--define gotags=sqlite_mattn" or "--define gotags=sqlite_modernc" # cannot be in common, because query chokes on it. @@ -25,7 +26,7 @@ build --define gotags=sqlite_modernc,netgo build:osx --define gotags=sqlite_modernc ### options for test -test --build_tests_only --print_relative_test_log_paths --test_output=errors +test --build_tests_only --print_relative_test_log_paths --test_output=errors --nobuild_python_zip ### predefined configurations (use with --config, eg. `bazel test --config=unit_all`) test:race --@io_bazel_rules_go//go/config:race @@ -35,7 +36,7 @@ test:unit_all --config=unit //... test:integration --test_tag_filters=integration,-lint test:integration_all --config=integration //... -test:lint --test_tag_filters=lint,write_src --test_summary=terse --noshow_progress --experimental_convenience_symlinks=ignore --nobuild_python_zip +test:lint --test_tag_filters=lint,write_src --test_summary=terse --noshow_progress --experimental_convenience_symlinks=ignore # run quietly, only display errors common:quiet --ui_event_filters=-warning,-info,-debug,-stdout,-stderr --noshow_progress From 744d4479a34a64d101547127511bd13afe0f19f5 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Hugly Date: Wed, 30 Oct 2024 15:36:23 +0100 Subject: [PATCH 08/10] More sh->python use: supervisor.sh. Deal with more bazel/python non-sense. py_binary cannot be made with an imported entry point. There has to be a redundant local wrapper. --- BUILD.bazel | 5 ++++- tools/BUILD.bazel | 20 ++++++++++++++++++++ tools/supervisor.sh | 4 ++-- tools/supervisorctl.py | 13 +++++++++++++ tools/supervisord.py | 13 +++++++++++++ 5 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 tools/supervisorctl.py create mode 100644 tools/supervisord.py diff --git a/BUILD.bazel b/BUILD.bazel index 02a6db587e..1747ab5b59 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -209,13 +209,16 @@ pkg_tar( package_dir = "", ) -# This contains all of the binaries needed to run the topology generator. +# This contains all of the binaries needed to run the topology generator +# and start a local stack. pkg_tar( name = "scion-topo", srcs = [ "//tools:set_ipv6_addr", "//tools:topodot", "//tools:topogen", + "//tools:supervisord", + "//tools:supervisorctl", ], mode = "0755", ) diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel index ed0d466f8b..cf9f52d6f8 100644 --- a/tools/BUILD.bazel +++ b/tools/BUILD.bazel @@ -26,6 +26,26 @@ py_binary( ], ) +py_binary( + name = "supervisord", + srcs = ["supervisord.py"], + deps = [ + requirement("supervisor"), + requirement("supervisor-wildcards"), + ], + visibility = ["//visibility:public"], +) + +py_binary( + name = "supervisorctl", + srcs = ["supervisorctl.py"], + deps = [ + requirement("supervisor"), + requirement("supervisor-wildcards"), + ], + visibility = ["//visibility:public"], +) + py_binary( name = "topogen", srcs = ["topogen.py"], diff --git a/tools/supervisor.sh b/tools/supervisor.sh index 8a1a7bd62d..d19677700c 100755 --- a/tools/supervisor.sh +++ b/tools/supervisor.sh @@ -6,7 +6,7 @@ mkdir -p logs OPTIONS="$@" CONF_FILE="tools/supervisord.conf" if [ ! -e /tmp/supervisor.sock ]; then - supervisord -c $CONF_FILE + bin/supervisord -c $CONF_FILE fi -supervisorctl -c $CONF_FILE $OPTIONS +bin/supervisorctl -c $CONF_FILE $OPTIONS diff --git a/tools/supervisorctl.py b/tools/supervisorctl.py new file mode 100644 index 0000000000..d3ea1950ab --- /dev/null +++ b/tools/supervisorctl.py @@ -0,0 +1,13 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- + +# This is exact replica of supervisord's entry point because I haven't +# found an intelligible way of creating a py_binary target that doesn't +# define its own entry point. + +import re +import sys +from supervisor.supervisorctl import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/tools/supervisord.py b/tools/supervisord.py new file mode 100644 index 0000000000..1be5b943a6 --- /dev/null +++ b/tools/supervisord.py @@ -0,0 +1,13 @@ +# !/usr/bin/python3 +# -*- coding: utf-8 -*- + +# This is exact replica of supervisord's entry point because I haven't +# found an intelligible way of creating a py_binary target that doesn't +# define its own entry point. + +import re +import sys +from supervisor.supervisord import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) From 0a4a989be804b9467f6f25a5d38d937f95d4d302 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Hugly Date: Wed, 30 Oct 2024 15:52:11 +0100 Subject: [PATCH 09/10] Satisfy lint, the small-minded enforcer. --- BUILD.bazel | 4 ++-- tools/BUILD.bazel | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 1747ab5b59..ac12e7d60a 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -215,10 +215,10 @@ pkg_tar( name = "scion-topo", srcs = [ "//tools:set_ipv6_addr", + "//tools:supervisorctl", + "//tools:supervisord", "//tools:topodot", "//tools:topogen", - "//tools:supervisord", - "//tools:supervisorctl", ], mode = "0755", ) diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel index cf9f52d6f8..18885bc282 100644 --- a/tools/BUILD.bazel +++ b/tools/BUILD.bazel @@ -29,21 +29,21 @@ py_binary( py_binary( name = "supervisord", srcs = ["supervisord.py"], + visibility = ["//visibility:public"], deps = [ requirement("supervisor"), requirement("supervisor-wildcards"), ], - visibility = ["//visibility:public"], ) py_binary( name = "supervisorctl", srcs = ["supervisorctl.py"], + visibility = ["//visibility:public"], deps = [ requirement("supervisor"), requirement("supervisor-wildcards"), ], - visibility = ["//visibility:public"], ) py_binary( From fec5ebee46b1f9acb86287b8c4469667732a26f8 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Hugly Date: Wed, 30 Oct 2024 17:43:57 +0100 Subject: [PATCH 10/10] Replace hand-made python entry-points with using py_console_script_binary. --- tools/BUILD.bazel | 11 +++++------ tools/supervisorctl.py | 13 ------------- tools/supervisord.py | 13 ------------- 3 files changed, 5 insertions(+), 32 deletions(-) delete mode 100644 tools/supervisorctl.py delete mode 100644 tools/supervisord.py diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel index 18885bc282..1184f3669c 100644 --- a/tools/BUILD.bazel +++ b/tools/BUILD.bazel @@ -1,5 +1,6 @@ load("@rules_python//python:defs.bzl", "py_binary") load("@com_github_scionproto_scion_python_deps//:requirements.bzl", "requirement") +load("@rules_python//python/entry_points:py_console_script_binary.bzl", "py_console_script_binary") exports_files([ "gzip_exec_interp", @@ -26,22 +27,20 @@ py_binary( ], ) -py_binary( +py_console_script_binary( name = "supervisord", - srcs = ["supervisord.py"], + pkg = requirement("supervisor"), visibility = ["//visibility:public"], deps = [ - requirement("supervisor"), requirement("supervisor-wildcards"), ], ) -py_binary( +py_console_script_binary( name = "supervisorctl", - srcs = ["supervisorctl.py"], + pkg = requirement("supervisor"), visibility = ["//visibility:public"], deps = [ - requirement("supervisor"), requirement("supervisor-wildcards"), ], ) diff --git a/tools/supervisorctl.py b/tools/supervisorctl.py deleted file mode 100644 index d3ea1950ab..0000000000 --- a/tools/supervisorctl.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/python3 -# -*- coding: utf-8 -*- - -# This is exact replica of supervisord's entry point because I haven't -# found an intelligible way of creating a py_binary target that doesn't -# define its own entry point. - -import re -import sys -from supervisor.supervisorctl import main -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(main()) diff --git a/tools/supervisord.py b/tools/supervisord.py deleted file mode 100644 index 1be5b943a6..0000000000 --- a/tools/supervisord.py +++ /dev/null @@ -1,13 +0,0 @@ -# !/usr/bin/python3 -# -*- coding: utf-8 -*- - -# This is exact replica of supervisord's entry point because I haven't -# found an intelligible way of creating a py_binary target that doesn't -# define its own entry point. - -import re -import sys -from supervisor.supervisord import main -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(main())