Giter VIP home page Giter VIP logo

Comments (5)

toots avatar toots commented on June 12, 2024

+1 on this one. I can provide a patch if we agree on it.

from opam-cross-windows.

whitequark avatar whitequark commented on June 12, 2024

@toots Can you please investigate the root cause? It's related to the Sys.os_type primitive; we might need to patch the codegen to fix that.

from opam-cross-windows.

pirbo avatar pirbo commented on June 12, 2024

Indeed:
wine ~/.opam/4.04.0/windows-sysroot/bin/ocamlopt.exe -config answers correctly
[...] os_type: Win32 [...]
but
~/.opam/4.04.0/.opam/for_nightly/bin/ocamlrun ~/.opam/4.04.0/windows-sysroot/bin/ocamlopt.exe -config i.e. ~/.opam/4.04.0/windows-sysroot/bin/ocamlopt -config answers
os_type: Unix

This is because Sys.os_type comes from Sys.get_config which is an external and that's made on purpose to make (normal) byte code executable cross-platform!

The ugliest possible hack would be to do (for the all cross compiler) in stdlib/sys.mlp

- let (os_type, _, _) = get_config()
+ let (os_type, _, _) = "Win32"

but that's looks super dirty.

from opam-cross-windows.

toots avatar toots commented on June 12, 2024

I remember having to do that with the Debian cross-compiler patches back in the days. Rather than patching, it looks like the perfect candidate for integration upstream. Now, how should cross-compilation be properly marked and detected by the compiler?

from opam-cross-windows.

whitequark avatar whitequark commented on June 12, 2024

ifneq ($(TARGET),$(HOST)) in Makefiles

from opam-cross-windows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.