Use a (mostly) hermetic Python interpreter
It still requires python to be installed on the host to run the wrapper
scripts, but it's close to being fully hermetic.
This also requires/enables the following changes, unfortunately all at
the same time:
* Use a downloaded f2py
* Use a downloaded scipy/numpy/matplotlib
* Fix a few things that don't run with the python version in their #!
* Stop using bazel-generated __init__.py files, because those interfere
with importing matplotlib nicely
Change-Id: Ife280464613d67cece9587b7d947f0b1d5466d7e
diff --git a/y2017/BUILD b/y2017/BUILD
index d202064..f294aaa 100644
--- a/y2017/BUILD
+++ b/y2017/BUILD
@@ -1,120 +1,126 @@
-load('//aos/downloader:downloader.bzl', 'aos_downloader')
+load("//aos/downloader:downloader.bzl", "aos_downloader")
cc_library(
- name = 'constants',
- visibility = ['//visibility:public'],
- srcs = [
- 'constants.cc',
- ],
- hdrs = [
- 'constants.h',
- ],
- deps = [
- '//aos/common/logging',
- '//aos/common/network:team_number',
- '//aos/common:mutex',
- '//aos:once',
- '//frc971:constants',
- '//frc971/shooter_interpolation:interpolation',
- '//y2017/control_loops/drivetrain:polydrivetrain_plants',
- '//y2017/control_loops/superstructure/column:column_plants',
- '//y2017/control_loops/superstructure/hood:hood_plants',
- '//y2017/control_loops/superstructure/intake:intake_plants',
- '//y2017/control_loops/superstructure/shooter:shooter_plants',
- ],
+ name = "constants",
+ srcs = [
+ "constants.cc",
+ ],
+ hdrs = [
+ "constants.h",
+ ],
+ visibility = ["//visibility:public"],
+ deps = [
+ "//aos:once",
+ "//aos/common:mutex",
+ "//aos/common/logging",
+ "//aos/common/network:team_number",
+ "//frc971:constants",
+ "//frc971/shooter_interpolation:interpolation",
+ "//y2017/control_loops/drivetrain:polydrivetrain_plants",
+ "//y2017/control_loops/superstructure/column:column_plants",
+ "//y2017/control_loops/superstructure/hood:hood_plants",
+ "//y2017/control_loops/superstructure/intake:intake_plants",
+ "//y2017/control_loops/superstructure/shooter:shooter_plants",
+ ],
)
cc_binary(
- name = 'joystick_reader',
- srcs = [
- 'joystick_reader.cc',
- ],
- deps = [
- ':constants',
- '//aos/common/actions:action_lib',
- '//aos/common/logging',
- '//aos/common/util:log_interval',
- '//aos/common:time',
- '//aos/input:joystick_input',
- '//aos/input:drivetrain_input',
- '//aos/linux_code:init',
- '//frc971/autonomous:auto_queue',
- '//frc971/control_loops/drivetrain:drivetrain_queue',
- '//y2017/actors:autonomous_action_lib',
- '//y2017/control_loops/superstructure:superstructure_queue',
- '//y2017/control_loops/drivetrain:drivetrain_base',
- ],
+ name = "joystick_reader",
+ srcs = [
+ "joystick_reader.cc",
+ ],
+ deps = [
+ ":constants",
+ "//aos/common:time",
+ "//aos/common/actions:action_lib",
+ "//aos/common/logging",
+ "//aos/common/util:log_interval",
+ "//aos/input:drivetrain_input",
+ "//aos/input:joystick_input",
+ "//aos/linux_code:init",
+ "//frc971/autonomous:auto_queue",
+ "//frc971/control_loops/drivetrain:drivetrain_queue",
+ "//y2017/actors:autonomous_action_lib",
+ "//y2017/control_loops/drivetrain:drivetrain_base",
+ "//y2017/control_loops/superstructure:superstructure_queue",
+ ],
)
cc_binary(
- name = 'wpilib_interface',
- srcs = [
- 'wpilib_interface.cc',
- ],
- deps = [
- ':constants',
- '//aos/common:stl_mutex',
- '//aos/common/logging',
- '//aos/common:math',
- '//aos/common/controls:control_loop',
- '//aos/common/util:log_interval',
- '//aos/common:time',
- '//aos/common/logging:queue_logging',
- '//aos/common/messages:robot_state',
- '//aos/common/util:phased_loop',
- '//aos/common/util:wrapping_counter',
- '//aos/linux_code:init',
- '//third_party:wpilib',
- '//frc971/autonomous:auto_queue',
- '//frc971/control_loops/drivetrain:drivetrain_queue',
- '//frc971/control_loops:queues',
- '//frc971/wpilib:joystick_sender',
- '//frc971/wpilib:loop_output_handler',
- '//frc971/wpilib:buffered_pcm',
- '//frc971/wpilib:dma_edge_counting',
- '//frc971/wpilib:interrupt_edge_counting',
- '//frc971/wpilib:wpilib_robot_base',
- '//frc971/wpilib:encoder_and_potentiometer',
- '//frc971/wpilib:logging_queue',
- '//frc971/wpilib:wpilib_interface',
- '//frc971/wpilib:pdp_fetcher',
- '//frc971/wpilib:ADIS16448',
- '//frc971/wpilib:dma',
- '//y2017/control_loops/superstructure:superstructure_queue',
- ],
- restricted_to = ['//tools:roborio'],
+ name = "wpilib_interface",
+ srcs = [
+ "wpilib_interface.cc",
+ ],
+ restricted_to = ["//tools:roborio"],
+ deps = [
+ ":constants",
+ "//aos/common:math",
+ "//aos/common:stl_mutex",
+ "//aos/common:time",
+ "//aos/common/controls:control_loop",
+ "//aos/common/logging",
+ "//aos/common/logging:queue_logging",
+ "//aos/common/messages:robot_state",
+ "//aos/common/util:log_interval",
+ "//aos/common/util:phased_loop",
+ "//aos/common/util:wrapping_counter",
+ "//aos/linux_code:init",
+ "//frc971/autonomous:auto_queue",
+ "//frc971/control_loops:queues",
+ "//frc971/control_loops/drivetrain:drivetrain_queue",
+ "//frc971/wpilib:ADIS16448",
+ "//frc971/wpilib:buffered_pcm",
+ "//frc971/wpilib:dma",
+ "//frc971/wpilib:dma_edge_counting",
+ "//frc971/wpilib:encoder_and_potentiometer",
+ "//frc971/wpilib:interrupt_edge_counting",
+ "//frc971/wpilib:joystick_sender",
+ "//frc971/wpilib:logging_queue",
+ "//frc971/wpilib:loop_output_handler",
+ "//frc971/wpilib:pdp_fetcher",
+ "//frc971/wpilib:wpilib_interface",
+ "//frc971/wpilib:wpilib_robot_base",
+ "//third_party:wpilib",
+ "//y2017/control_loops/superstructure:superstructure_queue",
+ ],
)
aos_downloader(
- name = 'download',
- start_srcs = [
- ':joystick_reader',
- ':wpilib_interface',
- '//aos:prime_start_binaries',
- '//y2017/actors:autonomous_action',
- '//y2017/control_loops/drivetrain:drivetrain',
- '//y2017/control_loops/superstructure:superstructure',
- '//y2017/vision:target_receiver',
- ],
- srcs = [
- '//aos:prime_binaries',
- ],
- restricted_to = ['//tools:roborio'],
+ name = "download",
+ srcs = [
+ "//aos:prime_binaries",
+ ],
+ restricted_to = ["//tools:roborio"],
+ start_srcs = [
+ ":joystick_reader",
+ ":wpilib_interface",
+ "//aos:prime_start_binaries",
+ "//y2017/actors:autonomous_action",
+ "//y2017/control_loops/drivetrain:drivetrain",
+ "//y2017/control_loops/superstructure:superstructure",
+ "//y2017/vision:target_receiver",
+ ],
)
aos_downloader(
- name = 'download_stripped',
- start_srcs = [
- ':joystick_reader.stripped',
- ':wpilib_interface.stripped',
- '//aos:prime_start_binaries_stripped',
- '//y2017/actors:autonomous_action.stripped',
- '//y2017/control_loops/drivetrain:drivetrain.stripped',
- '//y2017/control_loops/superstructure:superstructure.stripped',
- '//y2017/vision:target_receiver.stripped',
- ],
- srcs = [
- '//aos:prime_binaries_stripped',
- ],
- restricted_to = ['//tools:roborio'],
+ name = "download_stripped",
+ srcs = [
+ "//aos:prime_binaries_stripped",
+ ],
+ restricted_to = ["//tools:roborio"],
+ start_srcs = [
+ ":joystick_reader.stripped",
+ ":wpilib_interface.stripped",
+ "//aos:prime_start_binaries_stripped",
+ "//y2017/actors:autonomous_action.stripped",
+ "//y2017/control_loops/drivetrain:drivetrain.stripped",
+ "//y2017/control_loops/superstructure:superstructure.stripped",
+ "//y2017/vision:target_receiver.stripped",
+ ],
+)
+
+py_library(
+ name = "python_init",
+ srcs = ["__init__.py"],
+ visibility = ["//visibility:public"],
)