Skip to content

Conversation

@otegami
Copy link

@otegami otegami commented Dec 8, 2025

Summary

Fix CMake build failure on versions below 3.24
(e.g., Ubuntu 22.04 with CMake 3.22).

The DOWNLOAD_EXTRACT_TIMESTAMP option in
FetchContent_Declare was added in CMake 3.24.

On older versions, this unrecognized keyword is
misinterpreted as part of the URL_HASH value,
causing the build to fail with:

CMake Error: URL_HASH is set to
  SHA256=...;DOWNLOAD_EXTRACT_TIMESTAMP;ON
but must be ALGO=value

Type of Change

Bug fix (non-breaking change which fixes an issue)

Test Plan

Use Docker to verify the fix on Ubuntu 22.04
(CMake 3.22):

FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
    build-essential \
    cmake \
    git \
    python3 \
    python3-dev \
    && rm -rf /var/lib/apt/lists/*

RUN cmake --version

WORKDIR /workspace

COPY . .

# Remove zstd and .git to force FetchContent (Tier 2) to run
RUN rm -rf deps/zstd .git

CMD cmake \
    -S. \
    -B../openzl.build \
    -DCMAKE_INSTALL_PREFIX=/tmp/local \
    -DCMAKE_BUILD_TYPE=Release

Commands:

docker build -t openzl-debug .
docker run --rm openzl-debug

Expected result

  • On dev branch: Build fails with URL_HASH is set to SHA256=...;DOWNLOAD_EXTRACT_TIMESTAMP;ON
  • On this branch: Build succeeds with zstd dependency resolved successfully

Test Configuration

  • Compiler: GCC 11.4.0
  • Build type: Release
  • Platform(s): Ubuntu 22.04 (Docker), CMake 3.22

… 3.24

## Summary

Fix CMake build failure on versions below 3.24
(e.g., Ubuntu 22.04 with CMake 3.22).

The `DOWNLOAD_EXTRACT_TIMESTAMP` option in
`FetchContent_Declare` was added in CMake 3.24.

On older versions, this unrecognized keyword is
misinterpreted as part of the `URL_HASH` value,
causing the build to fail with:

```
CMake Error: URL_HASH is set to
  SHA256=...;DOWNLOAD_EXTRACT_TIMESTAMP;ON
but must be ALGO=value
```

## Type of Change

Bug fix (non-breaking change which fixes an issue)

## Test Plan

Use Docker to verify the fix on Ubuntu 22.04
(CMake 3.22):

```dockerfile
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
    build-essential \
    cmake \
    git \
    python3 \
    python3-dev \
    && rm -rf /var/lib/apt/lists/*

RUN cmake --version

WORKDIR /workspace

COPY . .

# Remove zstd and .git to force FetchContent (Tier 2) to run
RUN rm -rf deps/zstd .git

CMD cmake \
    -S. \
    -B../openzl.build \
    -DCMAKE_INSTALL_PREFIX=/tmp/local \
    -DCMAKE_BUILD_TYPE=Release
```

### Commands:

```bash
docker build -t openzl-debug .
docker run --rm openzl-debug
```

### Expected result

- On `dev` branch: Build fails with `URL_HASH is set to SHA256=...;DOWNLOAD_EXTRACT_TIMESTAMP;ON`
- On this branch: Build succeeds with `zstd dependency resolved successfully`

### Test Configuration

- Compiler: GCC 11.4.0
- Build type: Release
- Platform(s): Ubuntu 22.04 (Docker), CMake 3.22
@meta-cla
Copy link

meta-cla bot commented Dec 8, 2025

Hi @otegami!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla meta-cla bot added the cla signed label Dec 8, 2025
@meta-cla
Copy link

meta-cla bot commented Dec 8, 2025

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant