Add binary distribution (bindist) packaging for Ubuntu 24.04 x86_64#727
Add binary distribution (bindist) packaging for Ubuntu 24.04 x86_64#727Anamika1608 wants to merge 3 commits intop4lang:masterfrom
Conversation
|
Thank you for developing this. I will try this out some time in the next few days, and look it over a bit for reviewing it. One quick question: Is it quick and easy in the Dockerfile to enable this for processors with aarch64 architecture, too? I know that all of the projects build on aarch64 Ubuntu 24.04 Linux running in VirtualBox on an Apple Silicon Mac, so I'm hoping that is a fairly small change to what you have done so far. |
|
Welcome @Anamika1608! It looks like this is your first contribution. We noticed the DCO (Developer Certificate of Origin) check might fail if your commits aren't signed. To fix this, please ensure every commit has a For existing commits, you can fix them with: The Developer Community DCO guide also provides helpful tips on fixing DCO inconveniences. Setting a commit hook in the git repository will automate adding the DCO signoff. See https://github.com/p4lang/governance/wiki/P4-DCO-Guidelines for information. |
|
I tried checking out the branch with your changes on an x86_64 Ubuntu 24.04 Linux system running in VirtualBox. After installing docker, I ran this command: It appears that building the dependencies, behavioral-model, and p4c all succeeded, but there was a failure after that in copying some files around. See the attached log file. Have you run the command above successfully, without errors? |
Add Dockerfile and install script to build and distribute precompiled binaries of p4c and behavioral-model (simple_switch_grpc) as a single tar.gz archive for Ubuntu 24.04. Ref: p4lang/project-ideas#39 Signed-off-by: Anamika AggarwaL <anamikaagg18@gmail.com>
Brace expansion {bin,lib,share} is a bash feature that does not work
in Docker's /bin/sh. Replace with explicit mkdir calls for each
directory.
Signed-off-by: Anamika AggarwaL <anamikaagg18@gmail.com>
60fd2e7 to
2e371b1
Compare
p4c requires the GNU C preprocessor (cpp) at runtime to handle #include directives in P4 source files. Without it, compilation fails with "cpp: not found". Signed-off-by: Anamika <anamika@users.noreply.github.com> Signed-off-by: Anamika AggarwaL <anamikaagg18@gmail.com>
|
hi @jafingerhut, I pushed another fix, added cpp (GNU C preprocessor) to the runtime dependencies in I tested the full pipeline on a fresh Ubuntu 24.04 container: extract tarball → run install.sh → I wasn't able to do a complete end-to-end Dockerfile build on my machine since I'm on an Apple Silicon Regarding aarch64 -- yes, it should be a small change. The Dockerfile and build steps are
I can parameterize the architecture using Docker's TARGETARCH so a single Dockerfile handles both, or |
|
I tried following the instructions in the first comment with the version of this PR just after commit 3. There were no obvious errors from executing this command: I am attaching the log, in case it helps diagnose any issues. However, the next command gave an error, as shown below: Out of curiosity, I went ahead and tried the next command, which also gave an error: I suspect that if you switch your focus to implementing and testing this for aarch64 Ubuntu 24.04 Linux first, which you can run natively on your own computer, you can probably iterate such testing much faster than waiting for me to do so. (Note: I mean by running VirtualBox on your Apple Silicon Mac, and installing aarch64 Ubuntu 24.04 Linux as a VM on it. There is no need to boot Linux on the bare hardware. If you want instructions to assist in doing so, you can find them here: https://github.com/p4lang/tutorials/blob/master/vm-ubuntu-24.04/README-create-vm-using-iso-installer.md ) I would also recommend adding a bindist/README.md file to your PR that gives the sequence of commands to run, as after this PR is closed, no one will think to look here for them. |
This PR adds the initial infrastructure for creating a binary distribution (bindist) of p4c and behavioral-model for Ubuntu 24.04 x86_64, as discussed in p4lang/project-ideas#39.
What this adds
Two files under a new
bindist/directory:Dockerfile- Automates the full build pipeline:STATIC_BUILD_WITH_DYNAMIC_GLIBC=ONso the compiler binaries only depend on glibc$ORIGIN/../libfor relocatabilityp4-bindist-ubuntu2404-x86_64.tar.gzUsage (from the
tutorials/root):Specific versions can be pinned via build args:
install.sh- End-user install script included in the tarball. After extracting:It installs runtime apt dependencies (libboost, libgrpc, libprotobuf, libpcap, python3, etc.), copies binaries to
/usr/local/bin, copies bundled shared libraries (thrift, nanomsg, PI, BMv2 libs) to/usr/local/lib/p4-bindist, and updates RPATHs and ldconfig. Supports--prefixfor custom install location and--uninstallto remove everything.What the tarball contains
Testing done
I manually ran each build step inside a Docker container (Ubuntu 24.04 x86_64) and verified:
STATIC_BUILD_WITH_DYNAMIC_GLIBC=ONon Ubuntu 24.04 (this was previously only tested on 22.04 in CI)$ORIGIN/../libRPATHinstall.sh, bothp4c --versionandsimple_switch_grpc --versionwork correctlyStill to do
docker buildrun yet (each step was tested individually)Ref: p4lang/project-ideas#39