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: fix py versions in buildroot builds #12235

Merged
merged 2 commits into from
Mar 6, 2023

Commits on Mar 6, 2023

  1. build: fix py versions in buildroot builds

    The python version numbers are now generated from git tags. That means
    you have to run git commands with a cwd inside the git directory. While
    building on buildroot, this was not happening because when buildroot
    builds out-of-tree projects it does so after first rsync'ing their
    contents (i.e. _not_ the .git directory) into the build directory.
    
    That means that when we called the version machinery in the buildroot
    make scripts to do things like create /etc/VERSION.json everything
    worked, because those makefiles explicitly ran the script in the
    external tree; but when buildroot called setup.py build, that happened
    in the build directory which is inside the buildroot directory and
    therefore the scripts would pick up the latest tag _from buildroot_,
    since that tag scheme matches the robot-stack tag scheme.
    
    The way to fix this is to make sure the version runs inside the
    source directory when building on buildroot. This could be done a couple
    ways; in my opinion, this is a nice combination of minimally altering
    the python code that is reused outside of buildroot while still keeping
    things obvious: adding an optional environment variable respected by the
    setup.pys (rather than the build script, which would make the
    environment variable hard to find) that can change the location of the
    git calls.
    sfoster1 committed Mar 6, 2023
    Configuration menu
    Copy the full SHA
    6f6046d View commit details
    Browse the repository at this point in the history
  2. format

    sfoster1 committed Mar 6, 2023
    Configuration menu
    Copy the full SHA
    55a4dbb View commit details
    Browse the repository at this point in the history