File: Dockerfile.debug

package info (click to toggle)
cjs 128.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,872 kB
  • sloc: cpp: 34,377; javascript: 27,762; ansic: 13,033; sh: 1,611; python: 780; xml: 116; makefile: 38
file content (140 lines) | stat: -rw-r--r-- 3,553 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
# SPDX-FileCopyrightText: 2020 Philip Chimento <philip.chimento@gmail.com>

# === Build stage ===

FROM registry.fedoraproject.org/fedora:40 AS build
ARG MOZJS_BRANCH=mozjs115
ARG MOZJS_BUILDDEPS=${MOZJS_BRANCH}
ARG BUILD_OPTS=

ENV SHELL=/bin/bash

# mozjs115 cannot be built with python3.11
# cbindgen should be included in builddep(mozjs128)
RUN dnf -y install 'dnf-command(builddep)' \
    autoconf213 \
    cbindgen \
    clang \
    clang-devel \
    cmake \
    git \
    llvm \
    llvm-devel \
    make \
    ninja-build \
    python3.10 \
    python3-packaging \
    rust \
    which \
    xz
RUN dnf -y builddep ${MOZJS_BUILDDEPS}

WORKDIR /root

RUN mkdir -p include-what-you-use/_build
ADD https://include-what-you-use.org/downloads/include-what-you-use-0.22.src.tar.gz /root/include-what-you-use/
WORKDIR /root/include-what-you-use
RUN tar xzf include-what-you-use-0.22.src.tar.gz --strip-components=1

WORKDIR /root/include-what-you-use/_build

RUN cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr ..
RUN ninja
RUN DESTDIR=/root/iwyu-install ninja install

WORKDIR /root

RUN git clone --no-tags --depth 1 https://github.com/ptomato/mozjs.git -b ${MOZJS_BRANCH}
RUN mkdir -p mozjs/_build

WORKDIR /root/mozjs/_build

ENV PYTHON3=/usr/bin/python3.10
RUN ../js/src/configure --prefix=/usr --libdir=/usr/lib64 --disable-jemalloc \
    --with-system-zlib --with-intl-api --enable-debug \
    ${BUILD_OPTS}
RUN make -j$(nproc)
RUN DESTDIR=/root/mozjs-install make install
RUN rm -f /root/mozjs-install/usr/lib64/libjs_static.ajs

# === Actual Docker image ===

FROM registry.fedoraproject.org/fedora:40

ARG LOCALES=tr_TR
ENV SHELL=/bin/bash

# List is comprised of base dependencies for CI scripts, gjs, and debug packages
# needed for informative stack traces, e.g. in Valgrind.
#
# Do everything in one RUN command so that the dnf cache is not cached in the
# final Docker image.
RUN dnf -y install --enablerepo=fedora-debuginfo,updates-debuginfo \
    binutils \
    cairo-debuginfo \
    cairo-debugsource \
    cairo-gobject-devel \
    clang \
    compiler-rt \
    dbus-daemon \
    dbus-x11 \
    diffutils \
    fontconfig-debuginfo \
    fontconfig-debugsource \
    gcc-c++ \
    git \
    glib2-debuginfo \
    glib2-debugsource \
    glib2-devel \
    glibc-debuginfo \
    glibc-gconv-extra \
    glibc-locale-source \
    gnome-desktop-testing \
    gobject-introspection-debuginfo \
    gobject-introspection-debugsource \
    gobject-introspection-devel \
    gtk3-debuginfo \
    gtk3-debugsource \
    gtk3-devel \
    gtk4-debuginfo \
    gtk4-debugsource \
    gtk4-devel \
    lcov \
    libasan \
    libubsan \
    libtsan \
    meson \
    ninja-build \
    pkgconf \
    readline-devel \
    sysprof-devel \
    systemtap-sdt-devel \
    valgrind \
    which \
    Xvfb \
    xz \
    && \
    dnf clean all && rm -rf /var/cache/dnf

COPY --from=build /root/mozjs-install/usr /usr
COPY --from=build /root/iwyu-install/usr /usr
RUN ln -s /usr/bin/iwyu_tool.py /usr/bin/iwyu_tool

# Enable sudo for wheel users
RUN sed -i -e 's/# %wheel/%wheel/' -e '0,/%wheel/{s/%wheel/# %wheel/}' \
    /etc/sudoers

ENV HOST_USER_ID 5555
RUN useradd -u $HOST_USER_ID -G wheel -ms /bin/bash user

# Enable locales needed for specific tests
RUN for locale in ${LOCALES}; do \
        localedef --verbose --force -i "$locale" "$locale" || true; \
        localedef --verbose --force -i "$locale" -f UTF-8 "$locale".UTF-8 || true; \
    done

USER user
WORKDIR /home/user

ENV LANG C.UTF-8