Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

will my project build with mirage? #460

Open
yomimono opened this issue May 24, 2016 · 3 comments
Open

will my project build with mirage? #460

yomimono opened this issue May 24, 2016 · 3 comments

Comments

@yomimono
Copy link
Contributor

This isn't in the faq, but it's a reasonably frequently asked question. The answer probably deserves its own blog entry or article. Were I to write it, I'd probably make a flowchart with something like:

  • Does your project make extensive use of the Unix module?
  • Does your project depend on filesystem storage?
  • If yes to either of the above, try factoring that away, then proceed below.
  • If no to the first two of the above, try wrapping your program's main in the closest example in mirage-skeleton and see what happens.

...but that's an exceedingly crude and labor-intensive way of answering this question; I suspect better advice is available from better advisors.

@amirmc
Copy link
Contributor

amirmc commented May 24, 2016

I think that would be a great set of things to write up up!

The first three points are important and because of dependencies, it may not always be clear to people how to figure out where the Unix deps are (without trial and error), or what libs they should use to avoid introducing such deps.

On 24 May 2016, at 13:19, Mindy Preston notifications@github.com wrote:

This isn't in the faq, but it's a reasonably frequently asked question. The answer probably deserves its own blog entry or article. Were I to write it, I'd probably make a flowchart with something like:

• Does your project make extensive use of the Unix module?
• Does your project depend on filesystem storage?
• If yes to either of the above, try factoring that away, then proceed below.
• If no to the first two of the above, try wrapping your program's main in the closest example in mirage-skeleton and see what happens.
...but that's an exceedingly crude and labor-intensive way of answering this question; I suspect better advice is available from better advisors.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

@dbuenzli
Copy link
Contributor

dbuenzli commented May 24, 2016

Le mardi, 24 mai 2016 à 22:08, Amir Chaudhry a écrit :

The first three points are important and because of dependencies, it may not always be clear to people how to figure out where the Unix deps are (without trial and error),

Well instead of trial and error there's a thing called opam list --required-by PKG —rec which can already give a good guess; there may be false positives though (it includes build deps).

Daniel

@hannesm
Copy link
Member

hannesm commented Nov 14, 2016

to add some notes:

  • there is an opam package base-unix, I suspect this dependency is not explicit in all packages
  • since 3.0.0 there will be in addition no Str module provided by the MirageOS OCaml runtime
  • there has not been any sign of systhreads in MirageOS OCaml runtime
  • num is also not present (but we have gmp + zarith ports)

The behaviour of mirage on unix (mirage configure -t unix) and other platforms (xen, solo5) is different since the otherlibs mentioned above are not provided on the freestanding platforms. Thus, while some mirage application might compile and run on Unix, it can fail on freestanding platforms. In addition to that, if there are any C stubs in any dependent library, they need to be "cross"compiled for freestanding (i.e. with the right CFLAGS).

It may be doable to generate a _tags which contains dontlink(unix num str threads) to get a very similar behaviour (apart from the C stubs, I've no solution for this right now) for both unix and freestanding platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants