avsm changed the topic of #mirage to: mirage 2 released! party on!
brson has joined #mirage
brson has quit [Client Quit]
dograt has quit [Quit: No Ping reply in 180 seconds.]
dograt has joined #mirage
rgrinberg has joined #mirage
rgrinberg has quit [Ping timeout: 265 seconds]
rgrinberg has joined #mirage
rgrinberg has quit [Ping timeout: 252 seconds]
copy` has quit [Quit: Connection closed for inactivity]
mort___ has quit [Quit: Leaving.]
copy` has joined #mirage
mort___ has joined #mirage
mort___ has quit [Quit: Leaving.]
jermar has joined #mirage
yomimono has joined #mirage
<hannes> yomimono: in case you're up for green buttons, https://github.com/mirage/mirage/pull/551 is ready (and travis is happily building mirage-skeleton! :)
<yomimono> hannes: thanks for the notification! I'm still waking up and shoveling through my email
<yomimono> coffee has yet to cross the blood-brain barrier
<yomimono> hannes: OK, some random idiot merged your random changes :P
miragebot has joined #mirage
<miragebot> mirage/master 548ce90 Hannes Mehnert: nocrypto RNG
miragebot has left #mirage [#mirage]
<miragebot> mirage/master 092ae83 Hannes Mehnert: simplify random device
<miragebot> [mirage] yomimono pushed 4 new commits to master: https://git.io/vPqyI
<miragebot> mirage/master 540c881 Hannes Mehnert: rename default_random to stdlib_random...
<hannes> :D
<hannes> the connect stuff is also currently building mirage-skeleton, 50th attempt... should be fine now ;)
<yomimono> cool, I was just digging through notifications on this
<yomimono> I really appreciate your work on that :D
<hannes> i fell into a rabbit hole
* yomimono knows the feeling
<Drup> I felt midly spammed when I woke up x)
<Drup> (arguably, that was like, 1h ago)
<reynir> heh
<Drup> Yesterday afternoun I started playing europa universalis as Ireland. A few moment later it was 6h in the morning. :>
<reynir> heh oops
<reynir> I've had that happen to me whne I've played crusader kings 2 :)
<yomimono> i watch videos of other people playing these games while I do cross-stitch and they *still* have amazing time-warping powers
* hannes plays this game consisting of emacs, opam and ocaml... but I always loose against this TravisCI guy :(
<Drup> hannes: I did play a bit of "oasis and ocamlbuild are trying to do conditional compilation" yesterday.
<Drup> it was more difficult than unifying ireland x)
<reynir> I don't play against TravisCI - not sure it's a winning move
<hannes> the only winning move is not to play
<hannes> Drup: functoria question :)
<Drup> sure, shoot :p
<hannes> Drup: there is now multiple random number generators in mirage.ml https://github.com/mirage/mirage/blob/master/lib/mirage.ml#L100
<hannes> currently stdlib_random is hardcoded to be passed to direct_tcpip https://github.com/mirage/mirage/blob/master/lib/mirage.ml#L672
<hannes> can I make this with some magic such that if nocrypto is installed anyways, by default the other rng is used?
<Drup> hum, I somehow missed that
<Drup> huuum
<hannes> there is some magic around to detect whether nocrypto is in there...
<hannes> but I'm clueless about the phasing and how to get it in the right shape
<Drup> I have an idea, but I'm not even sure it'll work :D
<hannes> Drup: I'd be happy to see any ideas :) (you might have missed it since it just got merged...)
<hannes> but we'll suffer^Whave the same issues in the future when more people implement alternative implementations of <foo> (such as my standalone arp package)
<Drup> let test_entropy : bool Functoria.Key.value = Functoria.Key (pure is_entropy_enabled $ pure ())
<Drup> then you use Functoria.if_ to switch between the two random devices
<Drup> no, wait, that doesn't work
<hannes> would you mind instead of trying to explain me which lines to change to change them and put a diff somewhere? I'm happy to compile and test
<Drup> Well, you trying to do something that I worked a bit hard to disallow :D
<Drup> you are*
<hannes> huh?
<hannes> this is disallowed?
<Drup> dynamically changing the graph of devices depending on other nodes in the graphs ? Yeah.
<hannes> hmmmm, but you see what I would like to achieve and that this makes sort of sense!?
<Drup> the graph of devices is intended to be quite static. You just have if nodes that are *external* conditions (such as keys).
<Drup> Yes, I do
<hannes> good
<hannes> yeeha, and the connect PR builds https://travis-ci.org/mirage/mirage-skeleton/builds/164402978
mort___ has joined #mirage
<Drup> hannes: I guess you don't want to add a key that decides if we use the normal random or the nocrypto random ?
<hannes> Drup: a key what is the default would be nice as well... but furthermore making the default depend on whether nocrypto is around or not would be epic
<Drup> yeah
<Drup> honestly, I see no way of making that happening
<Drup> You say that "the logic for this is already in the mirage tool" ... but it isn't
<Drup> it's just a hackish patch to ensure that people who do not declared their device dependency properly are yelled at, and to abort in that case
<Drup> It's not a way to dynamically change the shape of the graph depending on the presence of the nocrypto device .. it just aborts
<hannes> hmm :(
<Drup> Does nocrypt rng needs entropy init ?
<Drup> (I guess yes, but I'm not knowledgable
<hannes> yes
<hannes> I did not put a `connect` in there since its already in the nocrypto device
<Drup> then why is there no dependency from nocrypt_random towards nocrypto ?
<hannes> 'coz i missed it... sorry
<Drup> Heh, I'm the one who should apologize, I should really have looked at that patch set. I glanced over it and though "oh, it's a rng device, it's out of my area of expertise" ... =')
<Drup> hannes: I'm trying to think of a nice way to make this work, this is really akward to encode, grmbl. :/
<Drup> hannes: I think it's best to make the user explicitly ask for it (via a key). So a "generic_random" similar to "generic_kv_ro"
<hannes> hmmm
<hannes> I thought about that, yes... maybe it is smarter to try not to do much magic there, but just require everything to be explicit
<Drup> that's very much functoria's way of doing thing, yes
<Drup> be explicit about your devices
<Drup> so that everything can be inspected statically with the tool.
mort___ has quit [Quit: Leaving.]
<Drup> hannes: the issue is that there is no order in the reduction of the graph. Consider the case where a unikernel uses nocrypto or not conditionally (typicall, mirage-ww does that, by having https or not). If you use the rng device in another part of the graph, then doing the reduction is very problematic
mort___ has joined #mirage
<hannes> Drup: but functoria has atm some defaults, and of course leaving everything to the user is a bit awkward... in the end, there should be sensible defaults depending on target platform and build configuration, but leave it up to a user to overwrite defaults
<Drup> sure, but that's what keys are for.
<hannes> ah, now I can see how the generic_kv_ro looks like (just had to open my eyes)
<Drup> I should update the documentation of that, because it's not very clear but, with generic_kv_ro, you can *also* fix things statically in your configuration if you want it: generic_kv_or ~key:(Key.pure `Fat) ...
<Drup> then, no keys are exposed, it uses the value directly
<hannes> that was above my head, what does it mean?
<Drup> so, if you do `generic_kv_ro "foo"`, then a key is exposed on the command line
<Drup> (which allow you to choose which kv_ro)
<hannes> yes
<Drup> but if you do `generic_kv_ro ~key:(Key.value `Fat) "foo"`, it doesn't, it just uses `Fat to find things out
<Drup> and you can compute on things of type Key.value.
<Drup> So, you can create a key "https" (like in mirage-www) and use that key to compute something of type, let's say [`Nocrypto|`Std] value, and pass that generic_random. And tada, one configuration, still figures out the right random
<Drup> hannes: It wasn't clearer, wasn't it ?
<hannes> but at the time of evaluating keys I do not yet know which packages are in the graph?
<Drup> nope
<hannes> what I got is that keys can be auto-filled by other keys
rgrinberg has joined #mirage
<Drup> (since evaluating keys pretty much determines which packages are in the graph)
<hannes> i can see...
<hannes> so passing an "abstract nocrypto" dependency (is this a key?), as we do in several unikernels, can that lead to the choice of a RNG?
<Drup> No.
<hannes> this 'abstract nocrypto' is not a key, or is it?
<Drup> no, it's just a device
<Drup> `abstract` just hides the phantom type. `nocrypto` is just a device.
<Drup> hum, there is no example of https-or-not in mirage-skeletong
<Drup> -g
<yomimono> mirage-www has one
<Drup> Yes, I know
<yomimono> is static_website_tls not switching on config-time info ?
<yomimono> probably we should collapse static_website and static_website_tls into an example of how to do that
<yomimono> maybe a nicer example than mirage-www which is convoluted
<Drup> apparently not, it has both
mort___ has quit [Quit: Leaving.]
yomimono has quit [Ping timeout: 265 seconds]
miragebot has joined #mirage
<miragebot> mirage/master 72d1a51 Anil Madhavapeddy: Merge pull request #605 from hannesm/fix_rng...
miragebot has left #mirage [#mirage]
<miragebot> mirage/master 201c64d Hannes Mehnert: shuffle around to add a dependency to nocrypto_entropy to nocrypto_rng
<miragebot> [mirage] avsm pushed 2 new commits to master: https://git.io/vPqAC
rgrinberg has quit [Ping timeout: 252 seconds]
yomimono has joined #mirage
* yomimono unfurls "MERGE SPAM-A-THON 2016" banner
mort___ has joined #mirage
mort___ has quit [Quit: Leaving.]
copy` has quit [Quit: Connection closed for inactivity]
mort___ has joined #mirage
miragebot has joined #mirage
<miragebot> mirage/master 6ae61af Hannes Mehnert: cleanup: remove dead code
<miragebot> mirage/master 206a07e Hannes Mehnert: connect does not return a result
<miragebot> mirage/master 67e0df0 Hannes Mehnert: functoria needs return
miragebot has left #mirage [#mirage]
<miragebot> [mirage] yomimono pushed 5 new commits to master: https://git.io/vPmvk
<hannes> \o/
<yomimono> :D
dograt has quit [Ping timeout: 265 seconds]
yomimono has quit [Quit: Leaving]
<mort___> random opam question - is there an easy way to force opam to *never* install a package?
<mort___> no matter what dependencies say (barfing in preference)
<Drup> that's an interesting request
<Drup> mort___: create a new package with "opam pin add --edit FOO", give it a reasonably unique name, remove install, build fields and dependencies, add one conflict with the package you don't want
<mort___> the context was a (mistaken) belief that there were remaining camlp4 dependencies where we didn't want them
<Drup> strictly speaking, that doesn't mean it will never be installed, but when installed, it will be forced to remove that dummy package
<mort___> so i wondered about forcing my switch to conflict with camlp4 in some fashion
<hannes> mort___: the xen stuff is full of it, as well as mirage-console (but samoht has a PR which needs some rebasing)
<Drup> oh, you could actually make it part of your base package, so that it's never removed
<Drup> (but only in opam 2.0)
<mort___> hannes: yeah it turns out avsm belief that mirage-www didn't build with 4.03 was xen specific and not to do with direct use of syntax extensions in mirage-www itself
<mort___> drup: thanks, i might try that some time :)
<hannes> mort___: but someone should get rid of the syntax extension anyways ;)
<Drup> note that the conflict messages that opam spurt are a bit .. well, verbose
<mort___> yes indeed. and make the default logging that travis handles less verbose too — too big for this web session, need to download the raw log
<Drup> and not very friendly
<hannes> mort___: I did my community service for this month already (and it is only the 2nd October) ;)
<mort___> yeah, i know :)
<mort___> about time i actually got myself a docker thingy for building the xen version anyway
<mort___> (and thanks for the community service, it's appreciated!)
<hannes> mort___: and I have a long list of "things to be done" in various repositories.. like porting to logs, porting to topkg ;)
<mort___> well, fwiw i was going to spend some time with mirage-www once i'd finished mirage-decks
<hannes> and fixing up dependencies... some are unneccessary..
<hannes> \o/
<Drup> wrt mirage-www, it would be nice to have a better story wrt client ocaml code
<Drup> the build system story is horrendous
<mort___> drup: tyxml question: with tyxml, is there any particular benefit to using combinators directly over the ppx let%html thing?
<mort___> drup: yes, it is
<mort___> i shall probably try and do something about that when i pick it up
<Drup> huum, some things are not expressible in the ppx
<Drup> like "div @@ List.map foo l"
<mort___> ah ok
<Drup> I mean, you can express it, but at some point, you might just as well, use the combinators
<mort___> also, is there an easy way to print the structure resulting from the combinators to a string?
<mort___> yeah.. it's when porting an existing pile of html both from template files and embedded via cow.syntax
<Drup> Depends, which instance of the combinators are you using ?
<mort___> er, dunno :)
<mort___> how many instances are there?
<Drup> which module did you open ? :D
<mort___> Tyxml.Html
<Drup> ok
<Drup> so then it's easy, Tyxml.Html.pp
<mort___> have been manually converting to direct use of ocmbinators so far
<mort___> but it's tedious
<Drup> Yeah, that's the reason we have the syntax extension, people seem to like to write the boilerplate with the actual html syntax
<mort___> ok— imagine i'm some kind of idiot n00b who doesn't understand all that Format.formatter magic — how do i invoke pp on the result of the ocmibnators to get a string? :)
<Drup> It's written in the documentation ! :D
<mort___> i did look, must've missed it...
<Drup> let s = Format.asprintf "%a" (Tyxml.Html.pp ()) my_html
<hannes> I also needed hours, and finally asking Drup ;)
<Drup> hum, you asked me that ? I don't remember :(
<hannes> I did. on 22nd july :)
<Drup> which documentation you guys are browsing ?
<Drup> huum
<mort___> looking at the navbar on the left, it's not obvious where to click for more tbh
<mort___> at least to me
<mort___> (functors? types+sigs? Index of values?)
<hannes> Drup: for me, an example was missing... was lost in the types
<Drup> I agree
<Drup> hannes: the examples didn't help ?
<Drup> https://github.com/ocsigen/tyxml/tree/master/examples those one, they are linked from the tutorial page
<Drup> I should probably add a link to the navbar
<mort___> ta :)
<Drup> (I agree tyxml is extremely confusing, it has a ridiculously large surface API, the types are very complicated and it uses functors in a way that ocamldoc really doesn't like. I tried my best with the documentation but ...)
mort___ has quit [Quit: Leaving.]
mort___ has joined #mirage
<hannes> mort___: btw install camlp4 4.03+1 [required by xen-gnt, xen-evtchn, xenstore]
<mort___> (sorry dropped off there stupid osx)
<mort___> hannes: in order to make the build work? i'll pass on to avsm
<hannes> mort___: that is what opam told me on travis...
<hannes> and I saw in various xen-* libraries camlp4..
<mort___> ack
<mort___> another dumb ocaml question — is there a benefit to using (eg) Tyxml_html vs Tyxml.Html in teh module open?
<Drup> It's an alias, so
<Drup> no
<mort___> ta
<Drup> It's just that you can "open Tyxml", and get Html and Svg in the context
<mort___> yup, just wondered if any reason in hte other direction as it were
<mort___> hm
<mort___> drup: why do the following give me different output?
<mort___> cd src && mirage configure -f config.ml —help
<mort___> mirage configure -f src/config.ml —help
<mort___> ?
<mort___> specifically the latter gives no information about any of the Key paramters
<Drup> huuh, because of a bug ? :(
<mort___> :)
<mort___> possibly the -f parameter is ignored for --help
<mort___> since mirage configure -f src/config.ml —help gives me the same as the latter example above even when i'm in the src directory
<mort___> and so there isn't a src/config.ml viisble
<mort___> yes
<mort___> mirage configure -f xxx.ml —help doesn't barf either
<mort___> want me to file an issue? :) (assuming this isn't intended behaviour...)
<Drup> I'm not exactly surprised, honestly
<Drup> but yes, please do
<mort___> (ugh. i'll be in japan next week. 29degC, 97% humidity. i shall melt)
<mort___> will do — does this look like functoria or mirage tool specific?
<Drup> functoria
<mort___> will put it on mirage/mirage if not obvious
dograt has joined #mirage
<mort___> ok
copy` has joined #mirage
<mort___> filed
<mort___> drup: another dumb question - does current mirage tool support kv_ro type for direct passthrough on unix?
<mort___> (i think it might not but might be missing something)
<mort___> ah!
<mort___> it does but only as default
<mort___> can't select explicitly
<Drup> mort___: You mean `direct_kv_ro` ?
<mort___> yes
<mort___> it looks from the —help output as if that isn't an option that can be selected anyway
<Drup> ah, ok
<mort___> ` --kv_ro=KV_RO (absent=crunch)
<mort___> Use a fat, archive or crunch implementation for the unikernel.`
<Drup> I remember mindy doing something about that
<mort___> ah, possibly it's in mirage_key.ml that i should add something to the definition of `kv_ro`
<mort___> not generic_kv_ro at all
<Drup> https://github.com/mirage/mirage/pull/556 apparently, we didn't do the follow up
<mort___> ah yes
<mort___> it was merged jul13
<mort___> that pr
<mort___> i'll create a new one
<mort___> exposing direct as an option
<mort___> rather than relying on default behaviour
<mort___> hannes: would the following error building mirage be due to your recent improvements to the error handling of connecT?
<mort___> File "lib/mirage.ml", line 1740, characters 28-35:
<mort___> The value `driver_error' is required but not provided
<mort___> File "app/functoria_app.mli", line 79, characters 2-36:
<mort___> ...
<mort___> Error: Signature mismatch:
<mort___> Expected declaration
<hannes> mort___: yes. you need to update functoria
<mort___> ah ok — to what?
<hannes> git master
<mort___> what's the easy opam workflow for that again?
<hannes> opam pin add functoria --dev-repo
<mort___> pin to #master or stg?
<mort___> ah ok ta
<hannes> (or opam pin add -k git functoria https://github.com/mirage/functoria.git)
<hannes> mort___: but likely you want to add the mirage-dev repo to your remotes...
<hannes> since there is atm quite some stuff which is updated...
<mort___> yeah i guess so
<mort___> was trying to avoid getting caught up in any large scale changes going on for mirage3
<mort___> for a small patch
<hannes> true
<hannes> for the small patch functoria and mirage should suffice, but then mirage itself depends on mirage-types ;)
<hannes> (and crunch is atm broken (but mindy has a pending PR, I suspect that'll soon be merged))
<mort___> ack :)
<mort___> does https://github.com/mirage/mirage/pull/607 look reasonable?
brson has joined #mirage
<hannes> is there somewhere the implementation already which accepts the direct?
<Drup> so, yeah, sort of
<Drup> I would add it, personally, it's clearer
<mort___> direct is already supported yes
<mort___> it just wasn't exposed as an explicit option, only as the implicit default
<hannes> ic.. i'd also explicitly put that into the match
<mort___> sure
<mort___> gimme a sec
<mort___> done
<hannes> mort___: lgtm
<mort___> should i go ahead merge and release? or just merge and leave release to v3?
<mort___> (haven't done this often/recently enough to be confident i'll not slip up…!)
<hannes> it would be good to wait until travis is happy... and no need to do releases right now
<mort___> ok
<mort___> some alpine ci datakit thing seems happy
<mort___> though i can't view details without credentials
<mort___> ...
<mort___> (and it's at the end of a not entirely matching tls cert :)
<mort___> will await trustworthy travis… ;)
<hannes> and travis is likely unhappy due to the crunch thingy...
<hannes> btw, here's a diff of a generated main.ml from this morning till this evening https://gist.github.com/hannesm/e0e6dd582b18c5933b612f9e77c08aee/revisions
<mort___> \o/ :)
<mort___> always felt the tagline for mirage should be "delete code and turn shit off"
<mort___> (the only path to a secure system…)
<hannes> yes.. deleting code is actually the only sensible way forward
<mort___> is there any way to have a "proper" multiline string in ocaml?
<mort___> (everything escaped until the closing quote sequence)
<mort___> per python's """ … """ or ''' … ''' ?
<hannes> {___|foobar|___} ?
<mort___> whoa crazy
<mort___> wtf is that?
<mort___> ooh, nice
<mort___> the __ are optional then
<hannes> you can define your own separator between { and |
<mort___> but separator has no significance, only has to match in closing sequence?
<hannes> yes
<hannes> afaict
<hannes> and it doesn't seem to work well with utop..
<mort___> seems ok to me ...?
<mort___> would be even nicer to have some way to indicate which column to ignore whitespace to but that's me being greedy :)
mort___ has left #mirage [#mirage]
<hannes> zzz
mort___ has joined #mirage
rgrinberg has joined #mirage
<mort___> drup: another quick tyxml question. what do i do about using the comment combinator in a chunk of Html?
<mort___> since i seem to get:Error: This expression has type Tyxml.Html.Xml.elt = Tyxml_xml.elt
<mort___> Html_types.head_content_fun Tyxml.Html.elt =
<mort___> Html_types.head_content_fun Tyxml_html.elt
<mort___> but an expression was expected of type
rgrinberg has quit [Quit: WeeChat 1.5]
<Drup> To insert Xml nodes inside html, use Html.tot
rgrinberg has joined #mirage
<mort___> ah, thx!
<mort___> Drup: (sorry) another tyxml question
<mort___> i have a structure built via the combinators like so:
<mort___> p [
<mort___> ];
<mort___> speakers
<mort___> strong [d.Deck.venue];
<mort___> where speakers is bulit like soL
<mort___> let speakers =
<mort___> d.Deck.speakers
<mort___> |> List.map (fun s -> match s.People.uri with
<mort___> | Some u -> em [a ~a:[a_href u] [pcdata s.People.name]]
<mort___> )
<mort___> | None -> a [pcdata s.People.name]
<mort___> |> concat (pcdata ", ")
<mort___> but i get the error
<mort___> Error: This expression has type
<mort___> ([< Html_types.p_content_fun > `Strong ] as 'a) Tyxml.Html.elt =
<mort___> but an expression was expected of type
<mort___> [> `A of [> `PCDATA ] | `Em | `PCDATA ] Tyxml.Html.elt list
<mort___> 'a Tyxml_html.elt
<Drup> speakers is a list, it wants a single element
<mort___> how can i make speakers have a type that's acceptable to put in the list of values inside the p [ … ]; ?
<mort___> ah
<mort___> doh
<mort___> yes
<mort___> Drup: sorry, another one. is it possible to use the combinators to slap a preamble onto the front of the result of Tyxml.Html.html … ?
<mort___> (the DOCTYPE bits for Html5 specifically)
<Drup> We usually do it manually
<Drup> (note that Html.html will do the whole doctype thing)
<mort___> ah ok. so i create a string and then convert my Html.html result to string?
<mort___> yeah but i want some conditional comments to handle for IE9 etc
<Drup> right
<Drup> so basically, yes.
<mort___> the "preamble" for mirage decks was <!DOCTYPE html>
<mort___> <!--[if gt IE 8]><!--><html class=\"no-js\" lang=\"en\" ><!--<![endif]--> fwiw
<mort___> <!--[if IE 8]><html class=\"no-js lt-ie9\" lang=\"en\" ><![endif]-->
<mort___> cool ta
<Drup> (though, it's better to use a channel, instead of going through a string)
<Drup> (or a format, or ...)
<mort___> oh ok - can you point me to an example?
<Drup> (anything else than a string really, strings are shit)
<mort___> or you mean like the asprintf example you gave me earlier?
<Drup> yeah
<mort___> so i use "blahblah %a"?
<Drup> or "%s%a" with
<Drup> with your string*
<mort___> ah ok
<Drup> (are you sure you need those IE8 thing, noscript is not enough ?)
<mort___> that's what zurb foundation used at the time we put decks together iirc
<mort___> some of the frameworks try to handle ie9 better than ie8 and below
<Drup> ok
brson has quit [Quit: leaving]
mort___ has quit [Quit: Leaving.]
mort___ has joined #mirage
mort___ has quit [Quit: Leaving.]