Skip to content

Commit ec78cc9

Browse files
generatedunixname89002005232357facebook-github-bot
generatedunixname89002005232357
authored andcommitted
Revert D54017026: Multisect successfully blamed "D54017026: Combine Ast and Schema structs" for one test failure
Summary: This diff reverts D54017026 D54017026: Combine Ast and Schema structs by iahs causes the following test failure: Tests affected: - [cogwheel:cogwheel_windtunnel_e2e_run_slcm#main](https://www.internalfb.com/intern/test/562950069774915/) Here's the Multisect link: https://www.internalfb.com/multisect/4389250 Here are the tasks that are relevant to this breakage: The backout may land if someone accepts it. If this diff has been generated in error, you can Commandeer and Abandon it. Differential Revision: D54112811 fbshipit-source-id: 6e391902aea15bad8fe323d593eead8158b58aa9
1 parent 51b81f1 commit ec78cc9

File tree

2 files changed

+77
-67
lines changed

2 files changed

+77
-67
lines changed

third-party/thrift/src/thrift/lib/thrift/ast.thrift

+74-5
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,81 @@
1515
*/
1616

1717
include "thrift/lib/thrift/schema.thrift"
18+
include "thrift/lib/thrift/standard.thrift"
19+
include "thrift/lib/thrift/protocol.thrift"
20+
include "thrift/lib/thrift/id.thrift"
1821

1922
namespace py3 apache.thrift
2023
namespace rust thrift_ast
2124

22-
/** This file has been merged into schema.thrift. Please include it and use its types directly. */
23-
typedef schema.SourceInfo SourceInfo
24-
typedef schema.IdentifierRef IdentifierRef
25-
typedef schema.IncludeRef IncludeRef
26-
typedef schema.Schema Ast
25+
/**
26+
* Information about a thrift source file.
27+
*/
28+
struct SourceInfo {
29+
// A source file name. It can include directory components and/or be a
30+
// virtual file name that doesn't have a correspondent entry in the system's
31+
// directory structure.
32+
// Preserves the legacy behavior of sometimes leaking resolved relative paths.
33+
// The unmodified path is available inside schema.Program.
34+
1: string fileName;
35+
36+
/**
37+
* Per-language include statements.
38+
*/
39+
2: map<string, list<id.ValueId>> languageIncludes;
40+
41+
/**
42+
* Per-language namespace.
43+
*/
44+
3: map<string, id.ValueId> namespaces;
45+
}
46+
47+
// An instance of an identifier in a source file.
48+
struct IdentifierRef {
49+
1: schema.SourceRange range;
50+
2: standard.TypeUri uri;
51+
// Because enum values don't have URIs, references to them have to point to their owning enum.
52+
// When that happens this field identifies the particular value being referenced.
53+
3: string enumValue;
54+
}
55+
56+
// An instance of an include in a source file.
57+
struct IncludeRef {
58+
1: schema.SourceRange range;
59+
2: id.ProgramId target;
60+
}
61+
62+
// A thrift schema that corresponds to one or more thrift files.
63+
@cpp.UseOpEncode
64+
struct Ast {
65+
/**
66+
* The programs included in the schema, accessible by `ProgramId`.
67+
* The first program in the program list must be the main file,
68+
* with (recursively) included programs listed after it.
69+
*/
70+
1: schema.ProgramList programs;
71+
72+
/** The values, accessible by `ValueId`. */
73+
2: list<protocol.Value> values;
74+
75+
/** The definitions, accessible by `DefinitionId`. */
76+
4: schema.DefinitionList definitions;
77+
78+
/**
79+
* DEPRECATED! Get the information from the Program struct.
80+
* Information about the files holding the thrift definitions.
81+
*/
82+
5: map<id.ProgramId, SourceInfo> sources;
83+
84+
/**
85+
* The source ranges of all references to named entities in the main program.
86+
* The `source_ranges` option must be passed to thrift2ast to populate this map.
87+
*/
88+
6: list<IdentifierRef> identifierSourceRanges;
89+
90+
/**
91+
* The source ranges of paths included in the main program.
92+
* The `source_ranges` option must be passed to thrift2ast to populate this map.
93+
*/
94+
7: list<IncludeRef> includeSourceRanges;
95+
}

third-party/thrift/src/thrift/lib/thrift/schema.thrift

+3-62
Original file line numberDiff line numberDiff line change
@@ -698,71 +698,12 @@ typedef list<Program> ProgramList
698698
@thrift.Experimental // TODO(afuller): Adapt!
699699
@cpp.UseOpEncode
700700
struct Schema {
701-
/**
702-
* The programs included in the schema, accessible by `ProgramId`.
703-
* The first program in the program list must be the main file,
704-
* with (recursively) included programs listed after it.
705-
*/
701+
/** The programs included in the schema, accessible by `ProgramId`. */
706702
1: ProgramList programs;
707703

708704
/** The values, accessible by `ValueId`. */
709-
2: list<protocol.Value> values;
705+
3: list<protocol.Value> values;
710706

711707
/** The definitions, accessible by `DefinitionId`. */
712-
3: DefinitionList definitions;
713-
714-
/**
715-
* DEPRECATED! Get the information from the Program struct.
716-
* Information about the files holding the thrift definitions.
717-
*/
718-
5: map<id.ProgramId, SourceInfo> sources;
719-
720-
/**
721-
* The source ranges of all references to named entities in the main program.
722-
* The `source_ranges` option must be passed to thrift2ast to populate this map.
723-
*/
724-
6: list<IdentifierRef> identifierSourceRanges;
725-
726-
/**
727-
* The source ranges of paths included in the main program.
728-
* The `source_ranges` option must be passed to thrift2ast to populate this map.
729-
*/
730-
7: list<IncludeRef> includeSourceRanges;
731-
}
732-
733-
/**
734-
* Information about a thrift source file.
735-
*/
736-
struct SourceInfo {
737-
// A source file name. It can include directory components and/or be a
738-
// virtual file name that doesn't have a correspondent entry in the system's
739-
// directory structure.
740-
// Preserves the legacy behavior of sometimes leaking resolved relative paths.
741-
// The unmodified path is available inside schema.Program.
742-
1: string fileName;
743-
744-
/**
745-
* Per-language include statements.
746-
*/
747-
2: map<string, list<id.ValueId>> languageIncludes;
748-
749-
/**
750-
* Per-language namespace.
751-
*/
752-
3: map<string, id.ValueId> namespaces;
753-
}
754-
755-
// An instance of an identifier in a source file.
756-
struct IdentifierRef {
757-
1: SourceRange range;
758-
2: standard.TypeUri uri;
759-
// Because enum values don't have URIs, references to them have to point to their owning enum.
760-
// When that happens this field identifies the particular value being referenced.
761-
3: string enumValue;
762-
}
763-
764-
// An instance of an include in a source file.
765-
struct IncludeRef {
766-
1: SourceRange range;
767-
2: id.ProgramId target;
708+
5: DefinitionList definitions;
768709
}

0 commit comments

Comments
 (0)