forked from mirage/mirage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fail if there are jobs registered without any arguments.
This ensures that toplevel expressions in the unikernels are properly evaluated. Fixes mirage#873 mirage#1426
- Loading branch information
Showing
9 changed files
with
49 additions
and
6 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,9 +1,9 @@ | ||
open Mirage | ||
|
||
let main = main "App" job | ||
let main = main "App" (job @-> job) | ||
|
||
let key = | ||
let doc = Key.Arg.info ~doc:"How to say hello." [ "hello" ] in | ||
Key.(create "hello" Arg.(opt string "Hello World!" doc)) | ||
|
||
let () = register ~keys:[ Key.v key ] "noop" [ main ] | ||
let () = register ~keys:[ Key.v key ] "noop" [ main $ noop ] |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
open Mirage | ||
|
||
let main = main "App" job | ||
|
||
let key = | ||
let doc = Key.Arg.info ~doc:"How to say hello." [ "hello" ] in | ||
Key.(create "hello" Arg.(opt string "Hello World!" doc)) | ||
|
||
let () = register ~keys:[ Key.v key ] ~src:`None "noop" [ main ] |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
$ export MIRAGE_DEFAULT_TARGET=unix | ||
|
||
Configure | ||
$ ./config.exe configure | ||
Fatal error: exception Invalid_argument("Your configuration includes a job without arguments. Please add a dependency in your config.ml: use `let main = Mirage.main \"Unikernel.hello\" (noop @-> job) register \"hello\" [ main $ noop ]` instead of `.. job .. [ main ]`.") | ||
[2] |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
(executable | ||
(name config) | ||
(libraries mirage)) | ||
|
||
(cram | ||
(package mirage) | ||
(deps config.exe)) |
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,9 +1,9 @@ | ||
open Mirage | ||
|
||
let main = main "App" job | ||
let main = main "App" (job @-> job) | ||
|
||
let key = | ||
let doc = Key.Arg.info ~doc:"How to say hello." [ "hello" ] in | ||
Key.(create "hello" Arg.(opt string "Hello World!" doc)) | ||
|
||
let () = register ~keys:[ Key.v key ] ~src:`None "noop" [ main ] | ||
let () = register ~keys:[ Key.v key ] ~src:`None "noop" [ main $ noop ] |
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,9 +1,9 @@ | ||
open Mirage | ||
|
||
let main = main "App" job | ||
let main = main "App" (job @-> job) | ||
|
||
let key = | ||
let doc = Key.Arg.info ~doc:"How to say hello." [ "hello" ] in | ||
Key.(create "hello" Arg.(opt string "Hello World!" doc)) | ||
|
||
let () = register ~keys:[ Key.v key ] ~src:`None "noop-functor.v0" [ main ] | ||
let () = register ~keys:[ Key.v key ] ~src:`None "noop-functor.v0" [ main $ noop ] |