Skip to content

Building --target i686-windows-msvc on x86_64-windows-msvc triggers an index auto-refresh on every build (regression after #967) #996

Closed

Description

@julixian

Environment

  • mcpp: 2026.11.20.1
  • Host: x86_64-windows-msvc (Windows x64)
  • Toolchain / Sysroot: llvm@23.1.3 + local Visual Studio 2026 (14.52.37025 default, 14.44.35207 installed)
  • Config: default [index] auto_refresh = true

What happens

In a workspace with an explicit [workspace.target.i686-windows-msvc] table declaring sysroot = "msvc@14.44" (and no platform key):

[workspace.toolchain]
windows = "llvm@23.1.3"

[workspace.target.x86_64-windows-msvc]
sysroot = "msvc@14.44"

[workspace.target.i686-windows-msvc]
sysroot = "msvc@14.44"
  • Running mcpp build --target x86_64-windows-msvc ... resolves cleanly with no index refresh.
  • Running mcpp build --target i686-windows-msvc ... triggers a full automatic index refresh (sync_index for mcpplibs + update_packages for xim) on every single build, adding ~15–19s each time even when the index was refreshed only minutes earlier.

Observed in registry/logs/ops/2026-11-21/*.ndjson across three consecutive i686-windows-msvc builds on the same day (none of which ran install_packages afterward; all three succeeded using the local VS 14.44.35207 sysroot):

  • 16:56:53Z — sync_index (mcpplibs) (1.0s) + update_packages (13.7s)
  • 17:49:25Z — sync_index (mcpplibs) (3.8s) + update_packages (10.8s)
  • 17:52:33Z — sync_index (mcpplibs) (1.5s) + update_packages (17.5s) (3 minutes after the previous refresh)

Root cause

This looks like a side effect of #967 / #966 (refreshing the index on a platform-column miss):

  1. i686-windows-msvc is not in the built-in target table (mcpp toolchain list lists x86_64-windows-msvc as host, along with x86_64-windows-gnu, aarch64-windows-gnu, x86_64-windows-musl, etc., but not i686-windows-msvc), and no platform package in mcpplibs/mcpp-index serves i686-windows-msvc.
  2. Because i686-windows-msvc differs from the x86_64-windows-msvc host and platform is unset, target resolution scans the index's platform column (the platform column for i686-windows-msvc) with auto-refresh enabled.
  3. The lookup misses locally, refreshes the full package index (sync_index + update_packages), misses again, and then falls back cleanly to the configured local MSVC sysroot — repeating the entire refresh on the very next i686-windows-msvc build.

Expected

  • i686-windows-msvc should be recognized as a native Windows MSVC target that needs no platform package (just like x86_64-windows-msvc), so building 32-bit Windows targets on a 64-bit Windows host does not search for a platform package in the index; and/or
  • When a target already has an explicit [target.<triple>] section with a non-platform sysroot (such as msvc@14.44 / msvc@system), a platform-column miss should not trigger a repeated index auto-refresh on every build.

Workaround

Explicitly setting platform = "none" under [workspace.target.i686-windows-msvc] (or passing --platform none) skips the platform-column lookup and avoids the repeated refresh.

Activity

  1. speak-agent commented on Nov 22, 2026

    @speak-agent
    Member

    Fixed in 2026.11.22.1 (#1001).

    Before, every build more than the debounce apart refreshed the index when the platform column missed. Now a miss refreshes the index only when the build would otherwise be refused for lack of a platform. Two cases are not refused, so they no longer refresh:

    • a custom triple that a [target.<triple>] section defines;
    • a planned row built with a named toolchain.

    platform = "none" in a table ends the lookup, as --platform none does. i686-windows-msvc is now a preview row served by the msvc provider, so building it needs neither a section nor a platform. e2e 1145 covers the three requests; it fails on the previous release and passes on this one.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions