Skip to content

Commit

Permalink
Update binary metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Oct 4, 2024
1 parent e0a4a30 commit 48fb327
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 43 deletions.
98 changes: 61 additions & 37 deletions src/binaries/metadata.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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": {}
}
}
34 changes: 28 additions & 6 deletions src/binaries/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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?

Expand All @@ -48,18 +53,34 @@ export const initUtils = async () => {
* @type {Record<string, string>}
*/
let javaVersionsMap = {};
await request("https://rvm_io.global.ssl.fastly.net/binaries/centos/9/x86_64/") // currently aarch64 have to rebuilt
/**
* @type {Record<string, string>}
*/
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);
Expand Down Expand Up @@ -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] =
Expand All @@ -118,6 +139,7 @@ export const initUtils = async () => {
javaVersionsList,
pythonVersionsMap,
javaVersionsMap,
rubyVersionsMap,
};
}

Expand Down

0 comments on commit 48fb327

Please sign in to comment.