code: def hydrate_sources(sources_field, glob_match_error_behavior):
    
    # TODO(#5864): merge the target's selection of --glob-expansion-failure (which doesn't exist yet)
    # with the global default!
    path_globs = sources_field.path_globs.copy(glob_match_error_behavior=glob_match_error_behavior)
    snapshot = yield Get(Snapshot, PathGlobs, path_globs)
    fileset_with_spec = _eager_fileset_with_spec(
      sources_field.address.spec_path,
      sources_field.filespecs,
      snapshot)
    sources_field.validate_fn(fileset_with_spec)
    yield HydratedField(sources_field.arg, fileset_with_spec)
docs: Given a SourcesField, request a Snapshot for its path_globs and create an EagerFilesetWithSpec.