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

+mirage-platform.3.3.0 #13495

Merged
merged 2 commits into from
Feb 22, 2019
Merged

+mirage-platform.3.3.0 #13495

merged 2 commits into from
Feb 22, 2019

Conversation

avsm
Copy link
Member

@avsm avsm commented Feb 19, 2019

supports forthcoming dune support as part of mirage/mirage#969:

  • Add support for OCaml 4.08 (Add support for OCaml 4.08 mirage/mirage-platform#206 by @anmonteiro)
  • libxenasmrun.a is symlinked in the ocaml directory in order to be able to use ocamlopt's -runtime-variant option.
  • Expose flags through files as well as pkg-config (Add support for OCaml 4.06 and 4.07 mirage/mirage-platform#205 by @TheLortex). Instead of pkg-config, one can use the following files to get compilation flags:
    • mirage-xen-ocaml/libs
    • mirage-xen-ocaml/cflags
    • mirage-xen-posix/minios-cflags
    • mirage-xen-posix/minios-libs
    • mirage-xen-posix/posix-cflags
    • mirage-xen-posix/posix-libs
      With dune this allows us to write %{lib:mirage-xen-posix:posix-libs} to get the flags instead of having a script invoking pkg-config mirage-xen-posix --libs.

supports forthcoming dune support as part of mirage/mirage#969:

* Add support for OCaml 4.08 (mirage/mirage-platform#206 by @anmonteiro)
* `libxenasmrun.a` is symlinked in the ocaml directory in order to be able to use ocamlopt's `-runtime-variant` option.
* Expose flags through files as well as pkg-config (mirage/mirage-platform#205 by @TheLortex).  Instead of pkg-config, one can use the following files to get compilation flags:
  * mirage-xen-ocaml/libs
  * mirage-xen-ocaml/cflags
  * mirage-xen-posix/minios-cflags
  * mirage-xen-posix/minios-libs
  * mirage-xen-posix/posix-cflags
  * mirage-xen-posix/posix-libs
  With dune this allows us to write `%{lib:mirage-xen-posix:posix-libs}` to get the flags instead of having a script invoking `pkg-config mirage-xen-posix --libs`.
@camelus
Copy link
Contributor

camelus commented Feb 20, 2019

☀️ All lint checks passed 260293e
  • These packages passed lint tests: mirage-xen-ocaml.3.3.0, mirage-xen-posix.3.3.0

☀️ Installability check (10501 → 10503)
  • new installable packages (2): mirage-xen-ocaml.3.3.0 mirage-xen-posix.3.3.0

@mseri
Copy link
Member

mseri commented Feb 20, 2019

The failure with the system switch is expected?

@avsm
Copy link
Member Author

avsm commented Feb 20, 2019

Hm, no - will respin release

@avsm
Copy link
Member Author

avsm commented Feb 21, 2019

Hm, after some discussion with @TheLortex, I think we need to restrict this package to non-system installations. That won't disrupt existing users of mirage-platform, but will unblock the dune release of Mirage. @samoht @hannesm are you ok with this? The reason is that we need to symlink into the ocaml libdir in order to support -output-complete-obj for the mirage runtime variants, and you cant do that on a system switch.

@hannesm
Copy link
Member

hannesm commented Feb 21, 2019

@avsm is there at some point in the future an idea how to support system switches? or will the -output-complete-obj approach only ever work with non-system switches?

is a system switch detectable from within an opam file - and is it possible to print a message "you're using a system switch that is currently not supported"? (or inform the user "in order to use a system switch, you'll have to manually ln -s YYY /usr/local/lib/ocaml/runtime/ZZZ?)

I'm slightly concerned to introduce behaviour that only works on non-system opam switches, and would be in favour to figure out how system switches can be supported.

@TheLortex
Copy link
Contributor

It could be supported by patching OCaml so that the -runtime-variant option is more flexible: if we're able to provide a path to libasmrun.a then everything could work fine even on system switches.

@hannesm
Copy link
Member

hannesm commented Feb 21, 2019

IIUC, runtime-variant is located in the default search path (Asmlink.runtime_lib uses Load_path.find, which uses the path initialized by Compmisc.init_path, using Clflags.std_include_dir), which is Config.standard_library, and can be set by the environment variable OCAMLLIB. Maybe not doing a symlink, but instead setting this environment variable when compiling/linking is sufficient (sorry, haven't tested this, only tried to read the code in the OCaml compiler).

@TheLortex
Copy link
Contributor

It looks like OCAMLLIB allows only one single path, so that means we have to import the whole /usr/lib/ocaml/ content inside a directory that opam can write into (like .../ocaml-system/lib/ocaml).

@hannesm
Copy link
Member

hannesm commented Feb 21, 2019

@TheLortex true. a plan!?:

  • (a) figuring out in the opam file whether we're a system switch or not (and print a message which asks the user do the symlink manually) - once this is in place, we can merge this PR imho
  • (b) ask OCaml distribution whether we can have a more mature -runtime-variant option (likely in 4.09 then!?)

@hannesm
Copy link
Member

hannesm commented Feb 21, 2019

I suggest a conflict of mirage-platform=3.3.0 with ocaml-system would be feasible to move forward. WDYT?

@TheLortex
Copy link
Contributor

Wouldn't an ocaml-system conflict cause trouble with CI ?
I'll make a patch to print a warning message if it's not possible to do the symlink.

@hannesm
Copy link
Member

hannesm commented Feb 22, 2019

why should it cause trouble with CI? it will lead to not being installable if a system switch is used, which is the currently proposed support level (warning messages have the downside that people will ignore them). there is a variety of CI systems around, some use system switches, but most use opam switches, so they should be fine :)

@TheLortex
Copy link
Contributor

Okay that's fine with me !

since it symlinks into ocaml libdir to work with output-complete-obj
@avsm
Copy link
Member Author

avsm commented Feb 22, 2019

ive pushed the ocaml-system conflict

@kit-ty-kate
Copy link
Member

Thanks

@kit-ty-kate kit-ty-kate merged commit 34f81c0 into ocaml:master Feb 22, 2019
@hannesm
Copy link
Member

hannesm commented Feb 22, 2019

@avsm fine, the conflict should be synchronised at upstream

@hannesm
Copy link
Member

hannesm commented Mar 16, 2019

we discussed this a bit further in marrakesh, and it turns out we can use -I for including paths, and don't need any symlink. imho we should revise this 3.3.0 release to deal with that (and then remove the system compiler conflict, and remove the symlink). see also ocaml/ocaml#7926 ocaml/ocaml#2309

edit: see #13679 for same thing on freestanding.

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

Successfully merging this pull request may close these issues.

None yet

6 participants