Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 't/30910/public/build/fixwsl' into t/30930/add_update_th…
Browse files Browse the repository at this point in the history
…e_system_package_information_for_the___recommended__dummy_package
  • Loading branch information
Matthias Koeppe committed Nov 17, 2020
2 parents 2220595 + 3ccae02 commit 6d0e673
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 24 deletions.
32 changes: 14 additions & 18 deletions .github/workflows/ci-wsl.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
name: Build & Test WSL

on: [push, pull_request]
on:
pull_request:
types: [opened, synchronize]
push:
tags:
- '*'
branches:
- 'public/build/**wsl**'
workflow_dispatch:

jobs:
windows:
runs-on: windows-latest
name: Windows (using WSL)
name: Ubuntu 20.04
# Following https://trac.sagemath.org/ticket/25206#comment:63
steps:
- name: Configure git
Expand All @@ -18,22 +26,10 @@ jobs:
Ubuntu\ubuntu2004.exe install --root
- name: Install dependencies
run: |
Function ExtractPackages
{
param($path)
@(Get-Content $path | Where-Object { !$_.StartsWith("#") })
}
$packages = Get-ChildItem build/pkgs -recurse -Include debian.txt, debian-bootstrap.txt | foreach-object { ExtractPackages $_.FullName } | sort -Unique
# Add tox which is use to build
$packages += 'tox'
echo "Install the following packages:" @packages
# Add deadsnakes so that libpython3.7-dev is found
& wsl sudo add-apt-repository ppa:deadsnakes/ppa
# Install
& wsl sudo apt-get update -y
& wsl sudo apt-get install -y @packages
wsl sudo apt-get update -y
wsl sudo apt-get install -y tox
- name: Build
run: wsl tox -e local -- SAGE_NUM_THREADS=4 build
run: wsl tox -e local-sudo-ubuntu-standard -- SAGE_NUM_THREADS=4 build
env:
# WSL runs everything as root, so we have to enable build as root user
EXTRA_CONFIGURE_ARGS: "--enable-build-as-root"
Expand All @@ -42,7 +38,7 @@ jobs:
MAKE: "make -j2"
WSLENV: EXTRA_CONFIGURE_ARGS:MAKE
- name: Test
run: wsl tox -e local -- SAGE_NUM_THREADS=4 ptest
run: wsl tox -e local-sudo-ubuntu-standard -- SAGE_NUM_THREADS=4 ptest
- name: Prepare logs artifact
run: mkdir -p "artifacts/logs"; cp -r .tox/*/log "artifacts/logs"
shell: bash
Expand Down
28 changes: 23 additions & 5 deletions build/bin/sage-print-system-package-command
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ do
--prompt)
PROMPT=' $ '
;;
--no-install-recommends)
NO_INSTALL_RECOMMENDS=yes
;;
--yes)
YES=yes
;;
-*)
echo >&2 "$0: unknown option $1"
exit 1
Expand All @@ -37,6 +43,7 @@ if [ -z "$system" -o -z "$command" ]; then
exit 1
fi
system_packages="$*"
options=
shopt -s extglob
case $system:$command in
homebrew*:setup-build-env)
Expand All @@ -56,22 +63,33 @@ case $system:$command in
echo "${PROMPT}${SUDO}apt-get $command $system_packages"
;;
@(debian*|ubuntu*):*)
[ -n "$system_packages" ] && echo "${PROMPT}${SUDO}apt-get $command $system_packages"
[ "$NO_INSTALL_RECOMMENDS" = yes ] && options="$options --no-install-recommends"
[ "$YES" = yes ] && options="$options --yes"
[ -n "$system_packages" ] && echo "${PROMPT}${SUDO}apt-get $command $options $system_packages"
;;
@(fedora*|redhat*|centos*):install)
[ -n "$system_packages" ] && echo "${PROMPT}${SUDO}yum install $system_packages"
[ "$YES" = yes ] && options="$options -y"
[ -n "$system_packages" ] && echo "${PROMPT}${SUDO}yum install $options $system_packages"
;;
gentoo*:install)
[ -n "$system_packages" ] && echo "${PROMPT}${SUDO}emerge $system_packages"
;;
arch*:update)
echo "${PROMPT}${SUDO}pacman -Sy"
;;
arch*:install)
[ -n "$system_packages" ] && echo "${PROMPT}${SUDO}pacman -S $system_packages"
[ "$YES" = yes ] && options="$options --noconfirm"
[ -n "$system_packages" ] && echo "${PROMPT}${SUDO}pacman -S $options $system_packages"
;;
void*:update)
echo "${PROMPT}${SUDO}xbps-install -Su"
;;

void*:install)
[ -n "$system_packages" ] && echo "${PROMPT}${SUDO}xbps-install $system_packages"
[ "$YES" = yes ] && options="$options --yes"
[ -n "$system_packages" ] && echo "${PROMPT}${SUDO}xbps-install $options $system_packages"
;;
*conda*:install)
[ "$YES" = yes ] && options="$options --yes"
[ -n "$system_packages" ] && echo "${PROMPT}conda install $system_packages"
;;
homebrew*:install)
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/_recommended/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# From https://wiki.sagemath.org/prerequisitesUbuntu

# to generate pdf documentation
texlive-generic-extra
texlive-latex-extra
# to convert Jupyter notebooks to pdf
texlive-xetex
# to generate pdf documentation
Expand Down
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ setenv =
maximal: TYPE_PATTERN=@(standard|optional)
# local envs need HOME set, also Docker 19.03 needs HOME
{local,docker}: HOME={envdir}
# for local envs we can guess the package system if it is not provided as a factor
local: SYSTEM=$(build/bin/sage-guess-package-system)
#
# default tag is "latest"
#
Expand Down Expand Up @@ -409,6 +411,14 @@ commands =
local-conda-standard: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/conda.txt`; {env:SETENV} && {env:CONDA_PREFIX}/bin/conda install --yes --quiet $PACKAGES'
local-conda-maximal: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/conda.txt`; {env:SETENV} && {env:CONDA_PREFIX}/bin/conda install --yes --quiet $PACKAGES'
#
# local-sudo
#
local-sudo: bash -c '$(build/bin/sage-print-system-package-command {env:SYSTEM} update) #'
local-sudo: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/{env:SYSTEM}*.txt`; $(build/bin/sage-print-system-package-command {env:SYSTEM} --sudo --yes --no-install-recommends install $PACKAGES) || [ "$IGNORE_MISSING_SYSTEM_PACKAGES" = yes ] && echo "(ignoring errors)" '
# -standard and -maximal are for now the same. This should be fixed when refactoring write-dockerfile.
local-sudo-standard: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/{env:SYSTEM}.txt`; $(build/bin/sage-print-system-package-command {env:SYSTEM} --sudo --yes --no-install-recommends install $PACKAGES) || [ "$IGNORE_MISSING_SYSTEM_PACKAGES" = yes ] && echo "(ignoring errors)" '
local-sudo-maximal: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/{env:SYSTEM}.txt`; $(build/bin/sage-print-system-package-command {env:SYSTEM} --sudo --yes --no-install-recommends install $PACKAGES) || [ "$IGNORE_MISSING_SYSTEM_PACKAGES" = yes ] && echo "(ignoring errors)" '
#
# All "local" environments
#
# Install symbolic links "config.log" and "logs" in SAGE_ROOT so that log files are written into the tox log directory.
Expand Down

0 comments on commit 6d0e673

Please sign in to comment.