From 48fb327ddd76b13a5df681c997935236412c7d55 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sat, 5 Oct 2024 00:57:51 +0700 Subject: [PATCH] Update binary metadata --- src/binaries/metadata.json | 98 ++++++++++++++++++++++++-------------- src/binaries/update.js | 34 ++++++++++--- 2 files changed, 89 insertions(+), 43 deletions(-) diff --git a/src/binaries/metadata.json b/src/binaries/metadata.json index 3663950..9ed6a63 100644 --- a/src/binaries/metadata.json +++ b/src/binaries/metadata.json @@ -1,22 +1,26 @@ { "x64": { "rubyVersionsList": [ - "3.1.3", - "3.1.2", - "3.0.5", - "3.0.4", - "3.0.3", - "2.7.7", - "2.7.6", - "2.7.5" + "3.3.5", + "3.2.5", + "3.1.6", + "3.0.7", + "2.7.8", + "2.6.10", + "2.5.9", + "2.4.10", + "2.3.8", + "2.2.10", + "2.1.9" ], "pythonVersionsList": [ - "3.12.5", - "3.11.9", - "3.10.14", - "3.9.19" + "3.12.7", + "3.11.10", + "3.10.15", + "3.9.20" ], "javaVersionsList": [ + "23.0.0+37", "22.0.2+9", "21.0.4+7.0.LTS", "20.0.2+9", @@ -28,10 +32,10 @@ "8.0.422+5" ], "pythonVersionsMap": { - "3.10.14": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.10.14+20240814-x86_64_v3-unknown-linux-gnu-pgo+lto-full.tar.zst", - "3.11.9": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.11.9+20240814-x86_64_v3-unknown-linux-gnu-pgo+lto-full.tar.zst", - "3.12.5": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.12.5+20240814-x86_64_v3-unknown-linux-gnu-pgo+lto-full.tar.zst", - "3.9.19": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.9.19+20240814-x86_64_v3-unknown-linux-gnu-pgo+lto-full.tar.zst" + "3.10.15": "https://github.com/indygreg/python-build-standalone/releases/download/20241002/cpython-3.10.15+20241002-x86_64_v3-unknown-linux-gnu-pgo+lto-full.tar.zst", + "3.11.10": "https://github.com/indygreg/python-build-standalone/releases/download/20241002/cpython-3.11.10+20241002-x86_64_v3-unknown-linux-gnu-pgo+lto-full.tar.zst", + "3.12.7": "https://github.com/indygreg/python-build-standalone/releases/download/20241002/cpython-3.12.7+20241002-x86_64_v3-unknown-linux-gnu-pgo+lto-full.tar.zst", + "3.9.20": "https://github.com/indygreg/python-build-standalone/releases/download/20241002/cpython-3.9.20+20241002-x86_64_v3-unknown-linux-gnu-pgo+lto-full.tar.zst" }, "javaVersionsMap": { "8.0.422+5": "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u422-b05/OpenJDK8U-jdk_x64_linux_hotspot_8u422b05.tar.gz", @@ -42,28 +46,46 @@ "19.0.2+7": "https://github.com/adoptium/temurin19-binaries/releases/download/jdk-19.0.2%2B7/OpenJDK19U-jdk_x64_linux_hotspot_19.0.2_7.tar.gz", "20.0.2+9": "https://github.com/adoptium/temurin20-binaries/releases/download/jdk-20.0.2%2B9/OpenJDK20U-jdk_x64_linux_hotspot_20.0.2_9.tar.gz", "21.0.4+7.0.LTS": "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_x64_linux_hotspot_21.0.4_7.tar.gz", - "22.0.2+9": "https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22.0.2%2B9/OpenJDK22U-jdk_x64_linux_hotspot_22.0.2_9.tar.gz" + "22.0.2+9": "https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22.0.2%2B9/OpenJDK22U-jdk_x64_linux_hotspot_22.0.2_9.tar.gz", + "23.0.0+37": "https://github.com/adoptium/temurin23-binaries/releases/download/jdk-23%2B37/OpenJDK23U-jdk_x64_linux_hotspot_23_37.tar.gz" + }, + "rubyVersionsMap": { + "2.1.9": "https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-2.1.9-ubuntu-24.04.tar.gz", + "2.2.10": "https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-2.2.10-ubuntu-24.04.tar.gz", + "2.3.8": "https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-2.3.8-ubuntu-24.04.tar.gz", + "2.4.10": "https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-2.4.10-ubuntu-24.04.tar.gz", + "2.5.9": "https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-2.5.9-ubuntu-24.04.tar.gz", + "2.6.10": "https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-2.6.10-ubuntu-24.04.tar.gz", + "2.7.8": "https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-2.7.8-ubuntu-24.04.tar.gz", + "3.0.7": "https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-3.0.7-ubuntu-24.04.tar.gz", + "3.1.6": "https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-3.1.6-ubuntu-24.04.tar.gz", + "3.2.5": "https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-3.2.5-ubuntu-24.04.tar.gz", + "3.3.5": "https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-3.3.5-ubuntu-24.04.tar.gz" } }, "arm64": { "rubyVersionsList": [ - "3.1.3", - "3.1.2", - "3.0.5", - "3.0.4", - "3.0.3", - "2.7.7", - "2.7.6", - "2.7.5" + "3.3.5", + "3.2.5", + "3.1.6", + "3.0.7", + "2.7.8", + "2.6.10", + "2.5.9", + "2.4.10", + "2.3.8", + "2.2.10", + "2.1.9" ], "pythonVersionsList": [ - "3.12.5", - "3.11.9", - "3.10.14", - "3.9.19", - "3.8.19" + "3.12.7", + "3.11.10", + "3.10.15", + "3.9.20", + "3.8.20" ], "javaVersionsList": [ + "23.0.0+37", "22.0.2+9", "21.0.4+7.0.LTS", "20.0.2+9", @@ -75,11 +97,11 @@ "8.0.422+5" ], "pythonVersionsMap": { - "3.10.14": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.10.14+20240814-aarch64-unknown-linux-gnu-lto-full.tar.zst", - "3.11.9": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.11.9+20240814-aarch64-unknown-linux-gnu-lto-full.tar.zst", - "3.12.5": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.12.5+20240814-aarch64-unknown-linux-gnu-lto-full.tar.zst", - "3.8.19": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.8.19+20240814-aarch64-unknown-linux-gnu-lto-full.tar.zst", - "3.9.19": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.9.19+20240814-aarch64-unknown-linux-gnu-lto-full.tar.zst" + "3.10.15": "https://github.com/indygreg/python-build-standalone/releases/download/20241002/cpython-3.10.15+20241002-aarch64-unknown-linux-gnu-lto-full.tar.zst", + "3.11.10": "https://github.com/indygreg/python-build-standalone/releases/download/20241002/cpython-3.11.10+20241002-aarch64-unknown-linux-gnu-lto-full.tar.zst", + "3.12.7": "https://github.com/indygreg/python-build-standalone/releases/download/20241002/cpython-3.12.7+20241002-aarch64-unknown-linux-gnu-lto-full.tar.zst", + "3.8.20": "https://github.com/indygreg/python-build-standalone/releases/download/20241002/cpython-3.8.20+20241002-aarch64-unknown-linux-gnu-lto-full.tar.zst", + "3.9.20": "https://github.com/indygreg/python-build-standalone/releases/download/20241002/cpython-3.9.20+20241002-aarch64-unknown-linux-gnu-lto-full.tar.zst" }, "javaVersionsMap": { "8.0.422+5": "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u422-b05/OpenJDK8U-jdk_aarch64_linux_hotspot_8u422b05.tar.gz", @@ -90,7 +112,9 @@ "19.0.2+7": "https://github.com/adoptium/temurin19-binaries/releases/download/jdk-19.0.2%2B7/OpenJDK19U-jdk_aarch64_linux_hotspot_19.0.2_7.tar.gz", "20.0.2+9": "https://github.com/adoptium/temurin20-binaries/releases/download/jdk-20.0.2%2B9/OpenJDK20U-jdk_aarch64_linux_hotspot_20.0.2_9.tar.gz", "21.0.4+7.0.LTS": "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.4_7.tar.gz", - "22.0.2+9": "https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22.0.2%2B9/OpenJDK22U-jdk_aarch64_linux_hotspot_22.0.2_9.tar.gz" - } + "22.0.2+9": "https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22.0.2%2B9/OpenJDK22U-jdk_aarch64_linux_hotspot_22.0.2_9.tar.gz", + "23.0.0+37": "https://github.com/adoptium/temurin23-binaries/releases/download/jdk-23%2B37/OpenJDK23U-jdk_aarch64_linux_hotspot_23_37.tar.gz" + }, + "rubyVersionsMap": {} } } \ No newline at end of file diff --git a/src/binaries/update.js b/src/binaries/update.js index 377f624..e39696d 100644 --- a/src/binaries/update.js +++ b/src/binaries/update.js @@ -6,7 +6,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url)); const pythonConstants = { // https://raw.githubusercontent.com/indygreg/python-build-standalone/latest-release/latest-release.json - tag: "20240107", + tag: "20241002", // NOTE: x86_64_v3 requires AVX2 CPU support match: { x64: /cpython-(\d+\.\d+\.\d+)\+\d+-x86_64_v3-unknown-linux-gnu-pgo\+lto-full\.tar\.zst/g, @@ -26,6 +26,11 @@ const pythonConstants = { return `https://github.com/indygreg/python-build-standalone/releases/download/${this.tag}/${filename}`; }, }; + +const rubyBuilderUrl = 'https://github.com/ruby/ruby-builder/releases/expanded_assets/toolcache'; + +const adoptiumList = 'https://api.adoptium.net/v3/info/available_releases'; + export const initUtils = async () => { // TODO: detect OS/arch? @@ -48,18 +53,34 @@ export const initUtils = async () => { * @type {Record} */ let javaVersionsMap = {}; - await request("https://rvm_io.global.ssl.fastly.net/binaries/centos/9/x86_64/") // currently aarch64 have to rebuilt + /** + * @type {Record} + */ + let rubyVersionsMap = {}; + await request(rubyBuilderUrl) .then((res) => { // @ts-ignore var matches = [ - ...("" + res.data).matchAll(/href="ruby-([.\d]+).tar.bz2"/g), + ...("" + res.data).matchAll(/href="[-\w/]+?\/ruby-([.\d]+)-ubuntu-24.04.tar.gz"/g), ]; for (const match of matches) { if (!rubyVersionsList.includes(match[1])) { rubyVersionsList.push(match[1]); + rubyVersionsMap[match[1]] = `https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-${match[1]}-ubuntu-24.04.tar.gz` } } rubyVersionsList = sortSemver(rubyVersionsList).reverse(); + // remove minor versions + rubyVersionsList = rubyVersionsList.filter((x, i) => rubyVersionsList.findIndex(y => y.startsWith(x.substring(0, 3))) == i); + if (arch == 'x64') { + for (const key of Object.keys(rubyVersionsMap)) { + if (!rubyVersionsList.includes(key)) { + delete rubyVersionsMap[key]; + } + } + } else { + rubyVersionsMap = {}; // currently aarch64 have to rebuilt + } }) .catch((err) => { console.error("error fetching Ruby releases", err.message); @@ -96,12 +117,12 @@ export const initUtils = async () => { .catch((err) => { console.error("error fetching Python releases", err.message); }); - await request("https://api.adoptium.net/v3/info/available_releases") + await request(adoptiumList) .then(async (res) => { for (const ver of res.data.available_releases) { await request( - `https://api.adoptium.net/v3/assets/latest/${ver}/hotspot?architecture=${archLinux[arch]}&image_type=jdk&os=linux&vendor=eclipse` - ) + `https://api.adoptium.net/v3/assets/latest/${ver}/hotspot?architecture=${archLinux[arch]}&image_type=jdk&os=linux&vendor=eclipse` + ) .then((x) => { for (const binary of x.data) { javaVersionsMap[binary.version.semver] = @@ -118,6 +139,7 @@ export const initUtils = async () => { javaVersionsList, pythonVersionsMap, javaVersionsMap, + rubyVersionsMap, }; }