robur-coop / tlstunnel

A TLS reverse proxy unikernel
35 stars 2 forks source link

More mirage-4 oriented directory structure? #6

Closed rand00 closed 2 years ago

rand00 commented 2 years ago

When running

mirage configure -t spt --net=direct --dhcp=false && make depend && make build

from root of project, the unikernel is compiled correctly with opam-monorepo - but I get the following error for the client:

Error: Library "fmt.tty" in _build/solo5/duniverse/fmt/src is hidden                                      

Otoh. if I compile the client from within the client dir, opam is used rather than duniverse - and one doesn't get the error.

I imagine that with mirage-4 it makes more sense to put the unikernel related files in separate dir, like mirage-www does, and compile from there? (there the mirage dir is used) This way dune doesn't try to compile non-unikernel executables using the duniverse dir

hannesm commented 2 years ago

Hmm, interesting. So, to work with mirage4, we'll need to put the unikernel into a separate directory? Fine with me if it is needed, so maybe use a unikernel subdirectory?

dinosaure commented 2 years ago

Yes, it's like what I did for bob or contruno. However, we probably should experiment more workflows. It's not clear what we can do (about name of libraries/unikernels and how OPAM/opam monorepo lives with all of that).

rand00 commented 2 years ago

Also related to this, I would have thought that it would be easy to make ones own local dune libs (as opam-monorepo builds on dune), and then depende on them in the unikernel.

This doesn't seem to be the case, as opam-monorepo needs dependencies to be in opam. One apparantly need to opam pin the local lib first - which must be how mirage-www does it, though I havn't been able to find the place where this is done (mirageio is the local lib, placed in the lib dir)

reynir commented 1 year ago

Sorry for reopening this. I want to test some changes to http-mirage-client, but I get a solver error because mirage emits a constraint >= 0.0.1 & < 0.1.0 on http-mirage-client, but it is assigned version zdev. It's unclear to me how I can get around this constraint. Any suggestions?