ci: make easier the debugging of the docker-alpine-musl-gcc job (#23399)

This commit is contained in:
Delyan Angelov 2025-01-07 15:19:59 +02:00 committed by GitHub
parent ca6e3a38ce
commit 63db71b650
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 58 additions and 6 deletions

View file

@ -0,0 +1,52 @@
#######################################################################################
## The goal of this file, is to provide an easy and reproducible way to check *locally*
## the CI job `docker-alpine-musl-gcc`
## Building the docker image:
## docker build -t ci_alpine_local - < .github/workflows/Dockerfile.ci_alpine_local
## Running the docker image, after building it:
## docker run --rm -it -v .:/opt/vlang -w /opt/vlang ci_alpine_local
## Once it is running, inside the container you can:
## make && v -e 'println(2+2)'
## ... then do whatever you need to reproduce the CI test failure.
## Note: after you are finished, and exit the container, run `make` again, otherwise
## you will be using V (and potentially V tools) that were compiled with musl.
#######################################################################################
FROM thevlang/vlang:alpine-build
LABEL maintainer="spytheman <spytheman@bulsynt.org>"
WORKDIR /opt/vlang
ENV PATH /opt/vlang:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
## install development packages
RUN apk --no-cache add \
musl-dev libc-dev libc6-compat gcompat \
libunwind-dev libunwind-static \
gc gc-dev \
binutils diffutils elfutils \
strace gdb \
pcre bash fzf fzf-vim tmux less file colordiff \
vim vim-editorconfig \
nano nano-syntax \
micro
RUN git config --global --add safe.directory /opt/vlang &&\
git config --global --add safe.directory /opt/vlang/vc &&\
git config --global --add safe.directory /opt/vlang/thirdparty/tcc &&\
find /usr/share/nano/ -iname "*.nanorc" -exec echo include {} \; >> ~/.nanorc &&\
micro -plugin install detectindent &&\
micro -plugin install editorconfig &&\
micro -plugin install monokai-dark &&\
micro -plugin install quickfix &&\
micro -plugin install runit &&\
micro -plugin install cheat &&\
micro -plugin install jump &&\
true
## setup runtime environment for v and bash:
ENV VTMP /tmp/v
ENV VMODULES /tmp/vmodules
ENV VFLAGS "-d dynamic_boehm"
CMD ["bash"]

View file

@ -24,7 +24,7 @@ env:
V_CI_MUSL: 1
jobs:
alpine-docker-musl-gcc:
docker-alpine-musl-gcc:
runs-on: ubuntu-20.04
timeout-minutes: 241
container:
@ -45,7 +45,7 @@ jobs:
echo "C Compiler:"
gcc --version
- name: Add dependencies
run: apk add libc6-compat
run: apk add libc6-compat gcompat gc gc-dev binutils diffutils elfutils
- name: Build V
run: CC=gcc make
- name: All code is formatted
@ -53,7 +53,7 @@ jobs:
- name: Run only essential tests
run: VTEST_JUST_ESSENTIAL=1 ./v test-self
ubuntu-docker-musl:
docker-ubuntu-musl:
runs-on: ubuntu-20.04
timeout-minutes: 121
container:

View file

@ -101,7 +101,7 @@ jobs:
if: ${{ matrix.cc == 'msvc' }}
run: ./v -W -cstrict test-self cmd
ubuntu-docker-musl:
tools-docker-ubuntu-musl:
runs-on: ubuntu-20.04
timeout-minutes: 121
container:

View file

@ -278,7 +278,7 @@ pub fn new_test_session(_vargs string, will_compile bool) TestSession {
$if !macos {
skip_files << 'examples/macos_tray/tray.v'
}
if github_job == 'ubuntu-docker-musl' {
if github_job == 'docker-ubuntu-musl' {
skip_files << 'vlib/net/openssl/openssl_compiles_test.c.v'
skip_files << 'vlib/crypto/ecdsa/ecdsa_test.v'
skip_files << 'vlib/x/ttf/ttf_test.v'

View file

@ -9,7 +9,7 @@ const is_verbose = os.getenv('VTEST_SHOW_CMD') != ''
// TODO: some logic copy pasted from valgrind_test.v and compiler_test.v, move to a module
fn test_golang() {
// this was failing on ubuntu-docker-musl, skip it for now
if github_job == 'ubuntu-docker-musl' {
if github_job in ['docker-ubuntu-musl', 'tools-docker-ubuntu-musl'] {
eprintln('Skipping Go tests')
exit(0)
}