Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions scripts/compare_pkg_completeness.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def collect_builds(
for bit, platform in enumerate(PLATFORMS):
for artifact in repos[platform]:
name = artifact["name"]
if not name.startswith("ros-") or name in MUTEX_NAMES:
if not (name.startswith("ros-") or name.startswith("ros2-")) or name in MUTEX_NAMES:
continue

newest_build[name] = max(
Expand Down Expand Up @@ -332,8 +332,9 @@ def slots(per_mutex: dict[str, Slot]) -> list[Any]:
return [[per_mutex[v].mask, per_mutex[v].version] if v in per_mutex else 0 for v in mutexes]

packages: list[list[Any]] = []
package_prefix = "ros2" if distro == "rolling" else f"ros-{distro}"
for name in sorted(index):
conda_name = f"ros-{distro}-{name.replace('_', '-')}"
conda_name = f"{package_prefix}-{name.replace('_', '-')}"
per_mutex = builds.get(conda_name, {})
entry = index[name]

Expand All @@ -343,7 +344,8 @@ def slots(per_mutex: dict[str, Slot]) -> list[Any]:

packages.append(
[
name.replace("_", "-"), # conda spelling, `ros-<distro>-` stripped
name.replace("_", "-"), # conda spelling, distro prefix stripped
conda_name,
metadata.get(name, ""),
entry.version, # as released into the ROS index
newest_build.get(conda_name, 0) // 1000, # newest build, seconds
Expand All @@ -354,15 +356,19 @@ def slots(per_mutex: dict[str, Slot]) -> list[Any]:
)

# Packages on the channel that rosdistro has never released: no description,
# index version or source repository, but installable all the same.
prefix = f"ros-{distro}-"
released = {f"ros-{distro}-{name.replace('_', '-')}" for name in index}
# index version or source repository, but installable all the same. Rolling's
# ros-rolling-* names are skipped here: they are empty shims pinning the
# ros2-* package of the same version, so a row of their own would duplicate
# every package on the page.
prefix = f"{package_prefix}-"
released = {f"{package_prefix}-{name.replace('_', '-')}" for name in index}
for conda_name in sorted(set(builds) - released):
if not conda_name.startswith(prefix):
continue
packages.append(
[
conda_name.removeprefix(prefix),
conda_name,
"",
"",
newest_build.get(conda_name, 0) // 1000,
Expand All @@ -379,7 +385,16 @@ def slots(per_mutex: dict[str, Slot]) -> list[Any]:
"platforms": PLATFORMS,
"mutexPackage": mutex_package,
"mutexes": mutexes,
"fields": ["name", "desc", "indexVersion", "updated", "repo", "indexed", "builds"],
"fields": [
"name",
"condaName",
"desc",
"indexVersion",
"updated",
"repo",
"indexed",
"builds",
],
"repos": repo_urls,
"packages": packages,
}
Expand Down Expand Up @@ -414,8 +429,8 @@ def refresh(distro: str, channel: str) -> None:

total = len(document["packages"])
newest = document["mutexes"][0] if document["mutexes"] else None
on_newest = sum(1 for p in document["packages"] if p[6] and p[6][0])
ever = sum(1 for p in document["packages"] if any(p[6]))
on_newest = sum(1 for p in document["packages"] if p[7] and p[7][0])
ever = sum(1 for p in document["packages"] if any(p[7]))
print(
f" -> {path}: {total} packages, {ever} built at some point, "
f"{on_newest} on mutex {newest}, {path.stat().st_size / 1e6:.2f} MB",
Expand Down
7 changes: 5 additions & 2 deletions src/components/package-table/PackageTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,10 @@
</tr>
{/if}
{#each slice as row, i (row.name)}
{@const conda = "ros-" + distro + "-" + row.name}
{@const conda = row.condaName}
<!-- Every row on a page carries the same prefix, so it is split
back off the conda name for the muted/hidden treatment. -->
{@const prefix = conda.slice(0, conda.length - row.name.length)}
<!-- The ROS index spells package names with underscores; conda
uses hyphens. -->
{@const rosName = row.name.replace(/-/g, "_")}
Expand All @@ -490,7 +493,7 @@
></span>
<span class="rs-name">
<span class="rs-pkg">
<span class="rs-prefix">ros-{distro}-</span>{row.name}
<span class="rs-prefix">{prefix}</span>{row.name}
</span>
<!--
On this mutex: the version built for it, plus an orange
Expand Down
13 changes: 12 additions & 1 deletion src/components/package-table/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ export interface Upgrade {
}

export interface Row {
/** The ROS package name in conda's hyphen spelling, with the distro's
* package prefix stripped. */
name: string;
/** The name the package is published under on the channel, prefix and all:
* `ros2-desktop` on rolling, `ros-jazzy-desktop` everywhere else. */
condaName: string;
desc: string;
indexVersion: string;
updated: number;
Expand Down Expand Up @@ -91,17 +96,23 @@ export function unpackRows(doc: Doc): Row[] {
doc.fields.forEach((field, i) => (at[field] = i));
return doc.packages.map((pkg) => {
const name = pkg[at.name] as string;
// The committed foxy and galactic snapshots predate condaName. They are
// ROS 1-era ros-<distro>-<name> data, so reconstruct that spelling rather
// than applying today's rolling ros2-* convention to them.
const condaName =
((pkg[at.condaName] ?? "") as string) || `ros-${doc.distro}-${name}`;
const desc = (pkg[at.desc] ?? "") as string;
const repo = pkg[at.repo] as number;
return {
name,
condaName,
desc,
indexVersion: (pkg[at.indexVersion] ?? "") as string,
updated: (pkg[at.updated] ?? 0) as number,
repo: repo >= 0 ? (doc.repos[repo] ?? "") : "",
indexed: at.indexed === undefined || Boolean(pkg[at.indexed]),
builds: pkg[at.builds] as BuildSlot[], // aligned with doc.mutexes
haystack: (name + " " + desc).toLowerCase(),
haystack: (name + " " + condaName + " " + desc).toLowerCase(),
};
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/GettingStarted.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ ros-lyrical-desktop = "*"
channels = ["https://prefix.dev/robostack-rolling"]

[feature.rolling.dependencies]
ros-rolling-desktop = "*"
ros2-desktop = "*"
```

```bash
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/conda.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ There are different channels depending on the version of ROS that you wish to in
</TabItem>
<TabItem label="ROS 2 Rolling">
```bash
# Create a ros-rolling desktop environment
conda create -n ros_env -c conda-forge -c robostack-rolling ros-rolling-desktop
# Create a ROS 2 Rolling desktop environment
conda create -n ros_env -c conda-forge -c robostack-rolling ros2-desktop
# Activate the environment
conda activate ros_env
# Add the robostack channel to the environment
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/micromamba.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ There are different channels depending on the version of ROS that you wish to in
</TabItem>
<TabItem label="ROS 2 Rolling">
```bash
# Create a ros-rolling desktop environment
micromamba create -n ros_env -c conda-forge -c robostack-rolling ros-rolling-desktop
# Create a ROS 2 Rolling desktop environment
micromamba create -n ros_env -c conda-forge -c robostack-rolling ros2-desktop
# Activate the environment
micromamba activate ros_env
# Add the robostack channel to the environment
Expand Down
4 changes: 4 additions & 0 deletions src/data/distros.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ export function browseUrl(distro: Distro): string {
export function title(distro: Distro): string {
return distro.name.charAt(0).toUpperCase() + distro.name.slice(1);
}
/** The conda package prefix used for the distro's primary packages. */
export function packagePrefix(distro: Distro): string {
return distro.name === "rolling" ? "ros2" : `ros-${distro.name}`;
}

/** The release and support summary shown under the title. */
export function supportLine(distro: Distro): string {
Expand Down
10 changes: 8 additions & 2 deletions src/pages/[distro].astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro";
import { Aside, Code } from "@astrojs/starlight/components";
import PackageTable from "../components/package-table/PackageTable.astro";
import type { Distro } from "../data/distros";
import { browseUrl, DISTROS, monthYear, title } from "../data/distros";
import {
browseUrl,
DISTROS,
monthYear,
packagePrefix,
title,
} from "../data/distros";

export function getStaticPaths() {
return DISTROS.map((distro) => ({
Expand All @@ -20,7 +26,7 @@ const { distro } = Astro.props;
const browse = browseUrl(distro);
const install = [
`pixi workspace channel add ${distro.base}/${distro.channel}`,
`pixi add ros-${distro.name}-<package>`,
`pixi add ${packagePrefix(distro)}-<package>`,
].join("\n");
---

Expand Down