Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/executor/valgrind/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,13 @@ pub async fn install_valgrind(
Ok(vec!["valgrind".to_string()])
},
)
.await
.await?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Part of the cache in the action is to avoid having to do sudo apt update when not required, which can take quite a lot of time.

We should cache the output of libc dbg, because it can in practice ad 30 sec to 1 min to ci runs.

apt.rs already exposes the cache helper it should work transparently


// Install libc debug symbols, as Github runners by default do not
// include them. Only install for supported systems.
apt::install(system_info, &["libc6-dbg"])?;
Comment on lines +204 to +206

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 libc6-dbg installed unconditionally, bypassing the cache gate

apt::install_cached exits early (return Ok(())) when valgrind is already installed, but the new apt::install call for libc6-dbg sits outside that gate and runs on every install_valgrind invocation. This means every CI run where valgrind is cached will still execute apt-get update followed by an install attempt for libc6-dbg — adding the ~10 s overhead even when nothing needs to be installed. Including libc6-dbg inside the install_packages closure (alongside the valgrind .deb) would keep it under the same caching and idempotency logic, or at minimum a dpkg -s libc6-dbg check could guard the call.

Comment on lines +204 to +206

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 The comment "Only install for supported systems" implies a silent no-op on incompatible systems, but apt::install actually propagates an error (bail!) when the system is incompatible. While install_valgrind is only reached on supported systems today, the comment is misleading about the runtime behaviour.

Suggested change
// Install libc debug symbols, as Github runners by default do not
// include them. Only install for supported systems.
apt::install(system_info, &["libc6-dbg"])?;
// Install libc debug symbols, as GitHub runners do not include them by
// default. `apt::install` will error on unsupported systems, but this
// function is only reachable when `is_codspeed_valgrind_installation_supported`
// is true, so only compatible Linux distros reach this point.
apt::install(system_info, &["libc6-dbg"])?;

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!


Ok(())
}

#[cfg(test)]
Expand Down