Skip to content

tsbuildinfo files include platform-specific paths #1548

@jakebailey

Description

@jakebailey

A side effect of having per-platform packages is that the lib files (which must live next to the binary) have paths that include the name of the platform. This then makes its way into tsbuildinfo, like:

{
  "version": "7.0.0-dev.20250808.1",
  "fileNames": [
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es5.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2015.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2016.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2017.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2018.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2019.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2020.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2021.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2022.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2023.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2024.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.esnext.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.dom.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.dom.iterable.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2015.core.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2015.collection.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2015.generator.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2015.iterable.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2015.promise.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2015.proxy.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2015.reflect.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2015.symbol.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2015.symbol.wellknown.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2016.array.include.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2016.intl.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2017.arraybuffer.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2017.date.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2017.object.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2017.sharedmemory.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2017.string.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2017.intl.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2017.typedarrays.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2018.asyncgenerator.d.ts",
    "../../node_modules/@typescript/native-preview-darwin-arm64/lib/lib.es2018.asynciterable.d.ts",
    // ...
  ]
}

I don't think we expect people to commit their tsbuildinfo files, but I suspect that people do use them for some caching systems or something, which this would be a problem for.

We might want to consider reworking tsbuildinfo to special case lib files to avoid this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: Build ModeRelated to build mode, project references, solutionsDomain: Porting MetaMeta-level porting concernsDomain: ProgramRelated to the Program, file loading

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions