diff --git a/swift/internal/compiling.bzl b/swift/internal/compiling.bzl index 676c066a9..78646768f 100644 --- a/swift/internal/compiling.bzl +++ b/swift/internal/compiling.bzl @@ -3250,13 +3250,13 @@ def _declare_multiple_outputs_and_write_output_file_map( output_map[src.path] = struct(**src_output_map) actions.write( - content = struct(**output_map).to_json(), + content = json.encode(struct(**output_map)), output = output_map_file, ) if split_derived_file_generation: actions.write( - content = struct(**derived_files_output_map).to_json(), + content = json.encode(struct(**derived_files_output_map)), output = derived_files_output_map_file, ) diff --git a/swift/internal/vfsoverlay.bzl b/swift/internal/vfsoverlay.bzl index 0eea7b9c3..9c8ea5f60 100644 --- a/swift/internal/vfsoverlay.bzl +++ b/swift/internal/vfsoverlay.bzl @@ -56,7 +56,7 @@ def write_vfsoverlay( # The YAML specification defines it has a superset of JSON, so it is safe to # use the built-in `to_json` function here. - vfsoverlay_yaml = struct(**vfsoverlay_object).to_json() + vfsoverlay_yaml = json.encode(struct(**vfsoverlay_object)) actions.write( content = vfsoverlay_yaml,