Skip to content

Cached Lua exports can link to the wrong declaration line #387

Backlog

Description

@tony

Summary

A cached Lua export records declaration line numbers and a Git revision. If the source changes during export and is then restored, the website still uses the cached line numbers for the restored commit. Readers can land on another declaration.

Reproduction

  1. Check out the public Lua source below. Insert ten blank lines at the beginning of lua/libtmux/_internal/runtime.lua.
  2. Run the Lua documentation exporter. Restore the source file from Git and keep the export.
  3. Generate the website Lua model from the restored checkout and inspect the emitted source location for Runtime:connect.

Expected

The website cites a declaration only when the exporter read the same bytes as the linked Git blob.

Actual

Runtime:connect points to line 1064, the spawn declaration. The committed connect declaration is at line 1054.

Environment

Website and exporter

Linux ARM64, Node 26.5.1, LuaJIT 2.1, LuaLS 3.19.1. The restored checkout was clean and the cached export still recorded its commit.

References

Codex reproduced the misplaced link using a public checkout and its native exporter.

Activity

  1. added
    bug
    p2
    area:build
    topic:api
    port:lua
    on Dec 5, 2026
  2. tony commented on Dec 5, 2026

    @tony
    ContributorAuthor

    The website fix is in #394. On current Lua master, a fresh export links Runtime:connect to line 1054. Restoring an older export previously sent that link to spawn at line 1064. The fixed reference keeps the signature and the other 17 verified files. On v0.1.1, the link opens connect at line 1046 and the example still installs 0.1.1-1 with the release’s original launcher.

    The draft builds on the release recipe PR and uses the declaration hashes supplied by the Lua exporter. Website recipes · Lua exporter.

    I also built the tagged site and opened the method in Chromium. Clicking Source displayed the declaration at line 1046 beside the reference page, and Escape closed the pane. The example’s launcher matched the tagged file byte for byte. Method in the public tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:buildbugp2port:luatopic:api

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions