{"record":{"id":"28d56f7448a1b1c8","repo":"nodejs/node","slug":"dodependentsettings-doesn-t-know-how-to-determine","errorCode":null,"errorMessage":"DoDependentSettings doesn't know how to determine dependencies for {key}","messagePattern":"DoDependentSettings doesn't know how to determine dependencies for (.+?)","errorType":"exception","errorClass":"GypError","httpStatus":null,"severity":"error","filePath":"tools/gyp/pylib/gyp/input.py","lineNumber":2058,"sourceCode":"\ndef DoDependentSettings(key, flat_list, targets, dependency_nodes):\n    # key should be one of all_dependent_settings, direct_dependent_settings,\n    # or link_settings.\n\n    for target in flat_list:\n        target_dict = targets[target]\n        build_file = gyp.common.BuildFile(target)\n\n        if key == \"all_dependent_settings\":\n            dependencies = dependency_nodes[target].DeepDependencies()\n        elif key == \"direct_dependent_settings\":\n            dependencies = dependency_nodes[target].DirectAndImportedDependencies(\n                targets\n            )\n        elif key == \"link_settings\":\n            dependencies = dependency_nodes[target].DependenciesForLinkSettings(targets)\n        else:\n            raise GypError(\n                \"DoDependentSettings doesn't know how to determine \"\n                \"dependencies for \" + key\n            )\n\n        for dependency in dependencies:\n            dependency_dict = targets[dependency]\n            if key not in dependency_dict:\n                continue\n            dependency_build_file = gyp.common.BuildFile(dependency)\n            MergeDicts(\n                target_dict, dependency_dict[key], build_file, dependency_build_file\n            )\n\n\ndef AdjustStaticLibraryDependencies(\n    flat_list, targets, dependency_nodes, sort_dependencies\n):\n    # Recompute target \"dependencies\" properties.  For each static library","sourceCodeStart":2040,"sourceCodeEnd":2076,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/tools/gyp/pylib/gyp/input.py#L2040-L2076","documentation":"DoDependentSettings dispatches on a key to choose the dependency-set computation: 'all_dependent_settings' -> DeepDependencies, 'direct_dependent_settings' -> DirectAndImportedDependencies, 'link_settings' -> DependenciesForLinkSettings. Any other key is a programming error in the caller (internal gyp API), not a user .gyp mistake, so it raises GypError.","triggerScenarios":"An internal caller invokes DoDependentSettings with a key string other than the three supported ones. This is an API-contract violation inside gyp's pipeline, typically from a forked/modified gyp, not from a normal .gyp file.","commonSituations":"Forking gyp and adding a new settings key without extending the dispatch; calling internal functions directly from a custom generator; version skew where a generator expects a key the installed gyp does not handle.","solutions":["Pass only one of: 'all_dependent_settings', 'direct_dependent_settings', 'link_settings'.","If extending gyp, add an elif branch for the new key before the else.","Ensure the generator and the gyp input module are from the same version/fork."],"exampleFix":"// before (internal call): DoDependentSettings('my_settings', ...)\n// after: extend dispatch or use 'all_dependent_settings'/'direct_dependent_settings'/'link_settings'","handlingStrategy":"try-catch","validationCode":"ALLOWED = {'all_dependent_settings','direct_dependent_settings','link_settings'}\nassert key in ALLOWED, 'unsupported DoDependentSettings key: %r' % key\n","typeGuard":"def is_supported_settings_key(k): return k in {'all_dependent_settings','direct_dependent_settings','link_settings'}","tryCatchPattern":"try:\n    DoDependentSettings(key, flat_list, targets, dependency_nodes)\nexcept gyp.input.GypError as e:\n    if 'doesn\\'t know how to determine dependencies' in str(e): raise RuntimeError('Internal gyp API misuse: %s' % key)","preventionTips":["Only call internal DoDependentSettings with the three supported keys.","When extending gyp, update the dispatch and tests together.","Pin generator and gyp versions to avoid key-set drift."],"tags":["gyp","internal-api","settings","build-config"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}