Skip to content

Require clang-format v22#1750

Merged
ibc merged 15 commits intov3from
use-clang-format-22
Mar 13, 2026
Merged

Require clang-format v22#1750
ibc merged 15 commits intov3from
use-clang-format-22

Conversation

@ibc
Copy link
Member

@ibc ibc commented Mar 13, 2026

Details

  • HomeBrew no longer exposes clang-format@21. Now it's clang-format@22.
  • In CI we only run worker lint in macOS so we are good.
  • worker/Dockerfile: use ubuntu 26.04. It's probably a beta version but it comes with clang-format-22 apt package.

Bonus tracks

  • Fix Node CI failing due to test-werift-sctp.ts. Something related to werift-sctp library that honestly I don't care much about.
  • Logger.ts: Import log(), warn() and error() from node:console so we can add a Logger (if needed eventually) in Node test files and Jest won't make them print ugly output (this is because Jest overrides console global object. Now it cannot do it.

ibc added 2 commits March 13, 2026 11:35
# Details

- HomeBrew no longer exposes `clang-format@21`. Now it's `clang-format@22`.
- In CI we only run worker `lint` in macOS so we are good.
- Problem is that our `Dockerfile` files install `clang-format-21` which won't be valid anymore. We will fix it in April when Ubuntu 26 is out which in theory comes with `clang-format-22` package (not 100% sure but anyway).
@jmillan
Copy link
Member

jmillan commented Mar 13, 2026

Regarding to linux the new version can be installed via brew https://formulae.brew.sh/formula/clang-format.

@ibc
Copy link
Member Author

ibc commented Mar 13, 2026

Regarding to linux the new version can be installed via brew https://formulae.brew.sh/formula/clang-format.

If you want to investigate, I cannot have it working. Modified Dockerfile:

FROM ubuntu:25.10

# Install dependencies.
RUN set -x \
	&& apt-get update \
	&& apt-get install --yes \
		clang-21 make pkg-config bash-completion wget curl screen python3-pip python3-yaml \
		zlib1g-dev libgss-dev libssl-dev libxml2-dev gdb procps file git clang-tidy-21

# Install HomeBrew.
#
# Here we create a fake /.dockerenv file to make the HomeBrew install script allow
# installation with root user.
RUN touch /.dockerenv
RUN bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install clang-format v22.
RUN brew install clang-format@22

# Install node 24.
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
	&& apt-get install --yes nodejs

# Enable core dumps.
RUN set -x \
	&& echo "mkdir -p /tmp/cores && chmod 777 /tmp/cores && echo \"/tmp/cores/core.%e.sig%s.%p\" > /proc/sys/kernel/core_pattern && ulimit -c unlimited" >> ~/.bashrc

# Make CC and CXX point to clang/clang++ installed above.
ENV LANG="C.UTF-8"
ENV CC="clang-21"
ENV CXX="clang++-21"

ENV MEDIASOUP_LOCAL_DEV="true"
ENV KEEP_BUILD_ARTIFACTS="1"

WORKDIR "/foo bar/mediasoup"

CMD ["bash"]

Then make docker:

"/opt/homebrew/bin/python3" -m invoke docker
"docker" build -f Dockerfile --tag mediasoup/docker:latest .
[+] Building 9.3s (6/10)                                                                                                                                                               docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                                                                                                   0.0s
 => => transferring dockerfile: 1.18kB                                                                                                                                                                 0.0s
[+] Building 9.4s (6/10)                                                                                                                                                               docker:desktop-linux
[+] Building 158.5s (6/10)                                                                                                                                                             docker:desktop-linux
[+] Building 158.7s (6/10)                                                                                                                                                             docker:desktop-linux
[+] Building 266.6s (7/10)                                                                                                                                                             docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                                                                                                   0.0s
 => => transferring dockerfile: 1.18kB                                                                                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/ubuntu:25.10                                                                                                                                        0.5s
 => [internal] load .dockerignore                                                                                                                                                                      0.0s
 => => transferring context: 2B                                                                                                                                                                        0.0s
 => [1/7] FROM docker.io/library/ubuntu:25.10@sha256:4a9232cc47bf99defcc8860ef6222c99773330367fcecbf21ba2edb0b810a31e                                                                                  0.0s
 => => resolve docker.io/library/ubuntu:25.10@sha256:4a9232cc47bf99defcc8860ef6222c99773330367fcecbf21ba2edb0b810a31e                                                                                  0.0s
 => CACHED [2/7] RUN set -x  && apt-get update  && apt-get install --yes   clang-21 make pkg-config bash-completion wget curl screen python3-pip python3-yaml   zlib1g-dev libgss-dev libssl-dev libx  0.0s
 => [3/7] RUN touch /.dockerenv                                                                                                                                                                        0.1s
 => ERROR [4/7] RUN bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"                                                                                       265.9s
------                                                                                                                                                                                                      
 > [4/7] RUN bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)":                                                                                                    
0.184 Warning: Running in non-interactive mode because `stdin` is not a TTY.                                                                                                                                
0.191 ==> Checking for `sudo` access (which may request your password)...                                                                                                                                   
0.191 ==> This script will install:                                                                                                                                                                         
0.191 /home/linuxbrew/.linuxbrew/bin/brew                                                                                                                                                                   
0.191 /home/linuxbrew/.linuxbrew/share/doc/homebrew
0.191 /home/linuxbrew/.linuxbrew/share/man/man1/brew.1
0.191 /home/linuxbrew/.linuxbrew/share/zsh/site-functions/_brew
0.191 /home/linuxbrew/.linuxbrew/etc/bash_completion.d/brew
0.191 /home/linuxbrew/.linuxbrew/Homebrew
0.192 ==> The following new directories will be created:
0.192 /home/linuxbrew/.linuxbrew/bin
0.192 /home/linuxbrew/.linuxbrew/etc
0.192 /home/linuxbrew/.linuxbrew/include
0.192 /home/linuxbrew/.linuxbrew/lib
0.192 /home/linuxbrew/.linuxbrew/sbin
0.192 /home/linuxbrew/.linuxbrew/share
0.192 /home/linuxbrew/.linuxbrew/var
0.192 /home/linuxbrew/.linuxbrew/opt
0.192 /home/linuxbrew/.linuxbrew/share/zsh
0.192 /home/linuxbrew/.linuxbrew/share/zsh/site-functions
0.192 /home/linuxbrew/.linuxbrew/var/homebrew
0.192 /home/linuxbrew/.linuxbrew/var/homebrew/linked
0.192 /home/linuxbrew/.linuxbrew/Cellar
0.192 /home/linuxbrew/.linuxbrew/Caskroom
0.192 /home/linuxbrew/.linuxbrew/Frameworks
0.193 ==> /usr/bin/install -d -o root -g root -m 0755 /home/linuxbrew/.linuxbrew
0.195 ==> /bin/mkdir -p /home/linuxbrew/.linuxbrew/bin /home/linuxbrew/.linuxbrew/etc /home/linuxbrew/.linuxbrew/include /home/linuxbrew/.linuxbrew/lib /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/share /home/linuxbrew/.linuxbrew/var /home/linuxbrew/.linuxbrew/opt /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions /home/linuxbrew/.linuxbrew/var/homebrew /home/linuxbrew/.linuxbrew/var/homebrew/linked /home/linuxbrew/.linuxbrew/Cellar /home/linuxbrew/.linuxbrew/Caskroom /home/linuxbrew/.linuxbrew/Frameworks
0.197 ==> /bin/chmod ug=rwx /home/linuxbrew/.linuxbrew/bin /home/linuxbrew/.linuxbrew/etc /home/linuxbrew/.linuxbrew/include /home/linuxbrew/.linuxbrew/lib /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/share /home/linuxbrew/.linuxbrew/var /home/linuxbrew/.linuxbrew/opt /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions /home/linuxbrew/.linuxbrew/var/homebrew /home/linuxbrew/.linuxbrew/var/homebrew/linked /home/linuxbrew/.linuxbrew/Cellar /home/linuxbrew/.linuxbrew/Caskroom /home/linuxbrew/.linuxbrew/Frameworks
0.198 ==> /bin/chmod go-w /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions
0.198 ==> /bin/chown root /home/linuxbrew/.linuxbrew/bin /home/linuxbrew/.linuxbrew/etc /home/linuxbrew/.linuxbrew/include /home/linuxbrew/.linuxbrew/lib /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/share /home/linuxbrew/.linuxbrew/var /home/linuxbrew/.linuxbrew/opt /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions /home/linuxbrew/.linuxbrew/var/homebrew /home/linuxbrew/.linuxbrew/var/homebrew/linked /home/linuxbrew/.linuxbrew/Cellar /home/linuxbrew/.linuxbrew/Caskroom /home/linuxbrew/.linuxbrew/Frameworks
0.199 ==> /bin/chgrp root /home/linuxbrew/.linuxbrew/bin /home/linuxbrew/.linuxbrew/etc /home/linuxbrew/.linuxbrew/include /home/linuxbrew/.linuxbrew/lib /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/share /home/linuxbrew/.linuxbrew/var /home/linuxbrew/.linuxbrew/opt /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions /home/linuxbrew/.linuxbrew/var/homebrew /home/linuxbrew/.linuxbrew/var/homebrew/linked /home/linuxbrew/.linuxbrew/Cellar /home/linuxbrew/.linuxbrew/Caskroom /home/linuxbrew/.linuxbrew/Frameworks
0.201 ==> /bin/mkdir -p /home/linuxbrew/.linuxbrew/Homebrew
0.202 ==> /bin/chown -R root:root /home/linuxbrew/.linuxbrew/Homebrew
0.228 ==> Downloading and installing Homebrew...
238.8 ==> Updating Homebrew...
262.3 Error: Failed to download https://formulae.brew.sh/api/cask_tap_migrations.jws.json!
262.5 ==> Downloading https://ghcr.io/v2/homebrew/core/portable-ruby/blobs/sha256:f2be97b1a8197bed52727448b6a6c5aae99b81f04a6dc40c5e0a0b4f86686573
######################################################################## 100.0%
264.7 ==> Pouring portable-ruby-4.0.1.arm64_linux.bottle.tar.gz
265.3 ✔︎ JSON API cask_tap_migrations.jws.json
265.8 Failed during: /home/linuxbrew/.linuxbrew/bin/brew update --force --quiet
------
Dockerfile:15
--------------------
  13 |     # installation with root user.
  14 |     RUN touch /.dockerenv
  15 | >>> RUN bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  16 |     
  17 |     # Install clang-format v22.
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"" did not complete successfully: exit code: 1

@ibc
Copy link
Member Author

ibc commented Mar 13, 2026

Wait.

ibc added 2 commits March 13, 2026 12:38
It's probably a beta but it comes with clang-format-22
@ibc ibc merged commit e5780ff into v3 Mar 13, 2026
48 of 49 checks passed
@ibc ibc deleted the use-clang-format-22 branch March 13, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants