{"record":{"id":"8d8a584b04f4d726","repo":"nodejs/node","slug":"multiple-toolsets-not-supported-in-xcode-build-ta","errorCode":null,"errorMessage":"Multiple toolsets not supported in xcode build (target %s)","messagePattern":"Multiple toolsets not supported in xcode build \\(target (.+?)\\)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"tools/gyp/pylib/gyp/generator/xcode.py","lineNumber":705,"sourceCode":"\n        # Add gyp/gypi files to project\n        if not generator_flags.get(\"standalone\"):\n            main_group = pbxp.GetProperty(\"mainGroup\")\n            build_group = gyp.xcodeproj_file.PBXGroup({\"name\": \"Build\"})\n            main_group.AppendChild(build_group)\n            for included_file in build_file_dict[\"included_files\"]:\n                build_group.AddOrGetFileByPath(included_file, False)\n\n    xcode_targets = {}\n    xcode_target_to_target_dict = {}\n    for qualified_target in target_list:\n        [build_file, target_name, _toolset] = gyp.common.ParseQualifiedTarget(\n            qualified_target\n        )\n\n        spec = target_dicts[qualified_target]\n        if spec[\"toolset\"] != \"target\":\n            raise Exception(\n                \"Multiple toolsets not supported in xcode build (target %s)\"\n                % qualified_target\n            )\n        configuration_names = [spec[\"default_configuration\"]]\n        for configuration_name in sorted(spec[\"configurations\"].keys()):\n            if configuration_name not in configuration_names:\n                configuration_names.append(configuration_name)\n        xcp = xcode_projects[build_file]\n        pbxp = xcp.project\n\n        # Set up the configurations for the target according to the list of names\n        # supplied.\n        xccl = CreateXCConfigurationList(configuration_names)\n\n        # Create an XCTarget subclass object for the target. The type with\n        # \"+bundle\" appended will be used if the target has \"mac_bundle\" set.\n        # loadable_modules not in a mac_bundle are mapped to\n        # com.googlecode.gyp.xcode.bundle, a pseudo-type that xcode.py interprets","sourceCodeStart":687,"sourceCodeEnd":723,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/tools/gyp/pylib/gyp/generator/xcode.py#L687-L723","documentation":"Raised as an Exception by the xcode generator's GenerateOutput when a target's toolset is not the default 'target' toolset. The Xcode generator does not support multiple toolsets (e.g. host-vs-target cross compilation) within a single project, so any target with spec['toolset'] != 'target' is rejected.","triggerScenarios":"Generating Xcode projects for a .gyp tree that contains targets with toolset set to a non-'target' value (e.g. 'host'). The check at xcode.py:710 fires for the first such qualified_target.","commonSituations":"A cross-compilation setup that defines host toolset targets; a .gypi include meant for make/ninja accidentally pulled into an xcode build; sharing a gyp tree across generators where only some support multiple toolsets.","solutions":["Use a generator that supports multiple toolsets (make/ninja) instead of xcode for such trees.","Restructure so targets default to the 'target' toolset, or exclude host-toolset targets when generating for xcode.","Split host-toolset builds into a separate gyp invocation/generator output."],"exampleFix":"// before\n'targets': [{ 'target_name': 'host_tool', 'toolset': 'host', 'type': 'executable' }]\n// after — drop toolset or build host tools separately for xcode\n'targets': [{ 'target_name': 'host_tool', 'type': 'executable' }]","handlingStrategy":"validation","validationCode":"for qt in target_list:\n    spec = target_dicts[qt]\n    if spec.get('toolset', 'target') != 'target':\n        raise ValueError(f'non-target toolset not supported by xcode: {qt}')","typeGuard":"def is_default_toolset(spec) -> bool:\n    return spec.get('toolset', 'target') == 'target'","tryCatchPattern":null,"preventionTips":["Avoid multi-toolset targets when generating Xcode projects.","Use make/ninja for cross-toolset builds."],"tags":["gyp","xcode","toolset","macos","unsupported"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}