From 57a83e9453bb2d0f4c80e00df72aa4317dcac58f Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Wed, 3 Jun 2020 11:44:46 -0700 Subject: 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. --- sys/fuchsia/layout/fidl_mappings.go | 59 ++++++++----------------------------- 1 file changed, 13 insertions(+), 46 deletions(-) (limited to 'sys/fuchsia/layout') 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/ @@ -66,12 +40,5 @@ func (fidlLib FidlLibrary) PathToJSONIr() string { // PathToCompiledDir provides the path to compiled headers, relative to the // out/ 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()) } -- cgit mrf-deployment