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

Cross Compilation #355

Closed
wants to merge 48 commits into from
Closed

Cross Compilation #355

wants to merge 48 commits into from

Conversation

rgrinberg
Copy link
Member

rgrinberg and others added 24 commits November 14, 2017 23:52
Rather than doing hosts and targets in a particualr order, rely on a memoized
creation of the host super context.
Rather than relying on String.drop_prefix
Which is just the host if it's present and the super context itself otherwise
match the build/host/target terminology
Using a little trick using laziness
Make sure that Action.exec never runs a binary from the target context.
Fix install_prefix bootstrap.
@rgrinberg
Copy link
Member Author

rgrinberg commented Dec 9, 2017

I've resolved the conflicts with master.

@diml I guess there's no immediate to clean up the git history now, since we still need to implement your proposal. We can do that cleanup at the end.

@toots
Copy link
Contributor

toots commented Dec 19, 2017

@rgrinberg has the command-line syntax changed besides removing --install-prefix ? I'm getting this:

[sexplib-windows: jbuilder-windows build] Command started
+ jbuilder-windows "build" "-p" "sexplib" "-j" "4" "-x" "windows" (CWD=/home/opam/.opam/4.04.0+32bit/build/sexplib-windows.v0.9.2)
- Error: exception Sys_error("Is a directory")
- Backtrace:
- Raised by primitive operation at file "pervasives.ml", line 384, characters 7-32
- Called from file "lexing.ml", line 86, characters 4-49
- Called from file "src/meta_lexer.ml", line 275, characters 25-57
- Called from file "src/meta_lexer.ml" (inlined), line 201, characters 4-34
- Called from file "src/meta.ml", line 75, characters 10-17
- Called from file "src/import.ml", line 469, characters 8-11
- Re-raised at file "src/import.ml", line 471, characters 30-37
- Called from file "src/findlib.ml", line 134, characters 33-64
- Called from file "src/context.ml", line 207, characters 12-63
- Called from file "src/future.ml", line 88, characters 40-45
- Called from file "src/future.ml", line 83, characters 65-70
- Called from file "src/future.ml", line 37, characters 9-12
- Re-raised at file "src/future.ml", line 17, characters 36-47
- Called from file "src/future.ml", line 40, characters 9-23
- Called from file "src/import.ml", line 469, characters 8-11
- Re-raised at file "src/import.ml", line 471, characters 30-37
- Called from file "src/future.ml", line 37, characters 9-12
- Re-raised at file "src/future.ml", line 17, characters 36-47
- Called from file "src/future.ml", line 40, characters 9-23
- Called from file "src/import.ml", line 469, characters 8-11
- Re-raised at file "src/import.ml", line 471, characters 30-37
- Called from file "src/future.ml", line 37, characters 9-12
- Re-raised at file "src/future.ml", line 17, characters 36-47
- Called from file "src/future.ml", line 40, characters 9-23
- Called from file "src/import.ml", line 469, characters 8-11
- Re-raised at file "src/import.ml", line 471, characters 30-37
- Called from file "src/future.ml", line 703, characters 6-29
- Called from file "vendor/cmdliner/src/cmdliner_term.ml", line 27, characters 19-24
- Called from file "vendor/cmdliner/src/cmdliner.ml", line 106, characters 32-39
- Called from file "vendor/cmdliner/src/cmdliner.ml", line 136, characters 18-36
- Called from file "vendor/cmdliner/src/cmdliner.ml", line 251, characters 22-48
- Called from file "bin/main.ml", line 1089, characters 10-51
[ERROR] The compilation of sexplib-windows failed at "jbuilder-windows build -p sexplib -j 4 -x windows".

@ghost
Copy link

ghost commented Dec 19, 2017

Ah, my mistake, I pushed a fix

@toots
Copy link
Contributor

toots commented Dec 19, 2017

Thanks! Got a new problem now..

[sexplib-windows: jbuilder-windows build] Command started
+ jbuilder-windows "build" "-p" "sexplib" "-j" "4" "-x" "windows" (CWD=/home/opam/.opam/4.04.0+32bit/build/sexplib-windows.v0.9.2)
- Multiple rules generated for num/lib/.merlin
[ERROR] The compilation of sexplib-windows failed at "jbuilder-windows build -p sexplib -j 4 -x windows".

#=== ERROR while installing sexplib-windows.v0.9.2 ============================#
# opam-version 1.2.2
# os           linux
# command      jbuilder-windows build -p sexplib -j 4 -x windows
# path         /home/opam/.opam/4.04.0+32bit/build/sexplib-windows.v0.9.2
# compiler     4.04.0+32bit
# exit-code    1
# env-file     /home/opam/.opam/4.04.0+32bit/build/sexplib-windows.v0.9.2/sexplib-windows-22-8c0dd3.env
# stdout-file  /home/opam/.opam/4.04.0+32bit/build/sexplib-windows.v0.9.2/sexplib-windows-22-8c0dd3.out
# stderr-file  /home/opam/.opam/4.04.0+32bit/build/sexplib-windows.v0.9.2/sexplib-windows-22-8c0dd3.err
### stderr ###
# Multiple rules generated for num/lib/.merlin

Not sure what this is about. Let me know if you need steps to reproduce.

@ghost
Copy link

ghost commented Dec 19, 2017

I haven't managed to install mingw-w64 on my box, so it's hard to try. I need to add some fake cross-compilation test

@toots
Copy link
Contributor

toots commented Dec 19, 2017

@diml We have a docker-based test suite that you should be able to tap in for quick testing. I've pushed the branch with the changes here: ocaml-cross/opam-cross-windows#56

@ghost
Copy link

ghost commented Dec 19, 2017

Ah! Thanks, but I don't have docker either at work :(

I'll try with tests, it's good to have tests anyway

@ghost
Copy link

ghost commented Dec 19, 2017

Ok, I added a test and fixed some problems. The PR should be in a better state now.

@toots
Copy link
Contributor

toots commented Dec 19, 2017

Yeah it's looking good from here as well. Thanks!

@toots
Copy link
Contributor

toots commented Dec 19, 2017

Actually, I've got another issue now here when compiling ocaml-migrate-parsetree-windows:

### stderr ###
# Warning 58: no cmx file was found in path for module Config, and its interface was not compiled with -opaque
# [...]
#     ocamlopt src/gen/gen.exe [default.windows]
# Error: exception Invalid_argument("index out of bounds")
# Backtrace:
# Raised by primitive operation at file "src/path.ml", line 192, characters 29-39
# Called from file "src/action.ml", line 543, characters 13-62
# Called from file "src/action.ml", line 550, characters 5-54
# Called from file "src/build_system.ml", line 518, characters 6-82
# Called from file "src/future.ml", line 83, characters 65-70
# Called from file "src/future.ml", line 37, characters 9-12

@ghost
Copy link

ghost commented Dec 21, 2017

Superseeded by #380

@ghost ghost closed this Dec 21, 2017
@ghost ghost deleted the x branch February 7, 2018 14:48
This pull request was closed.
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.

4 participants