Skip to content

Commit

Permalink
[build/deps] dev-setup-alpine works!
Browse files Browse the repository at this point in the history
All the main wedges work.  That was a lot easier than Fedora.

- Use du -b instead of du --bytes (busybox)
- Disable pylibc unit test for now
  - should do real detection of extended globs

and then

- ./configure option for bash for spec-bin
  • Loading branch information
Andy C committed Jan 23, 2024
1 parent 7289284 commit 6a72825
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 16 deletions.
21 changes: 14 additions & 7 deletions build/deps.sh
Expand Up @@ -138,6 +138,8 @@ readonly -a WEDGE_DEPS_ALPINE=(

gcc g++
ninja-build
# https://pkgs.alpinelinux.org/packages?name=ninja-is-really-ninja&branch=v3.19&repo=&arch=&maintainer=
ninja-is-really-ninja
cmake

readline-dev
Expand Down Expand Up @@ -381,7 +383,7 @@ mypy-new() {
}

wedge-exists() {
local is_relative=${3:-yes}
local is_relative=${3:-}

if test -n "$is_relative"; then
local installed=~/wedge/oils-for-unix.org/pkg/$1/$2
Expand Down Expand Up @@ -623,7 +625,8 @@ install-wedges() {

if ! wedge-exists py3-libs $PY3_LIBS_VERSION; then
download-py3-libs
patch-typed-ast
# This patch doesn't work?
# patch-typed-ast
install-py3-libs
fi

Expand Down Expand Up @@ -696,17 +699,17 @@ commas() {
}

wedge-sizes() {
# Sizes
# printf justifies du output

local tmp=_tmp/wedge-sizes.txt
du -s --bytes /wedge/*/*/* ~/wedge/*/*/* | awk '

# -b is --bytes, but use short flag for busybox compat
du -s -b /wedge/*/*/* ~/wedge/*/*/* | awk '
{ print $0 # print the line
total_bytes += $1 # accumulate
}
END { print total_bytes " TOTAL" }
' > $tmp

# printf justifies du output
cat $tmp | commas | xargs -n 2 printf '%15s %s\n'
echo

Expand All @@ -726,7 +729,11 @@ wedge-report() {
local tmp=_tmp/wedge-manifest.txt

echo 'Biggest files'
find /wedge ~/wedge -type f -a -printf '%10s %P\n' > $tmp
if ! find /wedge ~/wedge -type f -a -printf '%10s %P\n' > $tmp; then
# busybox find doesn't have -printf
echo 'find -printf failed'
return
fi

set +o errexit # ignore SIGPIPE
sort -n --reverse $tmp | head -n 20 | commas
Expand Down
9 changes: 6 additions & 3 deletions build/dev-setup-test.sh
Expand Up @@ -18,10 +18,13 @@ smoke-test() {
bin/osh -c 'echo HI osh python $OILS_VERSION'
bin/ysh -c 'echo HI ysh python $OILS_VERSION'

ninja
# ASAN doesn't work with musl libc on Alpine
# https://gitlab.alpinelinux.org/alpine/aports/-/issues/10304

_bin/cxx-asan/osh -c 'echo HI osh C++ $OILS_VERSION'
_bin/cxx-asan/ysh -c 'echo HI ysh C++ $OILS_VERSION'
ninja _bin/cxx-dbg/{osh,ysh}

_bin/cxx-dbg/osh -c 'echo HI osh C++ $OILS_VERSION'
_bin/cxx-dbg/ysh -c 'echo HI ysh C++ $OILS_VERSION'
}

"$@"
7 changes: 7 additions & 0 deletions build/py.sh
Expand Up @@ -254,6 +254,13 @@ pylibc() {
rm -f libc.so

py-ext libc pyext/setup_libc.py

# Skip unit tests on Alpine for now
# musl libc doesn't have extended globs
if uname -a | grep -F Alpine; then
return
fi

py-ext-test pyext/libc_test.py "$@"
}

Expand Down
11 changes: 5 additions & 6 deletions soil/worker.sh
Expand Up @@ -71,7 +71,10 @@ os-info soil/diagnose.sh os-info -
dump-env soil/diagnose.sh dump-env -
wedge-deps build/deps.sh wedge-deps-$distro -
fetch build/deps.sh fetch -
spec-bin build/deps.sh install-spec-bin -
install-wedges build/deps.sh install-wedges -
py-all-and-ninja soil/worker.sh py-all-and-ninja -
smoke-test build/dev-setup-test.sh smoke-test -
wedge-report build/deps.sh wedge-report -
EOF
return

Expand All @@ -80,12 +83,8 @@ os-info soil/diagnose.sh os-info -
dump-env soil/diagnose.sh dump-env -
wedge-deps build/deps.sh wedge-deps-$distro -
fetch build/deps.sh fetch -
install-wedges build/deps.sh install-wedges -
py-all-and-ninja soil/worker.sh py-all-and-ninja -
smoke-test build/dev-setup-test.sh smoke-test -
wedge-report build/deps.sh wedge-report -
spec-bin build/deps.sh install-spec-bin -
EOF

}

dev-setup-debian-tasks() {
Expand Down

0 comments on commit 6a72825

Please sign in to comment.