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

Add Ubuntu package scripts #5754

Merged
merged 4 commits into from May 17, 2021
Merged

Add Ubuntu package scripts #5754

merged 4 commits into from May 17, 2021

Conversation

alexreinking
Copy link
Member

@alexreinking alexreinking commented Feb 17, 2021

This PR would add long-awaited Ubuntu package scripts!

Ubuntu

The Ubuntu package is split into runtime, development, and documentation components. Development naturally depends on runtime. The packages have standard names: libhalideV, libhalideV-dev, and libhalideV-doc where V is the major version (also the SOVERSION). Naturally, they link to system LLVM.

I had created a PPA we can use but apparently launchpad wants source debs instead of binary debs. These have a weird, special format that's poorly documented and---once unpacked---passes through nearly a dozen bespoke debian packaging tools to compile our sources from scratch and feed them through their packaging pipeline. So that's not happening when we can just publish our perfectly good CPack-generated debs on a private APT repo.

GitHub Actions

There is testing for the Ubuntu packages. We create a GHA VM with developer tools for building and packaging Halide, then save the packages to scratch storage before creating a second, fresh VM with a minimal set of tools. The second VM installs the packages and then tests a very basic pipeline in a wide variety of build scenarios to test that our CMake package works as expected and without any special setup. These tests are located in test/integration.

To-dos

  • Verify Ubuntu package dependencies
  • GHA testing
    • Test Ubuntu package
      • Test JIT with shared/static
      • Test AOT with shared/static
      • Test AOT error when attempting to use an autoscheduler and static linking
      • Test JIT with both shared and static
      • Test AOT cross-compile
  • Update buildbots to call TGZ / ZIP packaging scripts by their new names.

Fixes #5285

@alexreinking
Copy link
Member Author

By the way, I think that GHA would be the ideal place to test these packages if we decide only to support them on common hosts (ie. i686 and/or amd64). It should build Halide in one step, save the binary packages as an artifact, spawn a new, clean VM, and then try installing the package and building / running the apps in a second step.

@alexreinking alexreinking added the backport me This change should be backported to release versions label Feb 17, 2021
@alexreinking alexreinking added this to In progress in Build system improvements via automation Feb 17, 2021
@alexreinking alexreinking self-assigned this Feb 17, 2021
@steven-johnson
Copy link
Contributor

By the way, I think that GHA would be the ideal place to test these packages if we decide only to support them on common hosts (ie. i686 and/or amd64).

OK for now, though I predict that it will be desirable to have aarch64 support for Nuget (at least) in the medium-term future.

@steven-johnson
Copy link
Contributor

I have created a PPA we can use here: https://launchpad.net/~alexreinking/+archive/ubuntu/halide (we might want a more-official one, but the setup involves creating GPG keys and tying it to an email address, so that was difficult to do without coordination).

Definitely worth looking into a location we'd be happy(er) to support longterm, but that can wait till everything else is done. (Something at halide-lang.org seems the obvious option.)

Copy link
Contributor

@steven-johnson steven-johnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

packaging/CMakeLists.txt Outdated Show resolved Hide resolved
packaging/Description.txt Outdated Show resolved Hide resolved
src/autoschedulers/adams2019/autotune_loop.sh Outdated Show resolved Hide resolved
@alexreinking alexreinking force-pushed the cpack/debian branch 5 times, most recently from 43de6e2 to b67e378 Compare February 18, 2021 21:47
@alexreinking
Copy link
Member Author

The changelist was getting crazy, so I completely redid the history so you can understand the different parts of this PR better. Some things—like the spelling fixes and #! in autotune_loop.sh—could be split into a separate PR if that would make reviewing this easier. Those changes were made, however, because lintian discovered them.

@alexreinking
Copy link
Member Author

Running into this with my cross-compiling efforts. It would be nice if we had some MinGW compatibility again... https://metricpanda.com/rival-fortress-update-45-dealing-with-__chkstk-__chkstk_ms-when-cross-compiling-for-windows/

@steven-johnson
Copy link
Contributor

It would be nice if we had some MinGW compatibility again

Gonna get a hard no on that from me. MinGW is a big pain to support and appears to be an environment rapidly losing mindshare.

@alexreinking alexreinking changed the title Add Ubuntu and Nuget package scripts Add Ubuntu package scripts May 15, 2021
@alexreinking alexreinking force-pushed the cpack/debian branch 3 times, most recently from d79ecdf to ddc5893 Compare May 15, 2021 09:55
@alexreinking alexreinking marked this pull request as ready for review May 15, 2021 10:17
@alexreinking
Copy link
Member Author

alexreinking commented May 15, 2021

Okay, this is finally ready!

I've moved the Nuget stuff into a separate branch (cpack/nuget) since I'm stuck reverse engineering the package format. This is largely undocumented territory, unfortunately.

I'm cross compiling from amd64 Linux to aarch64 Linux and testing with Qemu.

There will probably be a follow-up PR to this where I address the extra lintian checks, write some man pages, etc. but this is at a point where I'm comfortable merging it, using the Ubuntu packages myself, and (finally) cutting Halide 12.

@alexreinking alexreinking requested review from halidebuildbots and removed request for halidebuildbots May 15, 2021 10:32
Build system improvements automation moved this from In progress to Done May 15, 2021
@alexreinking alexreinking reopened this May 15, 2021
Build system improvements automation moved this from Done to In progress May 15, 2021
@alexreinking alexreinking removed the skip_buildbots Synonym for buildbot_test_nothing label May 15, 2021
@alexreinking alexreinking requested review from halidebuildbots and removed request for halidebuildbots May 15, 2021 10:42

# Package dependencies.
# TODO: figure out how to get LLVM major version piped in here.
set(CPACK_DEBIAN_HALIDE_RUNTIME_PACKAGE_DEPENDS "llvm-11 (>= 11.0.0)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this for packaging Halide 11 or Halide 12? (Halide 12 will compile against LLVM11, but should probably preferentially be packaged with LLVM12.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ubuntu 20.04 LTS doesn't package LLVM 12, but it does come with LLVM 11. Maybe it would work to set up LLVM's apt repo, but I think this work can be done in a separate PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might also be worth backporting these changes to v11 to provide Halide 11 + LLVM 11 packages on Ubuntu 20.04.

packaging/ubuntu/package.sh Outdated Show resolved Hide resolved
@alexreinking alexreinking merged commit b45caa8 into master May 17, 2021
Build system improvements automation moved this from In progress to Done May 17, 2021
@alexreinking alexreinking deleted the cpack/debian branch May 17, 2021 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Create Debian packages
2 participants