Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: do not run pip install outside the bazel build framework #4647

Merged
merged 11 commits into from
Oct 31, 2024

Commits on Oct 28, 2024

  1. 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).
    jiceatscion committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    88abeac View commit details
    Browse the repository at this point in the history
  2. 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.
    jiceatscion committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    5f95821 View commit details
    Browse the repository at this point in the history

Commits on Oct 29, 2024

  1. Configuration menu
    Copy the full SHA
    c4876df View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5bc8049 View commit details
    Browse the repository at this point in the history
  3. 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.
    jiceatscion committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    572cbc3 View commit details
    Browse the repository at this point in the history
  4. 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.
    jiceatscion committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    74a9bda View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2024

  1. Configuration menu
    Copy the full SHA
    56ff27e View commit details
    Browse the repository at this point in the history
  2. 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.
    jiceatscion committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    744d447 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0a4a989 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7e647f7 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    fec5ebe View commit details
    Browse the repository at this point in the history