Skip to content

Fix error installing library targets. - #2441

Closed
nam-cern wants to merge 3 commits into
ray-project:masterfrom
nam-cern:patch-2
Closed

nam-cern wants to merge 3 commits into
ray-project:masterfrom
nam-cern:patch-2

Conversation

@nam-cern

@nam-cern nam-cern commented Jul 20, 2018 •

Copy link
Copy Markdown
Contributor

A typo caused CMake to look for the files object_manager, raylet, etc. in the source directory, instead of built targets.

nam-cern and others added 2 commits July 20, 2018 11:42
A typo caused CMake to look for the file `object_manager` in the source directory, instead of a built target.
@nam-cern nam-cern changed the title Fix error installing object_manager target Fix error installing library targets. Jul 20, 2018
@AmplabJenkins

Copy link
Copy Markdown

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/6737/
Test FAILed.

@AmplabJenkins

Copy link
Copy Markdown

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/6738/
Test FAILed.

Actually, `raylet` is a binary, and `object_manager` is a library.
So place them in BINDIR and LIBDIR respectively.
@AmplabJenkins

Copy link
Copy Markdown

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/6741/
Test FAILed.

@robertnishihara

Copy link
Copy Markdown
Collaborator

@pcmoritz or @atumanov can you take a look?

@ericl

ericl commented Feb 22, 2019

Copy link
Copy Markdown
Contributor

[closing stale issue]

@ericl ericl closed this Feb 22, 2019
dstrodtman pushed a commit that referenced this pull request Aug 19, 2026
## Summary

Pre-bakes the third-party intersphinx inventories so Sphinx no longer
fetches ~two dozen `objects.inv` files over the network at the start of
every docs build.

- Commits 26 `objects.inv` snapshots under `doc/source/_intersphinx/`
(~1.7 MB total).
- Rewires `intersphinx_mapping` in `doc/source/conf.py` to prefer the
**local snapshot**, falling back to the existing upstream URL (or the
`<base_url>objects.inv` default) if a snapshot is missing. Sphinx tries
inventory locations in order and stops at the first that loads, so a
present snapshot means **no network fetch**, and a missing one degrades
to today's remote behavior — an info message, not a `-W`-breaking
warning. The human-readable target list stays intact as
`_intersphinx_targets`; the mapping is derived from it.
- Adds `doc/source/_intersphinx/refresh.py` to rebuild the snapshots (it
reads `_intersphinx_targets` straight from `conf.py`, so it can't drift
from the build config) and a `README.md` documenting the refresh
mechanism.

Resolves **DOC-1050** (parent epic DOC-1046, "Reduce Ray docs Sphinx/RtD
build time"). Estimated impact: ~20–60s per build, plus removal of an
intermittent network-flake failure mode.

### Why

The build fetches every inventory up front on every run — slow, and a
real source of build-time variance. Two of them (pandas, scipy) go
through GitHub release-asset redirects to signed, expiring Azure blob
URLs — the most fragile of the set and the most plausible cause of
intermittent silent timeouts. Snapshotting moves the staleness window
into our control.

Cross-reference *links* still point at each project's live docs site;
only *resolution* uses the local snapshot, so the URLs Sphinx emits are
unchanged.

### What staleness costs, and the refresh mechanism

This is the load-bearing part of the change, so it's worth being
explicit about the trade. `intersphinx_cache_limit` is unset, so
Sphinx's 5-day default applies today:

| | Staleness bound | Upstream **adds** a symbol | Upstream
**removes/renames** a symbol |
|---|---|---|---|
| **Today** | published builds fetch fresh; PR builds ≤5 days | new xref
resolves | xref fails → **loud `-W` failure** |
| **With snapshots** | until someone refreshes | new xref fails → loud
`-W` failure, fix = `refresh.py` | stale snapshot still resolves →
**silent dead outbound link** |

The second column is fine — it's self-announcing and one command to fix.
The third is the real cost: a stale snapshot keeps resolving a symbol
upstream has deleted, so the build stays green while emitting a link to
a page that no longer exists. Ray CI does run the `linkcheck` builder
(`doc: linkcheck` in `.buildkite/doc.rayci.yml`), but it can't catch
this: the step is `skip-on-premerge` with `soft_fail: true`, so it runs
only after merge and never blocks, and `linkcheck_anchors = False` in
`conf.py` means it checks that the target page resolves, not the
`#anchor` a symbol-level cross-reference points at.

Most targets resolve against upstream's *moving* docs, so their
inventory changes when the upstream project *releases*, independently of
anything Ray pins — there is no Ray-side event to refresh against, which
is why it has to be a clock rather than a ride-along with Ray's
dependency bumps. Four targets are exceptions that set an explicit
inventory URL: `pandas` and `scipy` read frozen `object-mirror-*`
release assets under `ray-project`, `torch` is pinned to `docs/2.7/`
while its links point at `docs/stable/`, and `tensorflow` reads a
third-party GPflow mirror tracking its own `master`. For the three
frozen ones a refresh is a no-op and committing a snapshot changes
nothing about their staleness. All pre-existing `conf.py` behavior,
unchanged here.

How fast does this actually drift? Re-running `refresh.py` six days
after the initial capture changed **4 of 26** — `grpc` 1.82.0 → 1.83.0
(a real minor release), plus content changes in `pydantic`, `python`
3.14, and `transformers` `main`. That rate is the argument for a
scheduled refresh in one line.

The mechanism, therefore: **a scheduled monthly job runs `refresh.py`
and opens a PR when any snapshot drifted.** That bounds staleness at ~1
month, and it restores the loud failure — once the fresh inventory drops
a removed symbol, the stale cross-reference fails on the *refresh PR's*
`-W` build. That is why a refresh must land as a reviewed PR and must
never be auto-merged: that build is the entire safety net for the silent
case.

That job is
**[anyscale/docs#2441](anyscale/docs#2441 — a
GitHub Actions workflow modeled on the existing
`bump-ray-template-pins.yml`, which already refreshes Ray's docs
template pins the same way. It reuses that workflow's fork and PAT, so
it opens its PR from a fork and **needs no changes to this repo and no
new permissions here**. It commits only `doc/source/_intersphinx/*.inv`
(a guard fails the run otherwise), signs off with DCO, and reuses one
`auto-refresh-intersphinx-snapshots` branch so monthly runs can't stack
up PRs.

> **Merge order:** land this PR first, then
[anyscale/docs#2441](anyscale/docs#2441). The
workflow errors out by design if `doc/source/_intersphinx/refresh.py`
isn't on `master` yet, so merging it early just produces one noisy
failed run. `README.md` and `refresh.py` describe that job as the
mechanism, so #2441 should not be left indefinitely unmerged either.

### Refreshing by hand

```bash
python doc/source/_intersphinx/refresh.py              # refresh all
python doc/source/_intersphinx/refresh.py numpy torch  # refresh a subset
```

Needed after adding a target, or when a cross-reference to a symbol that
does exist upstream stops resolving.

### Also included

`doc/.claude/skills/sphinx-fix/rules.yaml` — two rules gave advice this
change invalidates:

- `intersphinx-inventory-unreachable` said to re-run the build first, as
a transient network blip. With snapshots committed, reaching `failed to
reach any of the inventories` means **both** locations failed: the
snapshot is missing or unreadable *and* the network fetch failed. A
green re-run then just means the network came back while the missing
snapshot is still missing, so a missing snapshot is now the first thing
to check.
- `py-xref-target-not-found` now notes that a third-party target which
*does* exist upstream points at a stale snapshot — fix by refreshing,
not by editing the reference.

### Not a duplicate

Checked open PRs for `intersphinx` / `objects.inv` / `_intersphinx`:
nothing in flight touches inventory pre-baking. (#60886 is a dependabot
`nbconvert` bump; #64944 is the Sphinx 9.1 upgrade, which mentions
`objects.inv` only incidentally and does not change the mapping.)

### Testing

- `python -m py_compile doc/source/conf.py` — passes under Python 3.11
(Sphinx 8.2.3, current) and 3.12 (Sphinx 9.1.0, the in-progress upgrade
target).
- Offline verification driving Sphinx's own inventory loader
(`_fetch_inventory_group`) with the network fetch path monkeypatched to
raise: **all 26 inventories resolve from local files, 0 network calls,
157,320 cross-reference targets** — identical on Sphinx 8.2.3 and 9.1.0.
(9.1's new `cache_dir` arg only affects remote fetches, so local-first
is unchanged.)
- `refresh.py` successfully re-fetches all 26 inventories, including the
pandas/scipy GitHub-redirect mirrors. Re-run immediately before
requesting review so the snapshots don't land stale: 26/26 succeeded, 4
drifted, all 26 verified as valid v2 inventories afterwards (`# Sphinx
inventory version` banner present, upstream project/version parsed from
each header).
- `python sphinx_fix.py --selftest` → `SELFTEST OK (16 fixtures, 15
rules, 4 suppressions)` after regenerating the three affected goldens.
The rule IDs, tiers, safety levels and unclassified count are unchanged;
only the fix text moved.
- `rules.yaml` parses under real PyYAML (the `check-yaml` hook's parser)
as well as the skill's built-in fallback parser.
- Read the Docs `-W` build: **green** on the first two commits;
rebuilding on the snapshot refresh.

I have not run the full local docs HTML build; the RtD `-W` build on
this PR is the end-to-end check.

### Repo size

The snapshots add ~1.62 MiB, and each refresh adds new blobs for
whichever files changed. `.inv` files are already zlib-compressed so
delta compression barely helps. On the observed drift rate that's
roughly 0.5–1.5 MiB per refresh — call it 6–18 MiB/year — permanently,
against ~20–60s saved on every build plus the removal of a flake class.
Worth stating explicitly rather than leaving to be discovered.

### AI assistance

This PR was prepared with AI assistance (Claude Code). I have reviewed
the change line by line and can defend it end-to-end; the commands run
and their results are listed under Testing above.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Ronny Roland <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
## Summary

Pre-bakes the third-party intersphinx inventories so Sphinx no longer
fetches ~two dozen `objects.inv` files over the network at the start of
every docs build.

- Commits 26 `objects.inv` snapshots under `doc/source/_intersphinx/`
(~1.7 MB total).
- Rewires `intersphinx_mapping` in `doc/source/conf.py` to prefer the
**local snapshot**, falling back to the existing upstream URL (or the
`<base_url>objects.inv` default) if a snapshot is missing. Sphinx tries
inventory locations in order and stops at the first that loads, so a
present snapshot means **no network fetch**, and a missing one degrades
to today's remote behavior — an info message, not a `-W`-breaking
warning. The human-readable target list stays intact as
`_intersphinx_targets`; the mapping is derived from it.
- Adds `doc/source/_intersphinx/refresh.py` to rebuild the snapshots (it
reads `_intersphinx_targets` straight from `conf.py`, so it can't drift
from the build config) and a `README.md` documenting the refresh
mechanism.

Resolves **DOC-1050** (parent epic DOC-1046, "Reduce Ray docs Sphinx/RtD
build time"). Estimated impact: ~20–60s per build, plus removal of an
intermittent network-flake failure mode.

### Why

The build fetches every inventory up front on every run — slow, and a
real source of build-time variance. Two of them (pandas, scipy) go
through GitHub release-asset redirects to signed, expiring Azure blob
URLs — the most fragile of the set and the most plausible cause of
intermittent silent timeouts. Snapshotting moves the staleness window
into our control.

Cross-reference *links* still point at each project's live docs site;
only *resolution* uses the local snapshot, so the URLs Sphinx emits are
unchanged.

### What staleness costs, and the refresh mechanism

This is the load-bearing part of the change, so it's worth being
explicit about the trade. `intersphinx_cache_limit` is unset, so
Sphinx's 5-day default applies today:

| | Staleness bound | Upstream **adds** a symbol | Upstream
**removes/renames** a symbol |
|---|---|---|---|
| **Today** | published builds fetch fresh; PR builds ≤5 days | new xref
resolves | xref fails → **loud `-W` failure** |
| **With snapshots** | until someone refreshes | new xref fails → loud
`-W` failure, fix = `refresh.py` | stale snapshot still resolves →
**silent dead outbound link** |

The second column is fine — it's self-announcing and one command to fix.
The third is the real cost: a stale snapshot keeps resolving a symbol
upstream has deleted, so the build stays green while emitting a link to
a page that no longer exists. Ray CI does run the `linkcheck` builder
(`doc: linkcheck` in `.buildkite/doc.rayci.yml`), but it can't catch
this: the step is `skip-on-premerge` with `soft_fail: true`, so it runs
only after merge and never blocks, and `linkcheck_anchors = False` in
`conf.py` means it checks that the target page resolves, not the
`#anchor` a symbol-level cross-reference points at.

Most targets resolve against upstream's *moving* docs, so their
inventory changes when the upstream project *releases*, independently of
anything Ray pins — there is no Ray-side event to refresh against, which
is why it has to be a clock rather than a ride-along with Ray's
dependency bumps. Four targets are exceptions that set an explicit
inventory URL: `pandas` and `scipy` read frozen `object-mirror-*`
release assets under `ray-project`, `torch` is pinned to `docs/2.7/`
while its links point at `docs/stable/`, and `tensorflow` reads a
third-party GPflow mirror tracking its own `master`. For the three
frozen ones a refresh is a no-op and committing a snapshot changes
nothing about their staleness. All pre-existing `conf.py` behavior,
unchanged here.

How fast does this actually drift? Re-running `refresh.py` six days
after the initial capture changed **4 of 26** — `grpc` 1.82.0 → 1.83.0
(a real minor release), plus content changes in `pydantic`, `python`
3.14, and `transformers` `main`. That rate is the argument for a
scheduled refresh in one line.

The mechanism, therefore: **a scheduled monthly job runs `refresh.py`
and opens a PR when any snapshot drifted.** That bounds staleness at ~1
month, and it restores the loud failure — once the fresh inventory drops
a removed symbol, the stale cross-reference fails on the *refresh PR's*
`-W` build. That is why a refresh must land as a reviewed PR and must
never be auto-merged: that build is the entire safety net for the silent
case.

That job is
**[anyscale/docs#2441](anyscale/docs#2441 — a
GitHub Actions workflow modeled on the existing
`bump-ray-template-pins.yml`, which already refreshes Ray's docs
template pins the same way. It reuses that workflow's fork and PAT, so
it opens its PR from a fork and **needs no changes to this repo and no
new permissions here**. It commits only `doc/source/_intersphinx/*.inv`
(a guard fails the run otherwise), signs off with DCO, and reuses one
`auto-refresh-intersphinx-snapshots` branch so monthly runs can't stack
up PRs.

> **Merge order:** land this PR first, then
[anyscale/docs#2441](anyscale/docs#2441). The
workflow errors out by design if `doc/source/_intersphinx/refresh.py`
isn't on `master` yet, so merging it early just produces one noisy
failed run. `README.md` and `refresh.py` describe that job as the
mechanism, so ray-project#2441 should not be left indefinitely unmerged either.

### Refreshing by hand

```bash
python doc/source/_intersphinx/refresh.py              # refresh all
python doc/source/_intersphinx/refresh.py numpy torch  # refresh a subset
```

Needed after adding a target, or when a cross-reference to a symbol that
does exist upstream stops resolving.

### Also included

`doc/.claude/skills/sphinx-fix/rules.yaml` — two rules gave advice this
change invalidates:

- `intersphinx-inventory-unreachable` said to re-run the build first, as
a transient network blip. With snapshots committed, reaching `failed to
reach any of the inventories` means **both** locations failed: the
snapshot is missing or unreadable *and* the network fetch failed. A
green re-run then just means the network came back while the missing
snapshot is still missing, so a missing snapshot is now the first thing
to check.
- `py-xref-target-not-found` now notes that a third-party target which
*does* exist upstream points at a stale snapshot — fix by refreshing,
not by editing the reference.

### Not a duplicate

Checked open PRs for `intersphinx` / `objects.inv` / `_intersphinx`:
nothing in flight touches inventory pre-baking. (ray-project#60886 is a dependabot
`nbconvert` bump; ray-project#64944 is the Sphinx 9.1 upgrade, which mentions
`objects.inv` only incidentally and does not change the mapping.)

### Testing

- `python -m py_compile doc/source/conf.py` — passes under Python 3.11
(Sphinx 8.2.3, current) and 3.12 (Sphinx 9.1.0, the in-progress upgrade
target).
- Offline verification driving Sphinx's own inventory loader
(`_fetch_inventory_group`) with the network fetch path monkeypatched to
raise: **all 26 inventories resolve from local files, 0 network calls,
157,320 cross-reference targets** — identical on Sphinx 8.2.3 and 9.1.0.
(9.1's new `cache_dir` arg only affects remote fetches, so local-first
is unchanged.)
- `refresh.py` successfully re-fetches all 26 inventories, including the
pandas/scipy GitHub-redirect mirrors. Re-run immediately before
requesting review so the snapshots don't land stale: 26/26 succeeded, 4
drifted, all 26 verified as valid v2 inventories afterwards (`# Sphinx
inventory version` banner present, upstream project/version parsed from
each header).
- `python sphinx_fix.py --selftest` → `SELFTEST OK (16 fixtures, 15
rules, 4 suppressions)` after regenerating the three affected goldens.
The rule IDs, tiers, safety levels and unclassified count are unchanged;
only the fix text moved.
- `rules.yaml` parses under real PyYAML (the `check-yaml` hook's parser)
as well as the skill's built-in fallback parser.
- Read the Docs `-W` build: **green** on the first two commits;
rebuilding on the snapshot refresh.

I have not run the full local docs HTML build; the RtD `-W` build on
this PR is the end-to-end check.

### Repo size

The snapshots add ~1.62 MiB, and each refresh adds new blobs for
whichever files changed. `.inv` files are already zlib-compressed so
delta compression barely helps. On the observed drift rate that's
roughly 0.5–1.5 MiB per refresh — call it 6–18 MiB/year — permanently,
against ~20–60s saved on every build plus the removal of a flake class.
Worth stating explicitly rather than leaving to be discovered.

### AI assistance

This PR was prepared with AI assistance (Claude Code). I have reviewed
the change line by line and can defend it end-to-end; the commands run
and their results are listed under Testing above.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Ronny Roland <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants