Skip to content

[@rustack/package-deps-hash] ls-tree HEAD -r causes codespaces to hang #5499

@jcreamer898

Description

@jcreamer898

Summary

The getPackageDeps function is called from Backfill, https://github.com/microsoft/backfill/blob/main/packages/hasher/src/repoInfo.ts#L42.

That getPackageDeps calls git ls-tree HEAD -r here...https://github.com/microsoft/rushstack/blob/main/libraries/package-deps-hash/src/getPackageDeps.ts#L191

The problem is, in a new Codespace, that ls-tree command can take as many as 20 minutes to run when the tree objects are dispersed amongst large pack files.

Repro steps

We're able to reproduce the issue consistently in new codespaces in 1JS by simply creating a new Codespace, and immediately running any command via lage which uses Backfill.

The command will hang, and in htop you'll see git ls-tree.

Details

We believe there is a simpler way to get the hashes via git's index which is faster anyways, and is already present on disk and doesn't require downloading pack files.

git ls-files --format='%(objectmode) blob %(objectname)%x09%(path)'
Image

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
Package name: @rustack/package-deps-hash
Package version? *
Operating system? Linux
Would you consider contributing a PR? Yes
Node.js version (node -v)? 22.18

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions