Skip to content

Solution builder not detecting out of date compiler optionsΒ #62035

Closed as not planned

Description

πŸ”Ž Search Terms

"solution builder cache", "tsbuildinfo cache", "compiler options change build"

πŸ•— Version & Regression Information

n/a

⏯ Playground Link

n/a

πŸ’» Code

n/a

πŸ™ Actual behavior

  1. In a project using references, suppose you have a tsconfig.json specifying any random option (e.g., skipLibCheck: true).
  2. Run a build using tsc --build ./tsconfig.json.
  3. See output.
  4. Run the build again, this time programmatically using createSolutionBuilder and override one compiler option via getParsedCommandLine in the builder host (e.g., skipLibCheck: false).
  5. Build will be skipped as the builder sees project files are not out of date, but fails to detect that compiler options are not the same used during the last build. We get the same output of the previous run.
  6. Cleaning up .tsbuildinfo files and running the build programmatically again work as expected. New output is different from the first one.

πŸ™‚ Expected behavior

I would expect the builder to detect that new compiler options are different from the last used and re-build that project.

Additional information about the issue

I narrowed down the issue to ./src/compiler/tsbuildPublic.ts - Line 1606

Basically, there is where UpToDateStatusType.OutOfDateOptions is reported, but current compiler options are not being compared with the ones from the relative tsbuildinfo file.

Manually changing the tsconfig.json file works because the timestamp of the file changes and not because options are different.

I discovered this while creating a script to address #30511

Note: I would be happy to open a PR

Activity

  1. sheetalkamat commented on Sep 25, 2025

    @sheetalkamat
    Member

    This is working as intended. Options like skipLibCheck arent allowed on command line with --b which means they arent checked for change if they arent changed without changing timestamp of "configFile" which is what we check.

  2. added
    Working as IntendedThe behavior described is the intended behavior; this is not a bug
    and removed
    Needs InvestigationThis issue needs a team member to investigate its status.
    on Sep 25, 2025
  3. ernestostifano commented on Sep 26, 2025

    @ernestostifano
    Author

    Sheetal Nandi (@sheetalkamat) but looking at code around ./src/compiler/tsbuildPublic.ts - Line 1606 it seems that we could compare options values, making the caching system way more powerful than it is right now. And it would work both for the CLI and for programmatic APIs.

  4. sheetalkamat commented on Sep 26, 2025

    @sheetalkamat
    Member

    It adds to cost and these options arent present in buildInfo for "non composite" projects so its not enough but would need to serialize these options in tsbuildinfo for non-incremental as well

  5. typescript-bot commented on Sep 29, 2025

    @typescript-bot
    Contributor

    This issue has been marked as "Working as Intended" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

  6. locked as resolved and limited conversation to collaborators on Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Working as IntendedThe behavior described is the intended behavior; this is not a bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions