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

Support building packages on noble #7273

Merged
merged 9 commits into from
Oct 29, 2024
Merged

Support building packages on noble #7273

merged 9 commits into from
Oct 29, 2024

Conversation

legoktm
Copy link
Member

@legoktm legoktm commented Oct 23, 2024

Status

Ready for review

Description of Changes

Basically this adds support for building noble packages without breaking focal builds. It's not exactly but is practically a no-op for focal. The packages have not been tested to work, just that they roughly look right (which should be sufficient for merging, fixes will come later, we just need this in place to actually test the rest of the system).

See commit messages for individual changes.

Refs #7210

Testing

How should the reviewer test this PR?

  • Try out UBUNTU_VERSION=noble make build-debs
  • Also UBUNTU_VERSION=noble make build-debs-ossec
  • CI passes (esp. staging build, which should verify no focal regressions)

Deployment

Any special considerations for deployment? Should be a no-op for focal.

Checklist

  • Linting (make lint) and tests (make test) pass in the development container
  • Configuration tests pass
  • I have written a test plan and validated it for this PR
  • These changes do not require documentation
  • I have performed a diff review and pasted the contents to the packaging wiki - n/a, pip and setuptools dependencies are exempt as they're maintained by PyPA

Add support for building packages on noble by setting
`UBUNTU_VERSION=noble` and passing that through the various layers to
build a OCI image on top of noble. The version suffix of +focal/+noble
is now automatically added using the fixup-changelog.sh script ported
from securedrop-client.

Tests now read the environment variable for finding the packages and
also determining what Python version is in use.
This is automatically pulled in by the `python3` dependency, and is
causes problems for noble packages, since that has libpython3.12.
* setuptools now wants an explicit `package` listing in setup.py, so
  provide it an empty one.
* babel no longer explicitly depends on setuptools, but it still needs
  it for `pybabel`, so add it into the translation-requirements.
* Use pip 24.2, like we upgraded to everywhere else.
`echo ""` adds a single blank line, which dh_conffiles treats as an
invalid file, which is an error in noble. If we have a fully empty file,
it is happy and still applies our hack.

Remove the duplicated dh_gencontrol stanza that was already being
overridden later while we're at it.
`-z muldefs` means "Allow multiple definitions of symbols".

See <ossec/ossec-hids#2022 (comment)>
for details; this can be removed if/when we upgrade to OSSEC 3.7.0.
Normally we're fine with just using ubuntu-latest, except they just
downgraded it, which is causing issues building on noble, so explicitly
specify 24.04 for now, and once it is always -latest, we can revert
this.

See <actions/runner-images#10636>.
@legoktm legoktm requested a review from a team as a code owner October 23, 2024 14:54
@legoktm legoktm added the noble Ubuntu Noble related work label Oct 23, 2024
@legoktm
Copy link
Member Author

legoktm commented Oct 25, 2024

The ossec-agent/ossec-server packages still have hardcoded libssl1.1 dependencies that need to be removed...

Instead of hardoding dependencies on specific libc and
libssl versions, Debian can automatically determine them
for us using dh_shlibs.
@zenmonkeykstop
Copy link
Contributor

Noble build failing, looks like we're not dropping libssl.1 that easily:

...
dpkg-shlibdeps: error: cannot find library libssl.so.1.1 needed by debian/securedrop-app-code/opt/venvs/securedrop-app-code/lib/python3.12/site-packages/redwood/redwood.cpython-38-x86_64-linux-gnu.so (ELF format: 'elf64-x86-64' abi: 'ELF:64:l:amd64:0'; RPATH: '')
...

Will poke at a bit on Monday.

@legoktm
Copy link
Member Author

legoktm commented Oct 25, 2024

Make sure you're building from a clean folder, there's some cache pollution across focal/noble builds that I thought I had fixed but I guess not.

Because we need to point to the exact path, which contains a number of
variables that vary based on the Python version.
Aside from the duplication of rules for Python 3.12, the /run pid file
now has a random string after it, so add a wildcard rule.
@legoktm
Copy link
Member Author

legoktm commented Oct 28, 2024

I tacked on the last two commits a bit late because I hit them when testing the actual packages; happy to drop them from this PR and submit them independently.

Copy link
Contributor

@zenmonkeykstop zenmonkeykstop left a comment

Choose a reason for hiding this comment

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

Builds succeeding across focal and noble, packages look... packagey.

@zenmonkeykstop zenmonkeykstop added this pull request to the merge queue Oct 29, 2024
Merged via the queue into develop with commit 886143d Oct 29, 2024
45 checks passed
@zenmonkeykstop zenmonkeykstop deleted the stg-noble-build branch October 30, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
noble Ubuntu Noble related work
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants