Skip to content

Commit

Permalink
ci: make easier the debugging of the docker-alpine-musl-gcc job (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman authored Jan 7, 2025
1 parent ca6e3a3 commit 63db71b
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 6 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/Dockerfile.ci_alpine_local
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"

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"]
6 changes: 3 additions & 3 deletions .github/workflows/docker_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -45,15 +45,15 @@ 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
run: VJOBS=1 ./v test-cleancode
- 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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tools_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/modules/testing/common.v
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion vlib/v/gen/golang/tests/golang_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 63db71b

Please sign in to comment.