{"record":{"id":"8ab5aae9c0f06021","repo":"nodejs/node","slug":"duplicate-targets-in-isolate-map-files-s","errorCode":null,"errorMessage":"Duplicate targets in isolate map files: %s.","messagePattern":"Duplicate targets in isolate map files: (.+?)\\.","errorType":"exception","errorClass":"MBErr","httpStatus":null,"severity":"error","filePath":"deps/v8/tools/mb/mb.py","lineNumber":586,"sourceCode":"    self.configs = contents['configs']\n    self.luci_tryservers = contents.get('luci_tryservers', {})\n    self.builder_groups = contents['builder_groups']\n    self.mixins = contents['mixins']\n\n  def ReadIsolateMap(self):\n    if not self.args.isolate_map_files:\n      self.args.isolate_map_files = [self.default_isolate_map]\n\n    for f in self.args.isolate_map_files:\n      if not self.Exists(f):\n        raise MBErr('isolate map file not found at %s' % f)\n    isolate_maps = {}\n    for isolate_map in self.args.isolate_map_files:\n      try:\n        isolate_map = ast.literal_eval(self.ReadFile(isolate_map))\n        duplicates = set(isolate_map).intersection(isolate_maps)\n        if duplicates:\n          raise MBErr(\n              'Duplicate targets in isolate map files: %s.' %\n              ', '.join(duplicates))\n        isolate_maps.update(isolate_map)\n      except SyntaxError as e:\n        raise MBErr('Failed to parse isolate map file \"%s\": %s' %\n                    (isolate_map, e)) from e\n    return isolate_maps\n\n  def ConfigFromArgs(self):\n    if self.args.config:\n      if self.args.builder_group or self.args.builder:\n        raise MBErr(\n          'Can not specific both -c/--config and -m/--builder-group or '\n          '-b/--builder')\n\n      return self.args.config\n\n    if not self.args.builder_group or not self.args.builder:","sourceCodeStart":568,"sourceCodeEnd":604,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/v8/tools/mb/mb.py#L568-L604","documentation":"ReadIsolateMap() merges multiple isolate map files into one dict. After parsing each file it computes `set(isolate_map).intersection(isolate_maps)`; if any target key already exists from a previously-loaded file, it raises MBErr('Duplicate targets in isolate map files: %s') listing the duplicated keys. Each target must be defined in exactly one map file.","triggerScenarios":"Passing two or more -i isolate map files that both define the same target name. The intersection is non-empty and MBErr names the duplicates.","commonSituations":"Overriding the default map with a custom -i that re-declares a target already in gn_isolate_map.pyl; merging two map files that overlap; a copy-paste that duplicated a target block across files.","solutions":["Identify the duplicate target(s) in the error message and remove the definition from one of the files so each target appears in exactly one map.","If you intended to override, edit the default map instead of layering a second -i file.","Re-run with a single -i file or deduplicate the keys before retrying."],"exampleFix":"// before\n  # gn_isolate_map.pyl defines 'v8_unittests'\n  mb.py gen -i custom.pyl ...   # custom.pyl ALSO defines 'v8_unittests'\n// after\n  # remove 'v8_unittests' from custom.pyl, then:\n  mb.py gen -i custom.pdl ...","handlingStrategy":"validation","validationCode":"seen = set()\nfor f in isolate_map_files:\n    keys = set(ast.literal_eval(open(f).read()))\n    dup = keys & seen\n    if dup: sys.exit(f'duplicate targets across map files: {sorted(dup)}')\n    seen |= keys","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Maintain each target in exactly one isolate map file.","Prefer editing the default map over layering a second -i override.","Add a CI check that asserts no key overlap across the configured map file set."],"tags":["mb","isolate","duplicate","validation","v8-build"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}