|
1 | | -FROM ubuntu:24.04 |
| 1 | +FROM ubuntu:24.04@sha256:cd1dba651b3080c3686ecf4e3c4220f026b521fb76978881737d24f200828b2b |
2 | 2 | LABEL org.opencontainers.image.source=https://github.com/riscv/riscv-unified-db |
3 | 3 |
|
4 | 4 | ENV DEBIAN_FRONTEND=noninteractive |
| 5 | +ENV IN_UDB_CONTAINER=true |
5 | 6 |
|
6 | 7 | WORKDIR /workspace |
7 | 8 |
|
8 | 9 | # please keep pkgs sorted |
9 | 10 | RUN apt-get update && \ |
10 | 11 | apt-get install -y --no-install-recommends --fix-missing \ |
| 12 | + bash-completion \ |
11 | 13 | build-essential \ |
12 | 14 | clang-format \ |
13 | 15 | clang-tidy \ |
14 | | - cmake \ |
15 | 16 | curl \ |
16 | 17 | ditaa \ |
17 | 18 | g++ \ |
18 | 19 | gcc-riscv64-linux-gnu \ |
19 | 20 | gcc-riscv64-unknown-elf \ |
20 | 21 | gdb \ |
21 | | - gh \ |
22 | 22 | git \ |
23 | 23 | gpg \ |
| 24 | + gpg-agent \ |
24 | 25 | less \ |
25 | 26 | libc6-dev-riscv64-cross \ |
26 | 27 | libelf-dev \ |
27 | 28 | libgmp-dev \ |
28 | 29 | libnewlib-dev \ |
29 | 30 | libyaml-dev \ |
30 | | - libz3-dev \ |
31 | | - minisat \ |
32 | | - nodejs \ |
33 | | - npm \ |
34 | 31 | parallel \ |
35 | | - python3 \ |
36 | | - python3-pip \ |
37 | | - python3.12-venv \ |
38 | | - rustc \ |
39 | | - shellcheck \ |
| 32 | + ssh \ |
40 | 33 | sudo \ |
41 | 34 | zlib1g-dev \ |
42 | 35 | \ |
43 | 36 | && apt-get clean autoclean \ |
44 | 37 | && apt-get autoremove -y \ |
45 | 38 | && rm -rf /var/lib/{apt,dpkg,cache,log}/* |
46 | 39 |
|
47 | | - # build / install ruby |
48 | | -COPY .ruby-version /opt/.ruby-version |
49 | | -ENV RUBY_YJIT_ENABLE=1 |
50 | | -RUN git clone --depth=1 https://github.com/rbenv/ruby-build.git && \ |
51 | | - cd ruby-build && \ |
52 | | - ./bin/ruby-build $(cat /opt/.ruby-version | tr -d "\n") /usr && \ |
53 | | - cd .. && \ |
54 | | - rm -rf ruby-build |
55 | | - |
56 | | -# build/install eqntott |
57 | | -RUN git clone --depth=1 https://github.com/TheProjecter/eqntott.git && \ |
58 | | - cd eqntott && \ |
59 | | - ./configure && \ |
60 | | - make && make install && \ |
61 | | - cd .. && \ |
62 | | - rm -rf eqntott |
| 40 | +# Install mise for tool management |
| 41 | +# See: https://mise.jdx.dev/mise-cookbook/docker.html |
| 42 | +ENV MISE_DATA_DIR="/mise" |
| 43 | +ENV MISE_CONFIG_DIR="/mise" |
| 44 | +ENV MISE_CACHE_DIR="/mise/cache" |
| 45 | +ENV MISE_STATE_DIR="/mise/state" |
| 46 | +ENV MISE_INSTALL_PATH="/usr/local/bin/mise" |
| 47 | +ENV MISE_YES=1 |
| 48 | +ENV MISE_TRUSTED_CONFIG_PATHS="/" |
| 49 | +ENV UV_CACHE_DIR="/tmp/uv-cache" |
| 50 | +ENV PATH="/mise/shims:$PATH" |
63 | 51 |
|
64 | | -# build/install espresso |
65 | | -RUN git clone --depth=1 https://github.com/psksvp/espresso-ab-1.0.git && \ |
66 | | - cd espresso-ab-1.0 && \ |
67 | | - ./configure && \ |
68 | | - make && make install && \ |
69 | | - cd .. && \ |
70 | | - rm -rf espresso-ab-1.0 |
| 52 | +# renovate: datasource=github-releases depName=jdx/mise |
| 53 | +ARG MISE_VERSION=2026.4.4 |
| 54 | +RUN MISE_VERSION=${MISE_VERSION} curl https://mise.run | sh |
71 | 55 |
|
72 | | -# build / install must |
73 | | -# mcsmus/mcsmus/control.cc is missing #include <cstdio>, thus the sed below |
74 | | -RUN git clone https://github.com/jar-ben/mustool.git && \ |
75 | | - cd mustool && \ |
76 | | - git checkout 17fa9f9542a9ce05328dfccd1cd410f05f741ab3 && \ |
77 | | - sed -i -e 's/#include <signal.h>/#include <signal.h>\n#include <cstdio>/' mcsmus/mcsmus/control.cc && \ |
78 | | - make -j && \ |
79 | | - install must -m 0777 /usr/bin/must && \ |
80 | | - cd .. && \ |
81 | | - rm -rf mustool |
| 56 | +# Install tools managed by mise (.mise.toml) |
| 57 | +COPY .mise.toml /mise/config.toml |
| 58 | +COPY .default-gems /mise/.default-gems |
| 59 | +RUN --mount=type=secret,id=MISE_GITHUB_TOKEN,env=MISE_GITHUB_TOKEN mise install |
| 60 | +RUN mise reshim |
| 61 | +RUN mkdir -p /mise/state && chmod -R 777 /mise |
82 | 62 |
|
83 | | -# Create Python virtual environment and install packages |
84 | | -COPY requirements.txt /opt/requirements.txt |
85 | | -RUN /usr/bin/python3 -m venv /opt/venv && \ |
86 | | - /opt/venv/bin/pip install -r /opt/requirements.txt && \ |
87 | | - rm /opt/requirements.txt |
88 | | -ENV PATH="/opt/venv/bin:$PATH" |
| 63 | +# Sync Python project dependencies with uv |
| 64 | +COPY pyproject.toml uv.lock /opt/python/ |
| 65 | +RUN cd /opt/python && uv sync |
| 66 | +ENV PATH="/opt/python/.venv/bin:$PATH" |
| 67 | +ENV UV_PROJECT_ENVIRONMENT="/opt/python/.venv" |
| 68 | +RUN mkdir -p /tmp/uv-cache && chmod -R 777 /tmp/uv-cache |
89 | 69 |
|
90 | 70 | # Install npm packages globally in the container |
91 | 71 | COPY package.json package-lock.json /opt/node/ |
92 | 72 | RUN cd /opt/node && \ |
93 | | - /usr/bin/npm ci && \ |
| 73 | + npm ci && \ |
94 | 74 | rm /opt/node/package.json /opt/node/package-lock.json |
95 | 75 | ENV NODE_PATH="/opt/node/node_modules" |
96 | 76 | ENV PATH="/opt/node/node_modules/.bin:$PATH" |
97 | | -ENV IN_UDB_CONTAINER=true |
98 | 77 |
|
99 | 78 | # install gems |
| 79 | +ENV BUNDLE_PATH=/usr/local/bundle |
| 80 | +ENV BUNDLE_BIN=/usr/local/bundle/bin |
| 81 | +ENV GEM_HOME=/usr/local/bundle |
| 82 | +ENV GEM_PATH=/usr/local/bundle |
| 83 | +ENV PATH="/usr/local/bundle/bin:$PATH" |
| 84 | + |
| 85 | +# Create the bundle directory |
| 86 | +RUN mkdir -p /usr/local/bundle \ |
| 87 | + && chmod 1777 /usr/local/bundle |
| 88 | + |
100 | 89 | COPY Gemfile /opt/Gemfile |
101 | 90 | COPY Gemfile.lock /opt/Gemfile.lock |
| 91 | +COPY tools/ruby-gems/idlc/Gemfile /opt/tools/ruby-gems/idlc/ |
| 92 | +COPY tools/ruby-gems/idlc/Gemfile.lock /opt/tools/ruby-gems/idlc/ |
102 | 93 | COPY tools/ruby-gems/idlc/idlc.gemspec /opt/tools/ruby-gems/idlc/ |
103 | | -COPY tools/ruby-gems/idlc/lib/gem_versions.rb /opt/tools/ruby-gems/idlc/lib/ |
104 | 94 | COPY tools/ruby-gems/idlc/lib/idlc/version.rb /opt/tools/ruby-gems/idlc/lib/idlc/ |
105 | 95 | COPY tools/ruby-gems/idl_highlighter/idl_highlighter.gemspec /opt/tools/ruby-gems/idl_highlighter/ |
106 | 96 | COPY tools/ruby-gems/idl_highlighter/lib/idl_highlighter/version.rb /opt/tools/ruby-gems/idl_highlighter/lib/idl_highlighter/ |
| 97 | +COPY tools/ruby-gems/udb/Gemfile /opt/tools/ruby-gems/udb/ |
| 98 | +COPY tools/ruby-gems/udb/Gemfile.lock /opt/tools/ruby-gems/udb/ |
107 | 99 | COPY tools/ruby-gems/udb/udb.gemspec /opt/tools/ruby-gems/udb/ |
108 | | -COPY tools/ruby-gems/udb/lib/gem_versions.rb /opt/tools/ruby-gems/udb/lib/ |
109 | 100 | COPY tools/ruby-gems/udb/lib/udb/version.rb /opt/tools/ruby-gems/udb/lib/udb/ |
| 101 | +COPY tools/ruby-gems/udb/lib/udb/dep_versions.rb /opt/tools/ruby-gems/udb/lib/udb/ |
| 102 | +COPY tools/ruby-gems/udb/ext/udb_download/extconf.rb /opt/tools/ruby-gems/udb/ext/udb_download/ |
| 103 | +COPY tools/ruby-gems/udb-gen/Gemfile /opt/tools/ruby-gems/udb-gen/ |
| 104 | +COPY tools/ruby-gems/udb-gen/Gemfile.lock /opt/tools/ruby-gems/udb-gen/ |
110 | 105 | COPY tools/ruby-gems/udb-gen/udb-gen.gemspec /opt/tools/ruby-gems/udb-gen/ |
111 | | -COPY tools/ruby-gems/udb-gen/lib/gem_versions.rb /opt/tools/ruby-gems/udb-gen/lib/ |
112 | 106 | COPY tools/ruby-gems/udb-gen/lib/udb-gen/version.rb /opt/tools/ruby-gems/udb-gen/lib/udb-gen/ |
113 | 107 | COPY tools/ruby-gems/udb_helpers/udb_helpers.gemspec /opt/tools/ruby-gems/udb_helpers/ |
114 | 108 | COPY tools/ruby-gems/udb_helpers/lib/udb_helpers/version.rb /opt/tools/ruby-gems/udb_helpers/lib/udb_helpers/ |
115 | | -RUN bundle install --gemfile /opt/Gemfile |
| 109 | +RUN bundle install --gemfile /opt/Gemfile --jobs $(nproc) \ |
| 110 | + && bundle install --gemfile /opt/tools/ruby-gems/idlc/Gemfile --jobs $(nproc) \ |
| 111 | + && bundle install --gemfile /opt/tools/ruby-gems/udb/Gemfile --jobs $(nproc) \ |
| 112 | + && bundle install --gemfile /opt/tools/ruby-gems/udb-gen/Gemfile --jobs $(nproc) \ |
| 113 | + && chmod -R a+rwX /usr/local/bundle \ |
| 114 | + && rm -f /usr/local/bundle/bin/bundle |
116 | 115 |
|
117 | 116 | # the binaries for gems need to be copied in |
118 | 117 | RUN mkdir -p /workspace/bin/container |
|
0 commit comments