Skip to content

Commit 63db71b

Browse files
authored
ci: make easier the debugging of the docker-alpine-musl-gcc job (#23399)
1 parent ca6e3a3 commit 63db71b

5 files changed

Lines changed: 58 additions & 6 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#######################################################################################
2+
## The goal of this file, is to provide an easy and reproducible way to check *locally*
3+
## the CI job `docker-alpine-musl-gcc`
4+
## Building the docker image:
5+
## docker build -t ci_alpine_local - < .github/workflows/Dockerfile.ci_alpine_local
6+
## Running the docker image, after building it:
7+
## docker run --rm -it -v .:/opt/vlang -w /opt/vlang ci_alpine_local
8+
## Once it is running, inside the container you can:
9+
## make && v -e 'println(2+2)'
10+
## ... then do whatever you need to reproduce the CI test failure.
11+
## Note: after you are finished, and exit the container, run `make` again, otherwise
12+
## you will be using V (and potentially V tools) that were compiled with musl.
13+
#######################################################################################
14+
FROM thevlang/vlang:alpine-build
15+
16+
LABEL maintainer="spytheman <spytheman@bulsynt.org>"
17+
18+
WORKDIR /opt/vlang
19+
20+
ENV PATH /opt/vlang:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
21+
22+
## install development packages
23+
RUN apk --no-cache add \
24+
musl-dev libc-dev libc6-compat gcompat \
25+
libunwind-dev libunwind-static \
26+
gc gc-dev \
27+
binutils diffutils elfutils \
28+
strace gdb \
29+
pcre bash fzf fzf-vim tmux less file colordiff \
30+
vim vim-editorconfig \
31+
nano nano-syntax \
32+
micro
33+
34+
RUN git config --global --add safe.directory /opt/vlang &&\
35+
git config --global --add safe.directory /opt/vlang/vc &&\
36+
git config --global --add safe.directory /opt/vlang/thirdparty/tcc &&\
37+
find /usr/share/nano/ -iname "*.nanorc" -exec echo include {} \; >> ~/.nanorc &&\
38+
micro -plugin install detectindent &&\
39+
micro -plugin install editorconfig &&\
40+
micro -plugin install monokai-dark &&\
41+
micro -plugin install quickfix &&\
42+
micro -plugin install runit &&\
43+
micro -plugin install cheat &&\
44+
micro -plugin install jump &&\
45+
true
46+
47+
## setup runtime environment for v and bash:
48+
ENV VTMP /tmp/v
49+
ENV VMODULES /tmp/vmodules
50+
ENV VFLAGS "-d dynamic_boehm"
51+
52+
CMD ["bash"]

‎.github/workflows/docker_ci.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ env:
2424
V_CI_MUSL: 1
2525

2626
jobs:
27-
alpine-docker-musl-gcc:
27+
docker-alpine-musl-gcc:
2828
runs-on: ubuntu-20.04
2929
timeout-minutes: 241
3030
container:
@@ -45,15 +45,15 @@ jobs:
4545
echo "C Compiler:"
4646
gcc --version
4747
- name: Add dependencies
48-
run: apk add libc6-compat
48+
run: apk add libc6-compat gcompat gc gc-dev binutils diffutils elfutils
4949
- name: Build V
5050
run: CC=gcc make
5151
- name: All code is formatted
5252
run: VJOBS=1 ./v test-cleancode
5353
- name: Run only essential tests
5454
run: VTEST_JUST_ESSENTIAL=1 ./v test-self
5555

56-
ubuntu-docker-musl:
56+
docker-ubuntu-musl:
5757
runs-on: ubuntu-20.04
5858
timeout-minutes: 121
5959
container:

‎.github/workflows/tools_ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
if: ${{ matrix.cc == 'msvc' }}
102102
run: ./v -W -cstrict test-self cmd
103103

104-
ubuntu-docker-musl:
104+
tools-docker-ubuntu-musl:
105105
runs-on: ubuntu-20.04
106106
timeout-minutes: 121
107107
container:

‎cmd/tools/modules/testing/common.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ pub fn new_test_session(_vargs string, will_compile bool) TestSession {
278278
$if !macos {
279279
skip_files << 'examples/macos_tray/tray.v'
280280
}
281-
if github_job == 'ubuntu-docker-musl' {
281+
if github_job == 'docker-ubuntu-musl' {
282282
skip_files << 'vlib/net/openssl/openssl_compiles_test.c.v'
283283
skip_files << 'vlib/crypto/ecdsa/ecdsa_test.v'
284284
skip_files << 'vlib/x/ttf/ttf_test.v'

‎vlib/v/gen/golang/tests/golang_test.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const is_verbose = os.getenv('VTEST_SHOW_CMD') != ''
99
// TODO: some logic copy pasted from valgrind_test.v and compiler_test.v, move to a module
1010
fn test_golang() {
1111
// this was failing on ubuntu-docker-musl, skip it for now
12-
if github_job == 'ubuntu-docker-musl' {
12+
if github_job in ['docker-ubuntu-musl', 'tools-docker-ubuntu-musl'] {
1313
eprintln('Skipping Go tests')
1414
exit(0)
1515
}

0 commit comments

Comments
 (0)