From 98a6631b3c40f374abb58b71073df2100eeea94a Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Fri, 26 Jan 2024 13:29:20 +0100 Subject: [PATCH] Remove softfp build The softfp build hasn't been updated in ages and people seem to have switched to the softfp fork. We should probably remove it, so we can build the vitasdk containers again. Right now the schedule is paused because of failures. --- .github/workflows/docker.yml | 2 - softfp/Dockerfile | 71 ----------------- softfp/scripts/create-matrix.js | 104 ------------------------- softfp/scripts/download_sdk.sh | 6 -- softfp/scripts/last_built_toolchain.py | 53 ------------- 5 files changed, 236 deletions(-) delete mode 100644 softfp/Dockerfile delete mode 100644 softfp/scripts/create-matrix.js delete mode 100644 softfp/scripts/download_sdk.sh delete mode 100644 softfp/scripts/last_built_toolchain.py diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0de412d..e327d81 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -22,8 +22,6 @@ jobs: tags: vitasdk/vitasdk:latest - context: ./non-root tags: vitasdk/vitasdk:non-root - - context: ./softfp - tags: vitasdk/vitasdk-softfp:latest steps: - uses: actions/checkout@v3 diff --git a/softfp/Dockerfile b/softfp/Dockerfile deleted file mode 100644 index affb92e..0000000 --- a/softfp/Dockerfile +++ /dev/null @@ -1,71 +0,0 @@ -# First stage of Dockerfile -FROM ubuntu:latest - -RUN apt update && \ - apt install -y software-properties-common && \ - apt update && \ - apt install -y build-essential libssl-dev cmake cmake-data git \ - python3 python-is-python3 curl rsync fakeroot texinfo texinfo libtool-bin \ - libarchive-tools autoconf sudo pkg-config sudo xutils-dev - -ADD scripts/download_sdk.sh /scripts/download_sdk.sh -ADD scripts/last_built_toolchain.py /scripts/last_built_toolchain.py - -RUN cd /scripts && chmod +x * - -RUN mkdir -p /sdk - -RUN /scripts/download_sdk.sh - -ARG USER=vitasdk -ENV HOME /home/$USER - -# add new user -RUN adduser $USER \ - && echo "$USER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER \ - && chmod 0440 /etc/sudoers.d/$USER \ - && mkdir -p $HOME \ - && chown -R $USER $HOME - -RUN chown -R $USER /sdk -USER $USER - -ENV VITASDK /sdk/vitasdk/ -ENV PATH ${VITASDK}/bin:$PATH - -WORKDIR $HOME - -RUN git clone https://github.com/vitasdk/packages - -ENV NVM_DIR "$HOME/.nvm" -ENV NODE_VERSION 14.17.5 - -# Install nvm with node and npm -RUN curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash \ - && . $NVM_DIR/nvm.sh \ - && nvm install $NODE_VERSION \ - && nvm alias default $NODE_VERSION \ - && nvm use default - -ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules -ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH - -ADD scripts/create-matrix.js /scripts/create-matrix.js - -RUN cd packages && node /scripts/create-matrix.js non_dependant | bash -RUN cd packages && node /scripts/create-matrix.js dependant | bash - -# Second stage of Dockerfile -FROM ubuntu:latest - -RUN apt update && \ - apt install -y software-properties-common && \ - apt update && \ - apt install -y build-essential cmake cmake-data git python3 python-is-python3 curl \ - fakeroot libtool-bin libarchive-tools zip && \ - rm -rf /var/lib/apt/lists/* - -ENV VITASDK /home/user/vitasdk -ENV PATH ${VITASDK}/bin:$PATH - -COPY --from=0 /sdk/vitasdk ${VITASDK} diff --git a/softfp/scripts/create-matrix.js b/softfp/scripts/create-matrix.js deleted file mode 100644 index d2260b8..0000000 --- a/softfp/scripts/create-matrix.js +++ /dev/null @@ -1,104 +0,0 @@ -const testFolder = '.'; -const fs = require('fs'); -const path = require('path') - -const dependant = new Map(); - -const args = process.argv.slice(2); - -let isDependant = false; - -switch (args[0]) { - case 'dependant': - isDependant = true; - break; - case 'non_dependant': - break; - default: - return; -} - -resolveDependency = (name, map) => { - const dependencies = map.get(name); - if (!dependencies) { - return []; - } - - dependencies.forEach((dependency) => { - const deps = resolveDependency(dependency, map); - if (deps.length > 0) { - deps.forEach((dep) => { - dependencies.push(dep); - }); - } - }); - - return dependencies; - -} - - -let directories = fs.readdirSync(testFolder).filter(file => fs.lstatSync(file).isDirectory()); - -directories = directories.filter(directory => { - return fs.readdirSync(directory).filter(file => file == 'VITABUILD').length > 0; -}); - -directories.forEach(directory => { - const content = fs.readFileSync(path.join(directory, "VITABUILD")); - const lines = content.toString().split('\n'); - for (let i = 0; i < lines.length; i++) { - const KV = lines[i].split("="); - if (KV.length > 1 && (KV[0].trim() == 'depends' || KV[0].trim() == 'makedepends')) { - - const dependencies = KV[1].trim().replace("(", "").replace(")", "").replace(/\'||\)/g, "").split(' '); - if (dependencies[0] != '') { - dependant.set(directory, dependencies); - } - - break; - } - } - -}) - - -dependant.forEach((value, key) => { - resolveDependency(key, dependant); -}) - -const output = { - non_dependant: [], - dependant: [] -}; - -directories.forEach(library => { - const dependencies = dependant.get(library); - if (dependencies) { - let info = library; - const deps = []; - dependencies.forEach((dependency) => { - if (dependant.get(dependency)) - deps.push(dependency); - }); - deps.forEach(dependency => info = dependency + " " + info); - output.dependant.push(info); - } else { - output.non_dependant.push(library); - } -}) - -if(isDependant){ - const libraries = []; - for(let deps of output.dependant){ - for(let dep of deps.split(' ')){ - if(!libraries.includes(dep)) - console.log('./build.sh '+dep); - libraries.push(dep); - } - } -} -else{ - for(let dep of output.non_dependant) - console.log('./build.sh '+dep); -} diff --git a/softfp/scripts/download_sdk.sh b/softfp/scripts/download_sdk.sh deleted file mode 100644 index c0c10b4..0000000 --- a/softfp/scripts/download_sdk.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -set -e -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -cd /sdk -curl -sL $(python $DIR/last_built_toolchain.py) | tar xj \ No newline at end of file diff --git a/softfp/scripts/last_built_toolchain.py b/softfp/scripts/last_built_toolchain.py deleted file mode 100644 index 0b2efd4..0000000 --- a/softfp/scripts/last_built_toolchain.py +++ /dev/null @@ -1,53 +0,0 @@ -import json -try: - import urllib2 -except ImportError: - # python3? - import urllib.request as urllib2 - -GITHUB_API_REPO = 'https://api.github.com/repos/vitasdk/buildscripts' -TAG_FORMAT = '%(branch)s-%(os)s-v2.%(build)s' - - -def fetch_succeeded_tags(branch='softfp', os='linux'): - try: - build_url = ''.join((GITHUB_API_REPO, '/actions/runs', '?branch=', branch, '&conclusion=success')) - req = urllib2.Request(build_url) - builds = json.load(urllib2.urlopen(req)) - except urllib2.HTTPError: - # FIXME: need to check; network error - return [] - except ValueError: - # FIXME: need to check; json parse error - return [] - - for build in builds['workflow_runs']: - yield TAG_FORMAT % dict(branch=branch, os=os, build=build['run_number']) - - -def last_built_toolchain(branch='softfp', os='linux'): - for tag in fetch_succeeded_tags(branch=branch, os=os): - try: - release_url = ''.join((GITHUB_API_REPO, '/releases/tags/', tag)) - req = urllib2.Request(release_url) - release = json.load(urllib2.urlopen(req)) - except urllib2.HTTPError: - # FIXME: need to check; network error - continue - except ValueError: - # FIXME: need to check; json parse error - continue - asset_download_url = release['assets'][0]['browser_download_url'] - if not asset_download_url: - continue - return asset_download_url - - -if __name__ == '__main__': - import sys - - url = last_built_toolchain(*sys.argv[1:]) - if not url: - raise SystemExit(1) - print(url) - raise SystemExit(0)