Skip to content

Commit

Permalink
docker: Add VS_COMMONS_DIR, set bash as default shell (#49)
Browse files Browse the repository at this point in the history
Related to #47

This sets the default shell for 'builder' to '/bin/bash'.

When using 'meson devenv', the prompt becomes "[vs-fltk]
builder@0884a9be3841:/vs-workspace/build$" instead of "?" now.

Although that doesn't really improve anything except cli editing, as
I've moved the variables to the entrypoint scripts, and therefore devenv
isn't needed if using the docker container.

This also fixes this annoying message when starting the container:

bash: cannot set terminal process group (14): Inappropriate ioctl for
device
bash: no job control in this shell
builder@b7d17feb7490:~$

Co-authored-by: KaruroChori <[email protected]>
  • Loading branch information
andy5995 and KaruroChori authored Dec 8, 2024
1 parent f0e94bc commit 8654eaf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN \
unzip \
wget

RUN useradd -m builder && passwd -d builder
RUN useradd -m builder -s /bin/bash && passwd -d builder
RUN echo "builder ALL=(ALL) ALL" >> /etc/sudoers
WORKDIR /home/builder
USER builder
Expand Down
13 changes: 7 additions & 6 deletions docker/entry-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
set -e
$WORKSPACE/docker/entry-common.sh

su builder -c ". ~/.profile && bash -c '\
cd $WORKSPACE && \
bun install &&
bun run codegen &&
bun run meson-setup.clang-release &&
su builder -c bash << EOF
set -e
. ~/.profile
bun install
bun run codegen
bun run meson-setup.clang-release
meson compile -C build/ vs:executable
'"
EOF
5 changes: 4 additions & 1 deletion docker/entry-common.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# main_entry.sh
# entry-common.sh

set -e

Expand All @@ -15,3 +15,6 @@ fi

usermod -u $HOSTUID builder
groupmod -g $HOSTGID builder

echo 'export VS_COMMONS_DIR="$WORKSPACE"/build/commons/' >> /home/builder/.profile
echo 'export VS_LOG_LEVEL=debug' >> /home/builder/.profile
2 changes: 1 addition & 1 deletion docker/entry-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -e
$WORKSPACE/docker/entry-common.sh

su builder -c "cd $WORKSPACE && . ~/.profile && bash"
su -l builder
7 changes: 1 addition & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ cxx = meson.get_compiler('cpp')
#Used by pugi to enable compact mode. I might want to disable execptions too.
add_global_arguments(['-DPUGIXML_COMPACT'], language: ['cpp', 'c'])

meson.add_devenv(
{
'VS_COMMONS_DIR': join_paths(meson.project_source_root(), 'build', 'commons'),
},
)
meson.add_devenv({'VS_LOG_LEVEL': 'debug'})
#TODO: Add a custom profile to devenv to avoid "polluting" or making user's one invalid.

Expand Down Expand Up @@ -303,4 +298,4 @@ pconf.generate(
description: 'VS fltk library (C interface only)',
url: 'https://github.com/KaruroChori/vs-fltk/',
version: meson.project_version(),
)
)

0 comments on commit 8654eaf

Please sign in to comment.