-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include shell source and build source directories in
proc.Spawn
(#102)
* dev: refactor initdata I needed to make some changes to initdata for #89, and in the process made it simpler. Now the list of files is in one place, and we always embed them into the bootloader. However, for debug builds we default to embedding just the filepaths instead of their contents, and fetching them at runtime. You still have the option of embedding the file contents by setting the `PROD` environment variable. This supports previous behavior while simplifying the codepaths. * Embed shell source instead of binary and make spawn build source directories Closes #88 Closes #89 I though it was a bit silly casting `s.fsys` everywhere, so I modifed `fs.go` to store the `watchfs` seperately. There was also an issue in `wasm.js:writeSync()` where it would be passed a null value for `buf` after the build tool finished in `proc.go:Spawn()`. I added a catch-all fix, but perhaps its a bug that the null is passed in the first place. There's still some kinks to work out before you can edit the shell seamlessly, namely using better heuristics for when files should be updated/rebuilt. We can use mtime/ctime for those. * kernel: compare `mtime`'s when building source or copying files from `initfs` Closes #66 Enables proper live editing within Wanix! `proc.Spawn` will rebuild commands from source if it's been modified, and `kernel.fs` will copy in `initfs` files if they've been modified externally *(note this will overwrite local files inside Wanix)*.
- Loading branch information
1 parent
218faa9
commit 214113a
Showing
15 changed files
with
271 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
globalThis.initdata = { | ||
{{range .}} | ||
"{{.Name}}": {type: "{{.Type}}", data: "{{.Data}}"}, | ||
"{{.Name}}": {type: "{{.Type}}", mtimeMs: {{.Mtime}}, data: "{{.Data}}"}, | ||
{{end}} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.