Skip to content

Conversation

@hunsche
Copy link
Contributor

@hunsche hunsche commented Dec 1, 2025

Description

This PR migrates CIFuzz and ClusterFuzzLite to support Ubuntu 24.04. This allows projects to opt-in to a newer build environment by adding base_os_version: ubuntu-24-04 to their project.yaml.

Changes

  • Created new Dockerfiles for Ubuntu 24.04 support:
    • infra/cifuzz/cifuzz-base/ubuntu-24-04.Dockerfile
    • infra/build_fuzzers.ubuntu-24-04.Dockerfile
    • infra/run_fuzzers.ubuntu-24-04.Dockerfile
  • Updated infra/cifuzz/build-images.sh to build the new images.
  • Updated infra/cifuzz/build_fuzzers_entrypoint.py and infra/cifuzz/run_fuzzers_entrypoint.py to support pivoting to Ubuntu 24.04.
  • Updated infra/cifuzz/config_utils.py to handle the new base OS version.
  • Updated documentation in docs/getting-started/continuous_integration.md.

Evidence

Verified the changes by running an external project (zlib) with Ubuntu 24.04.

Build Log Snippet (Ubuntu 24.04)

=> [internal] load metadata for gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04
...
=> [5/5] COPY run_tests.sh build.sh *_fuzzer.c* /src/
...
Exit code: 0

Run Log Snippet

#3554   NEW    cov: 609 ft: 2821 corp: 466/57Mb lim: 933840 exec/s: 57 rss: 139Mb L: 195443/933840 MS: 3 InsertByte-ChangeASCIIInt-PersAutoDict- DE: "P?\000\000"-
...

@hunsche
Copy link
Contributor Author

hunsche commented Dec 1, 2025

/gcbrun trial_build.py zlib

def pivot_to_ubuntu_24_04(image_suffix, script_path, check_result=True):
"""Pivots execution to an Ubuntu 24.04 container if needed."""
with open('/etc/os-release') as file_handle:
if 'Noble Numbat' not in file_handle.read():
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe leave a comment what "Noble Numbat" is -- at least I had to look it up for it to make sense.

Copy link
Collaborator

Choose a reason for hiding this comment

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

nothing major though, am happy to land it without as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or just look for the string "24.04" instead :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion. I updated it to 24.04 to make it clearer what we are referring to.

Copy link
Collaborator

@DavidKorczynski DavidKorczynski left a comment

Choose a reason for hiding this comment

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

lgtm

@hunsche
Copy link
Contributor Author

hunsche commented Dec 1, 2025

/gcbrun trial_build.py zlib

@hunsche hunsche merged commit b0cacbd into master Dec 1, 2025
20 checks passed
@hunsche hunsche deleted the cifuzz-ubuntu-24-04-v2 branch December 1, 2025 23:59
```

For OSS-Fuzz projects, this file is located at `projects/<project_name>/project.yaml`.
For external projects (ClusterFuzzLite), this file is typically located at `.clusterfuzzlite/project.yaml`.
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems it's a bit harder than that. I pointed the action to evverx/clusterfuzzlite@96f6b81 (where the ubuntu-24-04-v1 images are used). The fuzz targets were built successfully and then it all failed with

Traceback (most recent call last):
  File "/opt/oss-fuzz/infra/cifuzz/run_fuzzers_entrypoint.py", line 106, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/oss-fuzz/infra/cifuzz/run_fuzzers_entrypoint.py", line 102, in main
    return run_fuzzers_entrypoint()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/oss-fuzz/infra/cifuzz/run_fuzzers_entrypoint.py", line 56, in run_fuzzers_entrypoint
    if config.base_os_version == 'ubuntu-24-04':
       ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/oss-fuzz/infra/cifuzz/config_utils.py", line 212, in base_os_version
    project_yaml_path = os.path.join(self.project_src_path,
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen posixpath>", line 76, in join
TypeError: expected str, bytes or os.PathLike object, not NoneType

https://github.com/evverx/avahi/actions/runs/19843002708/job/56855185731?pr=3

Copy link
Contributor

Choose a reason for hiding this comment

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

Having taken a closer look it seems PROJECT_SRC_PATH isn't passed on by run_fuzzers. I updated my fork, pointed the action to evverx/clusterfuzzlite@0477702 and triggered ClusterFuzzLite in https://github.com/evverx/avahi/actions/runs/19844232403/job/56858862729?pr=3. It did work.

I don't think it should be necessary to tweak forks but it should be discussed in google/clusterfuzzlite#145 probably.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@evverx I've created a PR (#14388) with a default solution for this scenario. Could you please test it in your environment to see if the issue is resolved by default?

Copy link
Contributor

Choose a reason for hiding this comment

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

hunsche added a commit that referenced this pull request Dec 2, 2025
**Fix TypeError in ClusterFuzzLite**
This PR fixes a TypeError that occurs in ClusterFuzzLite projects when
the PROJECT_SRC_PATH environment variable is not set.

This issue was introduced in #14382, which added the base_os_version
property to check for Ubuntu 24.04 migration. In ClusterFuzzLite
(external projects), base_os_version attempts to read project.yaml using
PROJECT_SRC_PATH, which can be missing in some configurations.

The fix adds a fallback to self.workspace when PROJECT_SRC_PATH is
missing, which is the default behavior for ClusterFuzzLite on GitHub
Actions. A warning is also logged when this fallback occurs.

**Fix CloudBuild tags**:
The CloudBuild for infra/cifuzz was failing because it was trying to use
the ubuntu-24-04 tag for the base image, but only ubuntu-24-04-v1 was
available in GCR.

The fix updates infra/cifuzz/cloudbuild.yaml to create both ubuntu-24-04
and ubuntu-24-04-v1 tags for all images. This ensures compatibility with
existing configurations while supporting the new versioned tags.
evverx added a commit to evverx/avahi that referenced this pull request Dec 4, 2025
The ubuntu-24-04 images are built now
(google/oss-fuzz#14382) and the issue where the
PROJECT_SRC_PATH kludge had to be added is addressed in
google/oss-fuzz#14388.

It can be merged once the action starts fetching the ubuntu-24-04 images
in google/clusterfuzzlite#146.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants