fix(link): conditionally exclude a dev-dep own main object — fix mcpp test duplicate main (v0.0.64)#167
Merged
Merged
Conversation
…ate main)
gtest's gtest_main.cc carries its own main(); mcpp inlined ALL of a dependency's
objects into every test binary, so a test that defined its own main() collided
with gtest_main.o → `ld.lld: error: duplicate symbol: main`.
Honor the dependency's already-declared `kind="lib"` (compat.gtest.lua sets it):
compile such a dep into a per-package static archive lib<pkg>.a and link it AFTER
the consumer's objects. Standard archive semantics then pull a member only when a
symbol is still undefined — so gtest_main.o's main() is pulled ONLY for tests that
define none. All {own-main, framework-main} × {uses-gtest, doesn't} combinations
link correctly, transparently.
Generic, driven by the descriptor's `kind` — no gtest special-casing in mcpp. A
future test framework just declares kind="lib". Module (.cppm) objects are never
archived (they carry global init); pure-module deps (mcpplibs.cmdline) are byte
-for-byte unchanged.
- plan.cppm: LinkUnit.archiveInputs; synthesize StaticLibrary unit per kind=lib
dep; consumers reference the .a instead of inlining its non-module objects.
- ninja_backend.cppm: emit archiveInputs via $in, after objects.
- unit: NinjaBackend.ArchiveInputsLinkedAfterObjects
- e2e: 78_test_main_combinations.sh (4 main×gtest combinations)
- design: .agents/docs/2026-06-25-dependency-archive-linking-design.md
- bump 0.0.63 -> 0.0.64
…ed .a) The dep static archive was named lib<pkg>.a on every platform; Windows uses static_lib_ext=.lib / empty lib_prefix, so the hardcoded name broke the Windows test link. Use platform::lib_prefix + static_lib_ext (mirrors target_output), placed in bin/. e2e 07 (static lib) is requires:elf so this archive path was never exercised on Windows before.
run_tests printed only 'build failed' (the error message), dropping the backend's diagnosticOutput — unlike run_build_plan. That makes test-link failures undebuggable (esp. on CI). Print diagnosticOutput to stderr for parity.
…LNK1561)
A pure-archive approach broke Windows: mcpp links via MSVC lld-link there, which
does NOT pull an archive member just to satisfy the entry point — so tests with
no own main (relying on gtest_main) failed with LNK1561 'entry point must be
defined'. (--start-lib isn't an option: Mach-O lld doesn't support it.)
Decide per consumer by scanning its entry source for a main definition:
- defines main → link the dep as an archive (member with main not pulled → no
duplicate main; entry comes from the test, fine on every linker)
- no main → inline the dep's objects directly, so the dep's gtest_main
-style entry object provides main on every linker incl. MSVC
Generic (only inspects the consumer, not which dep object holds main) and covers
all {own/framework main} × {uses/doesn't use gtest} combinations on Linux,
macOS and Windows. Also: dep archive now uses platform-aware naming.
Verified locally: e2e 78 green; nomain test inlines gtest_main.o, ownmain test
links libcompat_gtest.a.
…dows LNK1561
The per-consumer archive-vs-inline decision scanned source text line-by-line for
'int main(', which false-positived on test fixtures embedding "int main(){}"
as a STRING (test_modgraph.cpp). That wrongly picked archive linking for a
no-main test → MSVC lld-link doesn't pull gtest_main.o for the entry → LNK1561.
(On ELF/Mach-O the archive member IS pulled, so Linux/macOS masked the bug.)
source_defines_main now strips comments + string/char/raw-string literals via a
char state machine before matching int/auto main(. Exported + unit-tested
(test_main_detection.cpp: string/raw-string/comment fixtures must NOT count).
… archives) Static archives proved non-viable on Windows/MSVC lld-link: - LNK1561: it won't pull an archive member just to satisfy the entry point, so no-main tests (gtest TEST macros + gtest_main) failed to link; - LNK2019: archiving regular libs broke transitive symbol resolution order (libarchive→lzma) when building xlings. Replace the archive approach: keep every dependency object INLINED (the long-standing model, so xlings/libarchive/lzma are byte-for-byte unchanged) and only drop a dependency's OWN main-providing object (e.g. gtest_main.o) from consumers that define their own main. A consumer without its own main still inlines it directly, providing the entry on every linker incl. MSVC. - plan.cppm: precompute depEntryMainSources (dep impl sources defining main), skip them for self-main consumers; removed StaticLibrary-archive synthesis + LinkUnit.archiveInputs + its ninja emission. - generic: only inspects 'does this object/consumer define main', no gtest or per-framework knowledge; descriptor (mcpp-index) unchanged. - verified: e2e 78 (3 combos) + 25 unit tests green; own-main test excludes gtest_main.o, framework-main test includes it; no static archives emitted.
The previous commit scanned ALL dependency sources for a main definition and
dropped matches from self-main consumers. source_defines_main false-positived on
a regular C dep source while building xlings, dropping a needed libarchive object
→ 'undefined reference to archive_entry_*' on every platform.
Test frameworks are ALWAYS dev-dependencies; regular deps (libarchive, lzma, …)
must never be touched. Scope the scan to dev-dep packages only (derived from the
root manifest's [dev-dependencies] via dependency_name_candidates). Regular deps
are now byte-for-byte unchanged, and plain Finished release [optimized] in 0.01s (no dev-deps resolved) is
unaffected by construction.
Verified locally: mcpp's own Resolving toolchain
Resolved gcc@16.1.0 → @mcpp/registry/data/xpkgs/xim-x-gcc/16.1.0/bin/g++
Compiling mcpp v0.0.64 (.)
Cached mcpplibs.cmdline v0.0.1
Cached gtest v1.15.2 (dev)
Compiling test_bmi_cache (test)
Compiling test_compile_commands (test)
Compiling test_config (test)
Compiling test_doctor_runpath (test)
Compiling test_dyndep (test)
Compiling test_fingerprint (test)
Compiling test_install_integrity (test)
Compiling test_main_detection (test)
Compiling test_mangle (test)
Compiling test_manifest (test)
Compiling test_modgraph (test)
Compiling test_ninja_backend (test)
Compiling test_p1689 (test)
Compiling test_pack_modes (test)
Compiling test_pm_compat (test)
Compiling test_pm_package_fetcher (test)
Compiling test_process_run_exec (test)
Compiling test_process_seal_stdin (test)
Compiling test_toml (test)
Compiling test_toolchain_detect (test)
Compiling test_toolchain_registry (test)
Compiling test_toolchain_stdmod (test)
Compiling test_version_req (test)
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 8 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 8 tests from BmiCache
[ RUN ] BmiCache.KeyDirLayoutMatchesDocs26
[ OK ] BmiCache.KeyDirLayoutMatchesDocs26 (0 ms)
[ RUN ] BmiCache.IsCachedFalseWhenManifestMissing
[ OK ] BmiCache.IsCachedFalseWhenManifestMissing (0 ms)
[ RUN ] BmiCache.PopulateThenStageRoundTrip
[ OK ] BmiCache.PopulateThenStageRoundTrip (0 ms)
[ RUN ] BmiCache.StageIntoDoesNotTouchIdenticalOutputs
[ OK ] BmiCache.StageIntoDoesNotTouchIdenticalOutputs (0 ms)
[ RUN ] BmiCache.StageIntoDoesNotOverwriteExistingOutputs
[ OK ] BmiCache.StageIntoDoesNotOverwriteExistingOutputs (0 ms)
[ RUN ] BmiCache.IsCachedFalseWhenSentinelExistsButFileMissing
[ OK ] BmiCache.IsCachedFalseWhenSentinelExistsButFileMissing (0 ms)
[ RUN ] BmiCache.PopulateFailsIfBuildOutputMissing
[ OK ] BmiCache.PopulateFailsIfBuildOutputMissing (0 ms)
[ RUN ] BmiCache.PopulateSkipsWhenLockHeld
[ OK ] BmiCache.PopulateSkipsWhenLockHeld (0 ms)
[----------] 8 tests from BmiCache (4 ms total)
[----------] Global test environment tear-down
[==========] 8 tests from 1 test suite ran. (4 ms total)
[ PASSED ] 8 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 4 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 4 tests from CompileCommandsMerge
[ RUN ] CompileCommandsMerge.PreservesPriorEntriesForFilesNotInFreshPlan
[ OK ] CompileCommandsMerge.PreservesPriorEntriesForFilesNotInFreshPlan (0 ms)
[ RUN ] CompileCommandsMerge.PrunesPriorEntriesWhoseFileNoLongerExists
[ OK ] CompileCommandsMerge.PrunesPriorEntriesWhoseFileNoLongerExists (0 ms)
[ RUN ] CompileCommandsMerge.FreshEntryWinsAndNoDuplicatePerFile
[ OK ] CompileCommandsMerge.FreshEntryWinsAndNoDuplicatePerFile (0 ms)
[ RUN ] CompileCommandsMerge.MalformedExistingFallsBackToFresh
[ OK ] CompileCommandsMerge.MalformedExistingFallsBackToFresh (0 ms)
[----------] 4 tests from CompileCommandsMerge (0 ms total)
[----------] Global test environment tear-down
[==========] 4 tests from 1 test suite ran. (0 ms total)
[ PASSED ] 4 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 6 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 6 tests from Config
[ RUN ] Config.ProjectXlingsDataRootsIncludeLegacyAndNestedLayouts
[ OK ] Config.ProjectXlingsDataRootsIncludeLegacyAndNestedLayouts (0 ms)
[ RUN ] Config.ProjectIndexDataInitializedChecksNestedXlingsData
[ OK ] Config.ProjectIndexDataInitializedChecksNestedXlingsData (0 ms)
[ RUN ] Config.ResolveProjectIndexPathUsesProjectRootForRelativeLocalIndex
[ OK ] Config.ResolveProjectIndexPathUsesProjectRootForRelativeLocalIndex (0 ms)
[ RUN ] Config.ProjectIndexJsonEscapesLocalIndexPath
[ OK ] Config.ProjectIndexJsonEscapesLocalIndexPath (0 ms)
[ RUN ] Config.ProjectIndexDirExposesOfficialXimIndex
[ OK ] Config.ProjectIndexDirExposesOfficialXimIndex (0 ms)
[ RUN ] Config.ProjectLocalIndexStaleCacheIsRemoved
[ OK ] Config.ProjectLocalIndexStaleCacheIsRemoved (0 ms)
[----------] 6 tests from Config (1 ms total)
[----------] Global test environment tear-down
[==========] 6 tests from 1 test suite ran. (1 ms total)
[ PASSED ] 6 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 4 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 4 tests from DoctorRunpath
[ RUN ] DoctorRunpath.ParsesRunpathColonSeparatedDirs
[ OK ] DoctorRunpath.ParsesRunpathColonSeparatedDirs (0 ms)
[ RUN ] DoctorRunpath.ParsesLegacyRpath
[ OK ] DoctorRunpath.ParsesLegacyRpath (0 ms)
[ RUN ] DoctorRunpath.NoRunpathYieldsEmpty
[ OK ] DoctorRunpath.NoRunpathYieldsEmpty (0 ms)
[ RUN ] DoctorRunpath.DropsEmptyTokens
[ OK ] DoctorRunpath.DropsEmptyTokens (0 ms)
[----------] 4 tests from DoctorRunpath (0 ms total)
[----------] Global test environment tear-down
[==========] 4 tests from 1 test suite ran. (0 ms total)
[ PASSED ] 4 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 6 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 6 tests from Dyndep
[ RUN ] Dyndep.BmiBasenameSanitizes
[ OK ] Dyndep.BmiBasenameSanitizes (0 ms)
[ RUN ] Dyndep.ParseDdiPickProvidesRequires
[ OK ] Dyndep.ParseDdiPickProvidesRequires (0 ms)
[ RUN ] Dyndep.EmitDyndepBasic
[ OK ] Dyndep.EmitDyndepBasic (0 ms)
[ RUN ] Dyndep.EmitDyndepNoRequires
[ OK ] Dyndep.EmitDyndepNoRequires (0 ms)
[ RUN ] Dyndep.EmitDyndepSelfProvideFiltered
[ OK ] Dyndep.EmitDyndepSelfProvideFiltered (0 ms)
[ RUN ] Dyndep.EmitDyndepFromFiles
[ OK ] Dyndep.EmitDyndepFromFiles (0 ms)
[----------] 6 tests from Dyndep (0 ms total)
[----------] Global test environment tear-down
[==========] 6 tests from 1 test suite ran. (0 ms total)
[ PASSED ] 6 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 5 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 5 tests from Fingerprint
[ RUN ] Fingerprint.DeterministicForSameInputs
[ OK ] Fingerprint.DeterministicForSameInputs (0 ms)
[ RUN ] Fingerprint.ProducesSixteenHexChars
[ OK ] Fingerprint.ProducesSixteenHexChars (0 ms)
[ RUN ] Fingerprint.AllTenFieldsAffectHash
[ OK ] Fingerprint.AllTenFieldsAffectHash (0 ms)
[ RUN ] Fingerprint.StableAcrossBinaryPathsWhenDriverIdentMatches
[ OK ] Fingerprint.StableAcrossBinaryPathsWhenDriverIdentMatches (0 ms)
[ RUN ] Fingerprint.HashStringMatchesHashFile
[ OK ] Fingerprint.HashStringMatchesHashFile (0 ms)
[----------] 5 tests from Fingerprint (0 ms total)
[----------] Global test environment tear-down
[==========] 5 tests from 1 test suite ran. (0 ms total)
[ PASSED ] 5 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 5 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 5 tests from InstallIntegrityStash
[ RUN ] InstallIntegrityStash.RestoresLegacyPackageOnFailedReinstall
[ OK ] InstallIntegrityStash.RestoresLegacyPackageOnFailedReinstall (0 ms)
[ RUN ] InstallIntegrityStash.CommitDropsBackupAndKeepsNewInstall
[ OK ] InstallIntegrityStash.CommitDropsBackupAndKeepsNewInstall (0 ms)
[ RUN ] InstallIntegrityStash.KeepsNewCompleteInstallWhenUncommitted
[ OK ] InstallIntegrityStash.KeepsNewCompleteInstallWhenUncommitted (0 ms)
[ RUN ] InstallIntegrityStash.DiscardsNonLegacyResidueOnFailure
[ OK ] InstallIntegrityStash.DiscardsNonLegacyResidueOnFailure (0 ms)
[ RUN ] InstallIntegrityStash.NoopWhenAlreadyComplete
[ OK ] InstallIntegrityStash.NoopWhenAlreadyComplete (0 ms)
[----------] 5 tests from InstallIntegrityStash (1 ms total)
[----------] Global test environment tear-down
[==========] 5 tests from 1 test suite ran. (1 ms total)
[ PASSED ] 5 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 8 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 8 tests from MainDetection
[ RUN ] MainDetection.RealMainIsDetected
[ OK ] MainDetection.RealMainIsDetected (0 ms)
[ RUN ] MainDetection.RealMainWithArgsIsDetected
[ OK ] MainDetection.RealMainWithArgsIsDetected (0 ms)
[ RUN ] MainDetection.AutoMainIsDetected
[ OK ] MainDetection.AutoMainIsDetected (0 ms)
[ RUN ] MainDetection.MainInsideStringLiteralIsIgnored
[ OK ] MainDetection.MainInsideStringLiteralIsIgnored (0 ms)
[ RUN ] MainDetection.MainInsideRawStringIsIgnored
[ OK ] MainDetection.MainInsideRawStringIsIgnored (0 ms)
[ RUN ] MainDetection.MainInsideCommentIsIgnored
[ OK ] MainDetection.MainInsideCommentIsIgnored (0 ms)
[ RUN ] MainDetection.NoMainGtestStyleIsFalse
[ OK ] MainDetection.NoMainGtestStyleIsFalse (0 ms)
[ RUN ] MainDetection.SimilarIdentifierIsNotMain
[ OK ] MainDetection.SimilarIdentifierIsNotMain (0 ms)
[----------] 8 tests from MainDetection (0 ms total)
[----------] Global test environment tear-down
[==========] 8 tests from 1 test suite ran. (0 ms total)
[ PASSED ] 8 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 11 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 11 tests from Mangle
[ RUN ] Mangle.NameFormat
[ OK ] Mangle.NameFormat (0 ms)
[ RUN ] Mangle.RewriteEmpty
[ OK ] Mangle.RewriteEmpty (0 ms)
[ RUN ] Mangle.RewriteModuleDecl
[ OK ] Mangle.RewriteModuleDecl (0 ms)
[ RUN ] Mangle.RewritePartitionDecl
[ OK ] Mangle.RewritePartitionDecl (0 ms)
[ RUN ] Mangle.RewriteImports
[ OK ] Mangle.RewriteImports (0 ms)
[ RUN ] Mangle.KeepBarePartitionImport
[ OK ] Mangle.KeepBarePartitionImport (0 ms)
[ RUN ] Mangle.KeepNonMatching
[ OK ] Mangle.KeepNonMatching (0 ms)
[ RUN ] Mangle.MultipleLines
[ OK ] Mangle.MultipleLines (0 ms)
[ RUN ] Mangle.LeadingWhitespace
[ OK ] Mangle.LeadingWhitespace (0 ms)
[ RUN ] Mangle.NoTrailingNewline
[ OK ] Mangle.NoTrailingNewline (0 ms)
[ RUN ] Mangle.DottedNames
[ OK ] Mangle.DottedNames (0 ms)
[----------] 11 tests from Mangle (0 ms total)
[----------] Global test environment tear-down
[==========] 11 tests from 1 test suite ran. (0 ms total)
[ PASSED ] 11 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 60 tests from 5 test suites.
[----------] Global test environment set-up.
[----------] 34 tests from Manifest
[ RUN ] Manifest.MinimalValid
[ OK ] Manifest.MinimalValid (0 ms)
[ RUN ] Manifest.SharedTargetSoname
[ OK ] Manifest.SharedTargetSoname (0 ms)
[ RUN ] Manifest.RejectsSonameOnNonSharedTarget
[ OK ] Manifest.RejectsSonameOnNonSharedTarget (0 ms)
[ RUN ] Manifest.PackageStandardCpp26AcceptedAndMirrored
[ OK ] Manifest.PackageStandardCpp26AcceptedAndMirrored (0 ms)
[ RUN ] Manifest.LegacyLanguageCpp2cNormalizesToCpp26
[ OK ] Manifest.LegacyLanguageCpp2cNormalizesToCpp26 (0 ms)
[ RUN ] Manifest.RejectsStdFlagInCxxflags
[ OK ] Manifest.RejectsStdFlagInCxxflags (0 ms)
[ RUN ] Manifest.RejectMissingVersion
[ OK ] Manifest.RejectMissingVersion (0 ms)
[ RUN ] Manifest.RejectImportStdWithoutCpp23
[ OK ] Manifest.RejectImportStdWithoutCpp23 (0 ms)
[ RUN ] Manifest.RejectModulesFalse
[ OK ] Manifest.RejectModulesFalse (0 ms)
[ RUN ] Manifest.ParsesDependencies
[ OK ] Manifest.ParsesDependencies (0 ms)
[ RUN ] Manifest.ParsesDependencyVisibility
[ OK ] Manifest.ParsesDependencyVisibility (0 ms)
[ RUN ] Manifest.RejectsInvalidDependencyVisibility
[ OK ] Manifest.RejectsInvalidDependencyVisibility (0 ms)
[ RUN ] Manifest.DefaultTemplateRoundTrip
[ OK ] Manifest.DefaultTemplateRoundTrip (0 ms)
[ RUN ] Manifest.BuildCflagsCxxflagsAndCStandard
[ OK ] Manifest.BuildCflagsCxxflagsAndCStandard (0 ms)
[ RUN ] Manifest.BuildMacosDeploymentTarget
[ OK ] Manifest.BuildMacosDeploymentTarget (0 ms)
[ RUN ] Manifest.BuildMacosDeploymentTargetDefaultsEmpty
[ OK ] Manifest.BuildMacosDeploymentTargetDefaultsEmpty (0 ms)
[ RUN ] Manifest.RuntimeConfig
[ OK ] Manifest.RuntimeConfig (0 ms)
[ RUN ] Manifest.DependenciesFlatDefaultNamespace
[ OK ] Manifest.DependenciesFlatDefaultNamespace (0 ms)
[ RUN ] Manifest.DependenciesNamespacedSubtable
[ OK ] Manifest.DependenciesNamespacedSubtable (0 ms)
[ RUN ] Manifest.DependenciesLegacyDottedKeyStillParsed
[ OK ] Manifest.DependenciesLegacyDottedKeyStillParsed (0 ms)
[ RUN ] Manifest.DependenciesDottedSelectorPreservesUserKeyAndCandidates
[ OK ] Manifest.DependenciesDottedSelectorPreservesUserKeyAndCandidates (0 ms)
[ RUN ] Manifest.DependenciesNamespacedSubtableNestedDottedKeyIsCanonical
[ OK ] Manifest.DependenciesNamespacedSubtableNestedDottedKeyIsCanonical (0 ms)
[ RUN ] Manifest.DependenciesInlineSpecCoexistsWithSubtable
[ OK ] Manifest.DependenciesInlineSpecCoexistsWithSubtable (0 ms)
[ RUN ] Manifest.WorkspaceSectionParsed
[ OK ] Manifest.WorkspaceSectionParsed (0 ms)
[ RUN ] Manifest.WorkspaceDependenciesUseDottedSelectorRules
[ OK ] Manifest.WorkspaceDependenciesUseDottedSelectorRules (0 ms)
[ RUN ] Manifest.WorkspaceTrueInDependency
[ OK ] Manifest.WorkspaceTrueInDependency (0 ms)
[ RUN ] Manifest.NoWorkspaceSectionMeansNotPresent
[ OK ] Manifest.NoWorkspaceSectionMeansNotPresent (0 ms)
[ RUN ] Manifest.LibRootInferredFromPackageName
[ OK ] Manifest.LibRootInferredFromPackageName (0 ms)
[ RUN ] Manifest.LibRootBareNameNoNamespace
[ OK ] Manifest.LibRootBareNameNoNamespace (0 ms)
[ RUN ] Manifest.LibRootExplicitOverride
[ OK ] Manifest.LibRootExplicitOverride (0 ms)
[ RUN ] Manifest.HasLibTargetFalseForBareBinaryManifest
[ OK ] Manifest.HasLibTargetFalseForBareBinaryManifest (0 ms)
[ RUN ] Manifest.ParsesPerTargetFlagsAndRequiredFeatures
[ OK ] Manifest.ParsesPerTargetFlagsAndRequiredFeatures (0 ms)
[ RUN ] Manifest.WarnsOnUnsupportedTargetKey
[ OK ] Manifest.WarnsOnUnsupportedTargetKey (0 ms)
[ RUN ] Manifest.RejectsStdFlagInTargetCxxflags
[ OK ] Manifest.RejectsStdFlagInTargetCxxflags (0 ms)
[----------] 34 tests from Manifest (0 ms total)
[----------] 3 tests from ListXpkgVersions
[ RUN ] ListXpkgVersions.MultipleEntriesAcrossPlatforms
[ OK ] ListXpkgVersions.MultipleEntriesAcrossPlatforms (0 ms)
[ RUN ] ListXpkgVersions.MissingXpmReturnsEmpty
[ OK ] ListXpkgVersions.MissingXpmReturnsEmpty (0 ms)
[ RUN ] ListXpkgVersions.IgnoresCommentedEntries
[ OK ] ListXpkgVersions.IgnoresCommentedEntries (0 ms)
[----------] 3 tests from ListXpkgVersions (0 ms total)
[----------] 7 tests from SynthesizeFromXpkgLua
[ RUN ] SynthesizeFromXpkgLua.CflagsCxxflagsLdflagsAndCStandard
[ OK ] SynthesizeFromXpkgLua.CflagsCxxflagsLdflagsAndCStandard (0 ms)
[ RUN ] SynthesizeFromXpkgLua.SharedTargetSoname
[ OK ] SynthesizeFromXpkgLua.SharedTargetSoname (0 ms)
[ RUN ] SynthesizeFromXpkgLua.RuntimeConfig
[ OK ] SynthesizeFromXpkgLua.RuntimeConfig (0 ms)
[ RUN ] SynthesizeFromXpkgLua.AppliesCurrentPlatformMcppOverlay
[ OK ] SynthesizeFromXpkgLua.AppliesCurrentPlatformMcppOverlay (0 ms)
[ RUN ] SynthesizeFromXpkgLua.GeneratedFiles
[ OK ] SynthesizeFromXpkgLua.GeneratedFiles (0 ms)
[ RUN ] SynthesizeFromXpkgLua.DepsKeySplitNamespace
[ OK ] SynthesizeFromXpkgLua.DepsKeySplitNamespace (0 ms)
[ RUN ] SynthesizeFromXpkgLua.DepsDottedSelectorsUseManifestRules
[ OK ] SynthesizeFromXpkgLua.DepsDottedSelectorsUseManifestRules (0 ms)
[----------] 7 tests from SynthesizeFromXpkgLua (0 ms total)
[----------] 7 tests from XpkgIdentity
[ RUN ] XpkgIdentity.CompatDescriptorMatchesCompatRequest
[ OK ] XpkgIdentity.CompatDescriptorMatchesCompatRequest (0 ms)
[ RUN ] XpkgIdentity.UpstreamBareZlibDoesNotMatchCompatRequest
[ OK ] XpkgIdentity.UpstreamBareZlibDoesNotMatchCompatRequest (0 ms)
[ RUN ] XpkgIdentity.DescriptorDeclaringNamespaceMatchesOnlyThatNamespace
[ OK ] XpkgIdentity.DescriptorDeclaringNamespaceMatchesOnlyThatNamespace (0 ms)
[ RUN ] XpkgIdentity.NoDeclaredNameIsAcceptedLeniently
[ OK ] XpkgIdentity.NoDeclaredNameIsAcceptedLeniently (0 ms)
[ RUN ] XpkgIdentity.DefaultNamespaceBareNameGatedByFlag
[ OK ] XpkgIdentity.DefaultNamespaceBareNameGatedByFlag (0 ms)
[ RUN ] XpkgIdentity.EmptyNamespaceDiscoveryMatchesNamespacedDescriptor
[ OK ] XpkgIdentity.EmptyNamespaceDiscoveryMatchesNamespacedDescriptor (0 ms)
[ RUN ] XpkgIdentity.DefaultNamespaceRequestMatchesCompatAlias
[ OK ] XpkgIdentity.DefaultNamespaceRequestMatchesCompatAlias (0 ms)
[----------] 7 tests from XpkgIdentity (0 ms total)
[----------] 9 tests from CanonicalIdentity
[ RUN ] CanonicalIdentity.PrefixEmbeddedNameCollapses
[ OK ] CanonicalIdentity.PrefixEmbeddedNameCollapses (0 ms)
[ RUN ] CanonicalIdentity.BareNameCombinesWithNamespace
[ OK ] CanonicalIdentity.BareNameCombinesWithNamespace (0 ms)
[ RUN ] CanonicalIdentity.AlreadyQualifiedNameIsIdempotent
[ OK ] CanonicalIdentity.AlreadyQualifiedNameIsIdempotent (0 ms)
[ RUN ] CanonicalIdentity.NoNamespaceInheritsOwningIndex
[ OK ] CanonicalIdentity.NoNamespaceInheritsOwningIndex (0 ms)
[ RUN ] CanonicalIdentity.DeclaredNamespaceWinsOverIndexDefault
[ OK ] CanonicalIdentity.DeclaredNamespaceWinsOverIndexDefault (0 ms)
[ RUN ] CanonicalIdentity.DottedNameWithNoNamespaceSplitsOnLastDot
[ OK ] CanonicalIdentity.DottedNameWithNoNamespaceSplitsOnLastDot (0 ms)
[ RUN ] CanonicalIdentity.HierarchicalNamespaceIsSupported
[ OK ] CanonicalIdentity.HierarchicalNamespaceIsSupported (0 ms)
[ RUN ] CanonicalIdentity.BareNameNoNamespaceNoIndexStaysRootless
[ OK ] CanonicalIdentity.BareNameNoNamespaceNoIndexStaysRootless (0 ms)
[ RUN ] CanonicalIdentity.FromLuaReadsDeclaredFields
[ OK ] CanonicalIdentity.FromLuaReadsDeclaredFields (0 ms)
[----------] 9 tests from CanonicalIdentity (0 ms total)
[----------] Global test environment tear-down
[==========] 60 tests from 5 test suites ran. (0 ms total)
[ PASSED ] 60 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 21 tests from 5 test suites.
[----------] Global test environment set-up.
[----------] 11 tests from Scanner
[ RUN ] Scanner.ProvidesAndRequires
[ OK ] Scanner.ProvidesAndRequires (0 ms)
[ RUN ] Scanner.IgnoresImportsInsideRawStringLiteral
[ OK ] Scanner.IgnoresImportsInsideRawStringLiteral (0 ms)
[ RUN ] Scanner.IgnoresImportInsideSingleLineRawString
[ OK ] Scanner.IgnoresImportInsideSingleLineRawString (0 ms)
[ RUN ] Scanner.RecordsPackageLocalIncludeDirs
[ OK ] Scanner.RecordsPackageLocalIncludeDirs (0 ms)
[ RUN ] Scanner.UsesResolvedPackagePrivateBuildIncludeDirs
[ OK ] Scanner.UsesResolvedPackagePrivateBuildIncludeDirs (0 ms)
[ RUN ] Scanner.PartitionImportFromPrimaryInterface
[ OK ] Scanner.PartitionImportFromPrimaryInterface (0 ms)
[ RUN ] Scanner.PartitionImportFromAnotherPartition
[ OK ] Scanner.PartitionImportFromAnotherPartition (0 ms)
[ RUN ] Scanner.PartitionImportWithDottedModuleName
[ OK ] Scanner.PartitionImportWithDottedModuleName (0 ms)
[ RUN ] Scanner.RejectsConditionalImport
[ OK ] Scanner.RejectsConditionalImport (0 ms)
[ RUN ] Scanner.RejectsHeaderUnit
[ OK ] Scanner.RejectsHeaderUnit (0 ms)
[ RUN ] Scanner.ObjectiveCSourceIsCLike
[ OK ] Scanner.ObjectiveCSourceIsCLike (0 ms)
[----------] 11 tests from Scanner (2 ms total)
[----------] 7 tests from Validate
[ RUN ] Validate.ModuleNameNotRequiredToMatchPackageName
[ OK ] Validate.ModuleNameNotRequiredToMatchPackageName (0 ms)
[ RUN ] Validate.ForbiddenTopName
[ OK ] Validate.ForbiddenTopName (0 ms)
[ RUN ] Validate.LibRootHappyPath
[ OK ] Validate.LibRootHappyPath (0 ms)
[ RUN ] Validate.LibRootExportsPartitionIsError
[ OK ] Validate.LibRootExportsPartitionIsError (0 ms)
[ RUN ] Validate.LibRootDifferentModuleNameIsAllowed
[ OK ] Validate.LibRootDifferentModuleNameIsAllowed (0 ms)
[ RUN ] Validate.LibRootNotEnforcedForBinaryProject
[ OK ] Validate.LibRootNotEnforcedForBinaryProject (0 ms)
[ RUN ] Validate.LibRootMissingFileWithExplicitPathIsError
[ OK ] Validate.LibRootMissingFileWithExplicitPathIsError (0 ms)
[----------] 7 tests from Validate (0 ms total)
[----------] 1 test from TopoSort
[ RUN ] TopoSort.DetectsCycle
[ OK ] TopoSort.DetectsCycle (0 ms)
[----------] 1 test from TopoSort (0 ms total)
[----------] 1 test from IsPublicPackage
[ RUN ] IsPublicPackage.DotMarksPublic
[ OK ] IsPublicPackage.DotMarksPublic (0 ms)
[----------] 1 test from IsPublicPackage (0 ms total)
[----------] 1 test from IsForbiddenTopModule
[ RUN ] IsForbiddenTopModule.KnownNames
[ OK ] IsForbiddenTopModule.KnownNames (0 ms)
[----------] 1 test from IsForbiddenTopModule (0 ms total)
[----------] Global test environment tear-down
[==========] 21 tests from 5 test suites ran. (2 ms total)
[ PASSED ] 21 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 5 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 5 tests from NinjaBackend
[ RUN ] NinjaBackend.ObjectiveCSourceUsesCObjectRuleAndCFlags
[ OK ] NinjaBackend.ObjectiveCSourceUsesCObjectRuleAndCFlags (0 ms)
[ RUN ] NinjaBackend.UsesPackageCppStandardForCxxFlags
[ OK ] NinjaBackend.UsesPackageCppStandardForCxxFlags (0 ms)
[ RUN ] NinjaBackend.CompileCommandsUsesSameCppStandard
[ OK ] NinjaBackend.CompileCommandsUsesSameCppStandard (0 ms)
[ RUN ] NinjaBackend.CxxFlagsIncludeBuildIncludeDirs
[ OK ] NinjaBackend.CxxFlagsIncludeBuildIncludeDirs (0 ms)
[ RUN ] NinjaBackend.RootPackageCxxflagsAreEmittedOncePerUnit
[ OK ] NinjaBackend.RootPackageCxxflagsAreEmittedOncePerUnit (0 ms)
[----------] 5 tests from NinjaBackend (0 ms total)
[----------] Global test environment tear-down
[==========] 5 tests from 1 test suite ran. (0 ms total)
[ PASSED ] 5 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 5 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 5 tests from P1689Parse
[ RUN ] P1689Parse.SimpleProvider
[ OK ] P1689Parse.SimpleProvider (0 ms)
[ RUN ] P1689Parse.PureConsumer
[ OK ] P1689Parse.PureConsumer (0 ms)
[ RUN ] P1689Parse.EmptyRequires
[ OK ] P1689Parse.EmptyRequires (0 ms)
[ RUN ] P1689Parse.RejectsNonObject
[ OK ] P1689Parse.RejectsNonObject (0 ms)
[ RUN ] P1689Parse.RejectsMissingRules
[ OK ] P1689Parse.RejectsMissingRules (0 ms)
[----------] 5 tests from P1689Parse (0 ms total)
[----------] Global test environment tear-down
[==========] 5 tests from 1 test suite ran. (0 ms total)
[ PASSED ] 5 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 4 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 4 tests from PackModes
[ RUN ] PackModes.CanonicalNamesParse
[ OK ] PackModes.CanonicalNamesParse (0 ms)
[ RUN ] PackModes.OldNamesStayAsAliases
[ OK ] PackModes.OldNamesStayAsAliases (0 ms)
[ RUN ] PackModes.UnknownIsNullopt
[ OK ] PackModes.UnknownIsNullopt (0 ms)
[ RUN ] PackModes.CliNamesAreCanonical
[ OK ] PackModes.CliNamesAreCanonical (0 ms)
[----------] 4 tests from PackModes (0 ms total)
[----------] Global test environment tear-down
[==========] 4 tests from 1 test suite ran. (0 ms total)
[ PASSED ] 4 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 14 tests from 2 test suites.
[----------] Global test environment set-up.
[----------] 10 tests from PmCompat
[ RUN ] PmCompat.InstallDirCandidatesIncludeNestedNamespaceFallback
[ OK ] PmCompat.InstallDirCandidatesIncludeNestedNamespaceFallback (0 ms)
[ RUN ] PmCompat.NormalizeNestedNamespacePreservesQualifiedName
[ OK ] PmCompat.NormalizeNestedNamespacePreservesQualifiedName (0 ms)
[ RUN ] PmCompat.SplitLegacyDependencyKeyMarksDottedKeyAsCompat
[ OK ] PmCompat.SplitLegacyDependencyKeyMarksDottedKeyAsCompat (0 ms)
[ RUN ] PmCompat.NormalizeNestedNamespaceSkipsCanonicalNamespacedDeps
[ OK ] PmCompat.NormalizeNestedNamespaceSkipsCanonicalNamespacedDeps (0 ms)
[ RUN ] PmCompat.DescriptorCoordinatesLegacyEmbeddedNamespace
[ OK ] PmCompat.DescriptorCoordinatesLegacyEmbeddedNamespace (0 ms)
[ RUN ] PmCompat.DescriptorCoordinatesCanonicalNamespaceField
[ OK ] PmCompat.DescriptorCoordinatesCanonicalNamespaceField (0 ms)
[ RUN ] PmCompat.DescriptorCoordinatesRootPackageStaysInRoot
[ OK ] PmCompat.DescriptorCoordinatesRootPackageStaysInRoot (0 ms)
[ RUN ] PmCompat.DescriptorCoordinatesLegacyDottedNameWithoutNamespace
[ OK ] PmCompat.DescriptorCoordinatesLegacyDottedNameWithoutNamespace (0 ms)
[ RUN ] PmCompat.DescriptorCoordinatesFallsBackToSpecWhenNameMissing
[ OK ] PmCompat.DescriptorCoordinatesFallsBackToSpecWhenNameMissing (0 ms)
[ RUN ] PmCompat.DescriptorCoordinatesCompatNamespace
[ OK ] PmCompat.DescriptorCoordinatesCompatNamespace (0 ms)
[----------] 10 tests from PmCompat (0 ms total)
[----------] 4 tests from DependencySelector
[ RUN ] DependencySelector.DottedSelectorBuildsOmittedMcpplibsPriorityCandidates
[ OK ] DependencySelector.DottedSelectorBuildsOmittedMcpplibsPriorityCandidates (0 ms)
[ RUN ] DependencySelector.BareSelectorBuildsOmittedMcpplibsThenPeerRootCandidates
[ OK ] DependencySelector.BareSelectorBuildsOmittedMcpplibsThenPeerRootCandidates (0 ms)
[ RUN ] DependencySelector.ExplicitMcpplibsPrefixDoesNotAddPeerFallback
[ OK ] DependencySelector.ExplicitMcpplibsPrefixDoesNotAddPeerFallback (0 ms)
[ RUN ] DependencySelector.ExplicitRootSelectorHasOnlyThatRoot
[ OK ] DependencySelector.ExplicitRootSelectorHasOnlyThatRoot (0 ms)
[----------] 4 tests from DependencySelector (0 ms total)
[----------] Global test environment tear-down
[==========] 14 tests from 2 test suites ran. (0 ms total)
[ PASSED ] 14 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 4 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 4 tests from PmPackageFetcher
[ RUN ] PmPackageFetcher.ResolvesCompatZlibNotForeignBareZlib
[ OK ] PmPackageFetcher.ResolvesCompatZlibNotForeignBareZlib (1 ms)
[ RUN ] PmPackageFetcher.ForeignBareZlibAloneDoesNotSatisfyCompatRequest
[ OK ] PmPackageFetcher.ForeignBareZlibAloneDoesNotSatisfyCompatRequest (0 ms)
[ RUN ] PmPackageFetcher.DefaultNamespaceRequestResolvesCompatAliasDescriptor
[ OK ] PmPackageFetcher.DefaultNamespaceRequestResolvesCompatAliasDescriptor (0 ms)
[ RUN ] PmPackageFetcher.LocalPathIndexAttributesOwnNamespaceToNoNsDescriptor
[ OK ] PmPackageFetcher.LocalPathIndexAttributesOwnNamespaceToNoNsDescriptor (0 ms)
[----------] 4 tests from PmPackageFetcher (2 ms total)
[----------] Global test environment tear-down
[==========] 4 tests from 1 test suite ran. (2 ms total)
[ PASSED ] 4 tests.
Compiling test_xlings (test)
Compiling test_xpkg_emit (test)
Finished test [optimized] in 0.01s
Running bin/test_bmi_cache
test_bmi_cache ... ok
Running bin/test_compile_commands
test_compile_commands ... ok
Running bin/test_config
test_config ... ok
Running bin/test_doctor_runpath
test_doctor_runpath ... ok
Running bin/test_dyndep
test_dyndep ... ok
Running bin/test_fingerprint
test_fingerprint ... ok
Running bin/test_install_integrity
test_install_integrity ... ok
Running bin/test_main_detection
test_main_detection ... ok
Running bin/test_mangle
test_mangle ... ok
Running bin/test_manifest
test_manifest ... ok
Running bin/test_modgraph
test_modgraph ... ok
Running bin/test_ninja_backend
test_ninja_backend ... ok
Running bin/test_p1689
test_p1689 ... ok
Running bin/test_pack_modes
test_pack_modes ... ok
Running bin/test_pm_compat
test_pm_compat ... ok
Running bin/test_pm_package_fetcher
test_pm_package_fetcher ... ok
Running bin/test_process_run_exec
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 6 tests from 2 test suites.
[----------] Global test environment set-up.
[----------] 4 tests from RunExec
[ RUN ] RunExec.DoesNotMutateParentEnvironment
[ OK ] RunExec.DoesNotMutateParentEnvironment (1 ms)
[ RUN ] RunExec.ChildSeesInjectedEnv
[ OK ] RunExec.ChildSeesInjectedEnv (1 ms)
[ RUN ] RunExec.PropagatesChildExitCode
[ OK ] RunExec.PropagatesChildExitCode (1 ms)
[ RUN ] RunExec.ReturnsErrorWhenProgramMissing
[ OK ] RunExec.ReturnsErrorWhenProgramMissing (0 ms)
[----------] 4 tests from RunExec (3 ms total)
[----------] 2 tests from CaptureExec
[ RUN ] CaptureExec.CapturesStdoutWithoutShell
[ OK ] CaptureExec.CapturesStdoutWithoutShell (1 ms)
[ RUN ] CaptureExec.CapturesStderrCombined
[ OK ] CaptureExec.CapturesStderrCombined (1 ms)
[----------] 2 tests from CaptureExec (2 ms total)
[----------] Global test environment tear-down
[==========] 6 tests from 2 test suites ran. (5 ms total)
[ PASSED ] 6 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 3 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 3 tests from ProcessSealStdin
[ RUN ] ProcessSealStdin.RunSilentDoesNotHangWhenParentStdinIsOpenPipe
[ OK ] ProcessSealStdin.RunSilentDoesNotHangWhenParentStdinIsOpenPipe (3 ms)
[ RUN ] ProcessSealStdin.CaptureDoesNotHangWhenParentStdinIsOpenPipe
[ OK ] ProcessSealStdin.CaptureDoesNotHangWhenParentStdinIsOpenPipe (3 ms)
[ RUN ] ProcessSealStdin.RunStreamingDoesNotHangWhenParentStdinIsOpenPipe
[ OK ] ProcessSealStdin.RunStreamingDoesNotHangWhenParentStdinIsOpenPipe (3 ms)
[----------] 3 tests from ProcessSealStdin (10 ms total)
[----------] Global test environment tear-down
[==========] 3 tests from 1 test suite ran. (10 ms total)
[ PASSED ] 3 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 9 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 9 tests from Toml
[ RUN ] Toml.EmptyDocumentParses
[ OK ] Toml.EmptyDocumentParses (0 ms)
[ RUN ] Toml.SimpleKeyValue
[ OK ] Toml.SimpleKeyValue (0 ms)
[ RUN ] Toml.NestedTables
[ OK ] Toml.NestedTables (0 ms)
[ RUN ] Toml.ArrayOfStrings
[ OK ] Toml.ArrayOfStrings (0 ms)
[ RUN ] Toml.ArrayAllowsTrailingComma
[ OK ] Toml.ArrayAllowsTrailingComma (0 ms)
[ RUN ] Toml.EscapedString
[ OK ] Toml.EscapedString (0 ms)
[ RUN ] Toml.RejectUnterminatedString
[ OK ] Toml.RejectUnterminatedString (0 ms)
[ RUN ] Toml.CommentsIgnored
[ OK ] Toml.CommentsIgnored (0 ms)
[ RUN ] Toml.EscapeStringHelper
[ OK ] Toml.EscapeStringHelper (0 ms)
[----------] 9 tests from Toml (0 ms total)
[----------] Global test environment tear-down
[==========] 9 tests from 1 test suite ran. (0 ms total)
[ PASSED ] 9 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 8 tests from 2 test suites.
[----------] Global test environment set-up.
[----------] 3 tests from ToolchainDetect
[ RUN ] ToolchainDetect.ClangVersionOutputIsNotMisclassifiedByGccPaths
[ OK ] ToolchainDetect.ClangVersionOutputIsNotMisclassifiedByGccPaths (29 ms)
[ RUN ] ToolchainDetect.IgnoresTargetRuntimeLibraryPathDuringProbe
[ OK ] ToolchainDetect.IgnoresTargetRuntimeLibraryPathDuringProbe (28 ms)
[ RUN ] ToolchainDetect.PopulatesDriverIdentFromVersionOutput
[ OK ] ToolchainDetect.PopulatesDriverIdentFromVersionOutput (30 ms)
[----------] 3 tests from ToolchainDetect (88 ms total)
[----------] 5 tests from NormalizeDriverOutput
[ RUN ] NormalizeDriverOutput.TrimsWhitespaceAndCollapsesBlankLines
[ OK ] NormalizeDriverOutput.TrimsWhitespaceAndCollapsesBlankLines (0 ms)
[ RUN ] NormalizeDriverOutput.IsStableAcrossInstallPrefixes
[ OK ] NormalizeDriverOutput.IsStableAcrossInstallPrefixes (0 ms)
[ RUN ] NormalizeDriverOutput.ReplacesLocalInstallPaths
[ OK ] NormalizeDriverOutput.ReplacesLocalInstallPaths (0 ms)
[ RUN ] NormalizeDriverOutput.DistinguishesDifferentVersions
[ OK ] NormalizeDriverOutput.DistinguishesDifferentVersions (0 ms)
[ RUN ] NormalizeDriverOutput.EmptyInputProducesEmpty
[ OK ] NormalizeDriverOutput.EmptyInputProducesEmpty (0 ms)
[----------] 5 tests from NormalizeDriverOutput (0 ms total)
[----------] Global test environment tear-down
[==========] 8 tests from 2 test suites ran. (89 ms total)
[ PASSED ] 8 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 4 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 4 tests from ToolchainRegistry
[ RUN ] ToolchainRegistry.MapsGccSpecToGccPackage
[ OK ] ToolchainRegistry.MapsGccSpecToGccPackage (0 ms)
[ RUN ] ToolchainRegistry.MapsGccMuslSuffixToMuslGccPackage
[ OK ] ToolchainRegistry.MapsGccMuslSuffixToMuslGccPackage (0 ms)
[ RUN ] ToolchainRegistry.MapsLlvmAndClangAliasesToLlvmPackage
[ OK ] ToolchainRegistry.MapsLlvmAndClangAliasesToLlvmPackage (0 ms)
[ RUN ] ToolchainRegistry.ResolvesPartialMuslVersionForDisplayAndPackage
[ OK ] ToolchainRegistry.ResolvesPartialMuslVersionForDisplayAndPackage (0 ms)
[----------] 4 tests from ToolchainRegistry (0 ms total)
[----------] Global test environment tear-down
[==========] 4 tests from 1 test suite ran. (0 ms total)
[ PASSED ] 4 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 3 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 3 tests from ToolchainStdmod
[ RUN ] ToolchainStdmod.GccStdModuleCommandUsesRequestedStandard
[ OK ] ToolchainStdmod.GccStdModuleCommandUsesRequestedStandard (0 ms)
[ RUN ] ToolchainStdmod.ClangStdModuleCommandsUseRequestedStandard
[ OK ] ToolchainStdmod.ClangStdModuleCommandsUseRequestedStandard (0 ms)
[ RUN ] ToolchainStdmod.ClangStdCompatCommandsUseRequestedStandard
[ OK ] ToolchainStdmod.ClangStdCompatCommandsUseRequestedStandard (0 ms)
[----------] 3 tests from ToolchainStdmod (0 ms total)
[----------] Global test environment tear-down
[==========] 3 tests from 1 test suite ran. (0 ms total)
[ PASSED ] 3 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 10 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 10 tests from VersionReq
[ RUN ] VersionReq.ParseVersion
[ OK ] VersionReq.ParseVersion (0 ms)
[ RUN ] VersionReq.ParseAny
[ OK ] VersionReq.ParseAny (0 ms)
[ RUN ] VersionReq.MatchExact
[ OK ] VersionReq.MatchExact (0 ms)
[ RUN ] VersionReq.MatchCaretBare
[ OK ] VersionReq.MatchCaretBare (0 ms)
[ RUN ] VersionReq.MatchCaretZeroMajor
[ OK ] VersionReq.MatchCaretZeroMajor (0 ms)
[ RUN ] VersionReq.MatchTilde
[ OK ] VersionReq.MatchTilde (0 ms)
[ RUN ] VersionReq.MatchRangeAnd
[ OK ] VersionReq.MatchRangeAnd (0 ms)
[ RUN ] VersionReq.ChooseBest
[ OK ] VersionReq.ChooseBest (0 ms)
[ RUN ] VersionReq.ChooseUnsatisfiable
[ OK ] VersionReq.ChooseUnsatisfiable (0 ms)
[ RUN ] VersionReq.RejectsGarbage
[ OK ] VersionReq.RejectsGarbage (0 ms)
[----------] 10 tests from VersionReq (0 ms total)
[----------] Global test environment tear-down
[==========] 10 tests from 1 test suite ran. (0 ms total)
[ PASSED ] 10 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 14 tests from 3 test suites.
[----------] Global test environment set-up.
[----------] 10 tests from XlingsIndexFreshness
[ RUN ] XlingsIndexFreshness.RequiresDefaultMcpplibsIndex
[ OK ] XlingsIndexFreshness.RequiresDefaultMcpplibsIndex (0 ms)
[ RUN ] XlingsIndexFreshness.AcceptsFreshDefaultMcpplibsIndex
[ OK ] XlingsIndexFreshness.AcceptsFreshDefaultMcpplibsIndex (0 ms)
[ RUN ] XlingsIndexFreshness.RequiresRefreshMarkerForDefaultMcpplibsIndex
[ OK ] XlingsIndexFreshness.RequiresRefreshMarkerForDefaultMcpplibsIndex (0 ms)
[ RUN ] XlingsIndexFreshness.RejectsStaleRefreshMarker
[ OK ] XlingsIndexFreshness.RejectsStaleRefreshMarker (0 ms)
[ RUN ] XlingsIndexFreshness.RequiresOfficialXimIndexEvenWhenDefaultIndexIsFresh
[ OK ] XlingsIndexFreshness.RequiresOfficialXimIndexEvenWhenDefaultIndexIsFresh (0 ms)
[ RUN ] XlingsIndexFreshness.AcceptsFreshOfficialXimIndex
[ OK ] XlingsIndexFreshness.AcceptsFreshOfficialXimIndex (0 ms)
[ RUN ] XlingsIndexFreshness.RequiresOfficialPackageFileEvenWhenOfficialIndexIsFresh
[ OK ] XlingsIndexFreshness.RequiresOfficialPackageFileEvenWhenOfficialIndexIsFresh (0 ms)
[ RUN ] XlingsIndexFreshness.AcceptsFreshOfficialPackageFile
[ OK ] XlingsIndexFreshness.AcceptsFreshOfficialPackageFile (0 ms)
[ RUN ] XlingsIndexFreshness.RejectsOfficialPackageCacheWithForeignPath
[ OK ] XlingsIndexFreshness.RejectsOfficialPackageCacheWithForeignPath (0 ms)
[ RUN ] XlingsIndexFreshness.AcceptsOfficialPackageCacheWithCurrentPath
[ OK ] XlingsIndexFreshness.AcceptsOfficialPackageCacheWithCurrentPath (0 ms)
[----------] 10 tests from XlingsIndexFreshness (4 ms total)
[----------] 3 tests from XlingsSiblingPackage
[ RUN ] XlingsSiblingPackage.MetadataOnlyHuskIsNotContent
[ OK ] XlingsSiblingPackage.MetadataOnlyHuskIsNotContent (0 ms)
[ RUN ] XlingsSiblingPackage.SkipsHuskAndFindsPayloadUnderOtherPrefix
[ OK ] XlingsSiblingPackage.SkipsHuskAndFindsPayloadUnderOtherPrefix (0 ms)
[ RUN ] XlingsSiblingPackage.RequiredRelPathRejectsContentfulButWrongCandidate
[ OK ] XlingsSiblingPackage.RequiredRelPathRejectsContentfulButWrongCandidate (0 ms)
[----------] 3 tests from XlingsSiblingPackage (2 ms total)
[----------] 1 test from XlingsHomeTool
[ RUN ] XlingsHomeTool.FindsPayloadUnderNonXimPrefix
[ OK ] XlingsHomeTool.FindsPayloadUnderNonXimPrefix (0 ms)
[----------] 1 test from XlingsHomeTool (0 ms total)
[----------] Global test environment tear-down
[==========] 14 tests from 3 test suites ran. (8 ms total)
[ PASSED ] 14 tests.
Running main() from /home/speak/.mcpp/registry/data/xpkgs/compat-x-compat.gtest/1.15.2/googletest-1.15.2/googletest/src/gtest_main.cc
[==========] Running 7 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 7 tests from XpkgEmit
[ RUN ] XpkgEmit.ContainsRequiredFields
[ OK ] XpkgEmit.ContainsRequiredFields (0 ms)
[ RUN ] XpkgEmit.RejectsLuaInjection
[ OK ] XpkgEmit.RejectsLuaInjection (0 ms)
[ RUN ] XpkgEmit.EscapesControlCharacters
[ OK ] XpkgEmit.EscapesControlCharacters (0 ms)
[ RUN ] XpkgEmit.ReleaseTarballUrl
[ OK ] XpkgEmit.ReleaseTarballUrl (0 ms)
[ RUN ] XpkgEmit.Sha256OfFile
[ OK ] XpkgEmit.Sha256OfFile (11 ms)
[ RUN ] XpkgEmit.Sha256OfFileIgnoresTargetRuntimeLibraryPath
[ OK ] XpkgEmit.Sha256OfFileIgnoresTargetRuntimeLibraryPath (6 ms)
[ RUN ] XpkgEmit.LongBracketSequenceInValueIsHarmless
[ OK ] XpkgEmit.LongBracketSequenceInValueIsHarmless (0 ms)
[----------] 7 tests from XpkgEmit (17 ms total)
[----------] Global test environment tear-down
[==========] 7 tests from 1 test suite ran. (17 ms total)
[ PASSED ] 7 tests.
test_process_run_exec ... ok
Running bin/test_process_seal_stdin
test_process_seal_stdin ... ok
Running bin/test_toml
test_toml ... ok
Running bin/test_toolchain_detect
test_toolchain_detect ... ok
Running bin/test_toolchain_registry
test_toolchain_registry ... ok
Running bin/test_toolchain_stdmod
test_toolchain_stdmod ... ok
Running bin/test_version_req
test_version_req ... ok
Running bin/test_xlings
test_xlings ... ok
Running bin/test_xpkg_emit
test_xpkg_emit ... ok
test result ok. 25 passed; 0 failed; finished in 0.18s (25 unit) green; e2e 78 (3 combos)
green; AND Finished release [optimized] in 0.01s of openxlings/xlings (regular libarchive dep) links
cleanly — the regression is gone.
e2e 78's ninja assertions grepped 'bin/<t> :' but the Windows link target is 'bin/<t>.exe :', so fw_link came back empty and the assertion false-failed — the functionality (mcpp test 3 combos, xlings build, 25 unit tests) was already green on Windows. Match the target with an optional .exe suffix and guard that the link line was actually found.
…tic) Windows build.ninja uses backslash paths (bin\t_..exe); the previous grep used 'bin/...' so it missed them and false-failed. Match 't_<name>(.exe)? : cxx_link' — no directory prefix, so / vs \ and .exe are both irrelevant. (Windows functionality was already correct: own-main test links no gtest_main, build OK.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
含
[dev-dependencies] gtest的项目,测试自带int main()(脚手架默认模板即如此)时mcpp test链接失败:根因:mcpp 把依赖的全部对象内联进每个测试二进制,gtest_main.o 的 main 与测试 main 撞符号。
方案(架构定论)
gtest 描述符(
mcpp-index/compat.gtest.lua)早已声明targets={gtest={kind="lib"}},mcpp 解析器也支持kind=lib——只是链接模型没兑现。本 PR 让 mcpp 兑现依赖的kind="lib":把这类依赖编译成静态归档lib<pkg>.a,链接在消费者对象之后。标准归档语义只在符号未定义时拉成员 →gtest_main.o的main只在测试不自带 main 时才被拉。通用、由既有描述符
kind驱动、无 gtest 特例;未来测试框架声明kind="lib"即自动适配。模块.cppm对象从不归档(承载全局初始化);纯模块依赖(mcpplibs.cmdline)逐字节不变。完整设计与决策(为何在 mcpp 核心而非改描述符 / 加特判):
.agents/docs/2026-06-25-dependency-archive-linking-design.md。交叉组合(全部正确,用户无感)
改动
plan.cppm:LinkUnit.archiveInputs;为kind=lib依赖合成StaticLibraryLinkUnit;消费者引用.a而非内联其非模块对象。ninja_backend.cppm:archiveInputs经$in排在对象之后。NinjaBackend.ArchiveInputsLinkedAfterObjects;e2e78_test_main_combinations.sh(四组合)。0.0.63 → 0.0.64。验证(本机)
3 passed; 0 failed;ninja 实出build libcompat_gtest.a : cxx_archive obj/gtest_main.o obj/gtest-all.o,测试链接行…objects… libcompat_gtest.a。🤖 Generated with Claude Code