@@ -85,6 +85,11 @@ func getFfi(pkg *packages.Package) string {
85
85
seenFfis := make (map [string ]struct {})
86
86
packages .Visit ([]* packages.Package {pkg },
87
87
func (pkg * packages.Package ) bool {
88
+ // the dependencies of an FFI are not considered as being used; this
89
+ // allows one FFI to be built on top of another
90
+ if _ , ok := ffiMapping [pkg .PkgPath ]; ok {
91
+ return false
92
+ }
88
93
return true
89
94
},
90
95
func (pkg * packages.Package ) {
@@ -1859,19 +1864,21 @@ func stringLitValue(lit *ast.BasicLit) string {
1859
1864
1860
1865
// TODO: put this in another file
1861
1866
var builtinImports = map [string ]bool {
1862
- "github.com/tchajed/goose/machine" : true ,
1863
- "github.com/tchajed/goose/machine/filesys" : true ,
1864
- "github.com/mit-pdos/gokv/grove_ffi" : true ,
1865
- "github.com/tchajed/goose/machine/disk" : true ,
1866
- "github.com/mit-pdos/gokv/time" : true ,
1867
- "sync" : true ,
1868
- "log" : true ,
1869
- "fmt" : true ,
1867
+ "github.com/tchajed/goose/machine" : true ,
1868
+ "github.com/tchajed/goose/machine/filesys" : true ,
1869
+ "github.com/mit-pdos/gokv/grove_ffi" : true ,
1870
+ "github.com/tchajed/goose/machine/disk" : true ,
1871
+ "github.com/tchajed/goose/machine/async_disk" : true ,
1872
+ "github.com/mit-pdos/gokv/time" : true ,
1873
+ "sync" : true ,
1874
+ "log" : true ,
1875
+ "fmt" : true ,
1870
1876
}
1871
1877
1872
1878
var ffiMapping = map [string ]string {
1873
- "github.com/mit-pdos/gokv/grove_ffi" : "grove" ,
1874
- "github.com/tchajed/goose/machine/disk" : "disk" ,
1879
+ "github.com/mit-pdos/gokv/grove_ffi" : "grove" ,
1880
+ "github.com/tchajed/goose/machine/disk" : "disk" ,
1881
+ "github.com/tchajed/goose/machine/async_disk" : "async_disk" ,
1875
1882
}
1876
1883
1877
1884
func (ctx Ctx ) imports (d []ast.Spec ) []coq.Decl {
0 commit comments