Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: Add VS_COMMONS_DIR, set bash as default shell #49

Merged
merged 2 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(),
)
)
Loading