diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2020-06-03 11:44:46 -0700 |
|---|---|---|
| committer | Marco Vanotti <mvanotti@users.noreply.github.com> | 2020-06-05 15:08:57 -0300 |
| commit | 57a83e9453bb2d0f4c80e00df72aa4317dcac58f (patch) | |
| tree | 9824afd2d65c2431f57021f937d56c131f9f4e24 /sys/fuchsia/layout | |
| parent | d36418e90bb0c3c89f2721f61b61b257758661f3 (diff) | |
sys/fuchsia: update "make extract" support code
FIDL fuzzing hasn't been working for a while, and it's further
bit-rotted as upstream FIDL functionality has continued to evolve.
This commit updates enough FIDL functionality to get a minimal FIDL
test case to work again.
Diffstat (limited to 'sys/fuchsia/layout')
| -rw-r--r-- | sys/fuchsia/layout/fidl_mappings.go | 59 |
1 files changed, 13 insertions, 46 deletions
diff --git a/sys/fuchsia/layout/fidl_mappings.go b/sys/fuchsia/layout/fidl_mappings.go index 837a97332..44fb308e1 100644 --- a/sys/fuchsia/layout/fidl_mappings.go +++ b/sys/fuchsia/layout/fidl_mappings.go @@ -9,50 +9,24 @@ import ( "strings" ) -// layer indicates at which layer a FidlLibrary lives in the Fuchsia build -// system. -type layer int - -const ( - _ layer = iota - zircon - garnet -) - -// FidlLibrary describes a FIDL library. It captures required details such as -// build location, header generation, etc. -type FidlLibrary struct { - layer layer - - // FqName stores the fully-qualified name of the library in parts, e.g. - // the `fuchsia.mem` library is `fuchsia`, `mem`. - FqName []string -} +// FidlLibrary is the fully-qualified name of a FIDL library. +type FidlLibrary []string // AllFidlLibraries lists all FIDL libraries. var AllFidlLibraries = []FidlLibrary{ - {zircon, []string{"fuchsia", "mem"}}, - {zircon, []string{"fuchsia", "cobalt"}}, - {zircon, []string{"fuchsia", "ldsvc"}}, - {zircon, []string{"fuchsia", "process"}}, - {zircon, []string{"fuchsia", "io"}}, - {zircon, []string{"fuchsia", "net"}}, - {zircon, []string{"fuchsia", "hardware", "ethernet"}}, - {garnet, []string{"fuchsia", "devicesettings"}}, - {garnet, []string{"fuchsia", "net", "stack"}}, - {garnet, []string{"fuchsia", "timezone"}}, - {garnet, []string{"fuchsia", "scpi"}}, + {"fuchsia", "cobalt"}, + {"fuchsia", "devicesettings"}, + {"fuchsia", "hardware", "ethernet"}, + {"fuchsia", "io"}, + {"fuchsia", "ldsvc"}, + {"fuchsia", "mem"}, + {"fuchsia", "net"}, + {"fuchsia", "process"}, + {"fuchsia", "scpi"}, } func (fidlLib FidlLibrary) dirName() string { - switch fidlLib.layer { - case zircon: - return strings.Join(fidlLib.FqName, "-") - case garnet: - return strings.Join(fidlLib.FqName, ".") - default: - panic(fmt.Sprintf("unknown layer %v", fidlLib.layer)) - } + return strings.Join(fidlLib, ".") } // PathToJSONIr provides the path to the JSON IR, relative to the out/<arch> @@ -66,12 +40,5 @@ func (fidlLib FidlLibrary) PathToJSONIr() string { // PathToCompiledDir provides the path to compiled headers, relative to the // out/<arch> directory. func (fidlLib FidlLibrary) PathToCompiledDir() string { - switch fidlLib.layer { - case zircon: - return filepath.Join("fidling", "gen", "zircon", "system", "fidl", fidlLib.dirName()) - case garnet: - return filepath.Join("fidling", "gen", "sdk", "fidl", fidlLib.dirName()) - default: - panic(fmt.Sprintf("unknown layer %v", fidlLib.layer)) - } + return filepath.Join("fidling", "gen", "sdk", "fidl", fidlLib.dirName()) } |
