(zilch lang go): introduce proper vfs record

This should hopefully make the code a bit clearer, and is preparation
for Rust support.
This commit is contained in:
puck 2024-11-01 00:12:04 +00:00
parent 0c575ca0e4
commit fc8aea8fb4
5 changed files with 228 additions and 162 deletions

View file

@ -25,7 +25,7 @@
#~,(call-with-port
(open-output-bytevector)
(lambda (bv)
(json-write (vector (cons "GOARCH" (%goarch)) (cons "GOOS" "linux") (cons "files" #$(filter-vfs-for-package-reading vfs))) bv)
(json-write (vector (cons "GOARCH" (%goarch)) (cons "GOOS" "linux") (cons "files" #$(vfs-to-json (vfs-filter-for-go-package vfs)))) bv)
(get-output-bytevector bv))))
(define input-file (zfile input))
(define store-path (cdar (store-path-for-ca-drv* "find-packages" "x86_64-linux" #~(#$go-import-parser #$input-file) '() '("out"))))