Turning the v80++ linker into a well-behaved Python package#73
Merged
quetric merged 40 commits intoXilinx:devfrom May 6, 2026
Merged
Turning the v80++ linker into a well-behaved Python package#73quetric merged 40 commits intoXilinx:devfrom
quetric merged 40 commits intoXilinx:devfrom
Conversation
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
…shly in the linker's "install" subcommand Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
…ky 9 Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
… in docker Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
…ot design build skip Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <joo@mail.uni-paderborn.de>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Author
|
As agreed, I have renamed v80pp/v80++/"the linker" into "slashkit." I will run a full build to verify that this doesn't break anything and report back. |
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR converts the v80++ linker from a hand-rolled, two-mode script into a proper Python package (
v80pp) with its resources shipped as package data and itsv80++entry point generated by the packaging backend. As a consequence, the source-tree and installation modes converge, the bespoke "find a Python interpreter, vendor jinja2/markupsafe, copy resources, write a shim" logic in the packaging scripts disappears, the AVED git submodule moves out of the linker's source tree, and the supported Python version drops to the system default on both Ubuntu 22.04 and Rocky 9 (3.10 and 3.9 respectively). To verify the new packaging end-to-end without an actual installation, this PR also introduces minimal Ubuntu/Rocky Dockerfiles and a singlescripts/run-with-docker.shentry point that can both build the packages inside a container and spin up a clean container with those packages installed.Motivation
My current primary goal is adding integration tests to SLASH. These tests should exercise the software stack as close to a real installation as possible. However, I do not have access to Docker on Otus compute nodes and cannot create new Singularity containers there, so the tests have to run without an actual installation step — but they still need to look like a proper installed setup.
The biggest obstacle to that is the linker's deployment model. Today it assumes one of two scenarios:
linker's source files (
Path(__file__).parent.parent.parent / "resources").well-defined location like
/usr/share/v80++.On top of that, the packaging step does several things that the source-tree mode does not:
jinja2/markupsafeare not available as packages for those interpreters on Rocky 9.v80++shell script that searches for the best Python interpreter on the system and uses it to invokemain.py.The net effect is that a non-trivial set of behaviors and edge cases only exists in the packaged form: running from the source tree is too different from running from an installed package to be a useful proxy in tests.
It would be much better if the linker were a well-behaved Python package:
v80++entry-point script can be created by pip / the packaging backend, with the correct Python interpreter baked in.Changes
Turn the linker into a well-behaved Python package
v80ppmodulelinker/src/tolinker/v80pp/.main.pyto__main__.py.v80pp.where necessary.cd linker && python -m v80ppto run the linker.v80pp.resourcesmoduleimportlib.resources.importlib.resourcesinstead of as filesystem paths.*_build.tclscripts used to receive the entire resource directory as an argument and pull what they needed out of it.submodules/AVED(top-level) and changed the linker'sinstallsubcommand to clone AVED from GitHub into its build directory.pyproject.tomlto turnv80ppinto a real Python packagev80ppmodule — no more handwritten interpreter search in a shell shim.Integrate the
v80ppPython package into the packaging systemroot-design-build.shnow just runs the linker as a Python module from thelinkerdirectory.pbuild.shthen builds thev80ppwheel.pinstall.shthen installs thev80ppwheel into the destination directory.pipfor building the wheel — Rocky's defaultpipis too old./usr/local/to/usr/on Ubuntu — Ubuntu'spipignores the requested/usr/prefix and unpacks under/usr/local/regardless.v80++shim" logic is gone.python3-jinja2is only available for the default Python interpreter, which is version 3.9.jinja2andmarkupsafecan therefore be removed.Dockerfiles for packaging and running the linker