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 [Rewritten History] #380

Merged
merged 11 commits into from
Jan 1, 2018
Merged

Cross Compilation [Rewritten History] #380

merged 11 commits into from
Jan 1, 2018

Conversation

rgrinberg
Copy link
Member

@diml this is my half hearted at rewriting the history. The result is completely fictitious, especially wrt attribution, but at least it looks pretty and every commit builds. I think this beats 1 squashed commit by a large margin, but perhaps even keeping the dirty history makes sense?

@ghost
Copy link

ghost commented Dec 21, 2017

Thanks, I'm happy to use this history

@ghost ghost mentioned this pull request Dec 21, 2017
@ghost
Copy link

ghost commented Dec 21, 2017

@toots, can you try again with this branch?

@wokalski
Copy link

The docs only mention opam-cross-Windows and opam-cross-android. Is there a particular reason why opam-cross-ios is not supported ?

@rgrinberg
Copy link
Member Author

rgrinberg commented Dec 22, 2017 via email

@whitequark
Copy link
Member

The only issue with iOS I anticipate is the lack of dynlink, does jbuilder handle that correctly?

@rgrinberg
Copy link
Member Author

Jbuilder supports building libs without dynlink, and it either lets you disable dynlink for a package manually or it tries to discover if the compiler supports dynlink by checking if dynlink.cmxa exists in the switch. Will that check work for opam-cross-ios?

@whitequark
Copy link
Member

The latter should work!

@toots
Copy link
Contributor

toots commented Dec 30, 2017

Any idea if this error could be caused by the changes in jbuilder? The PR is only updating jbuilder and it built fine before..

#=== ERROR while installing pcre-windows.7.3.4 ================================#
# opam-version         1.2.2
# os                   linux
# command              env PKG_CONFIG_PATH=/usr/src/mxe/usr/x86_64-w64-mingw32.static/lib/pkgconfig jbuilder-windows build -p pcre -j 4 -x windows
# path                 /home/opam/.opam/4.04.0/build/pcre-windows.7.3.4
# compiler             4.04.0
# exit-code            1
# env-file             /home/opam/.opam/4.04.0/build/pcre-windows.7.3.4/pcre-windows-8-6a72f2.env
# stdout-file          /home/opam/.opam/4.04.0/build/pcre-windows.7.3.4/pcre-windows-8-6a72f2.out
# stderr-file          /home/opam/.opam/4.04.0/build/pcre-windows.7.3.4/pcre-windows-8-6a72f2.err
### stderr ###
# /usr/src/mxe/usr/x86_64-w64-mingw32.static/include/string.h:89:9: error: declaration for parameter 'strncpy' but no such parameter
# [...]
# /usr/src/mxe/usr/x86_64-w64-mingw32.static/include/string.h:84:9: error: declaration for parameter 'strlwr_l' but no such parameter
#    char *strlwr_l(char *_String,_locale_t _Locale) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
#          ^
# pcre_stubs.c:862:1: error: expected '{' at end of input
#  { return Val_bool(pcre_config_int(PCRE_CONFIG_STACKRECURSE)); }
#  ^
# pcre_stubs.c:862:1: warning: control reaches end of non-void function [-Wreturn-type]
#  { return Val_bool(pcre_config_int(PCRE_CONFIG_STACKRECURSE)); }
#  ^

@rgrinberg
Copy link
Member Author

I don't think so. Here's the only the difference:

diff --git a/src/findlib.ml b/src/findlib.ml
index 2a287c9..ca84456 100644
--- a/src/findlib.ml
+++ b/src/findlib.ml
@@ -55,6 +55,7 @@ module Rule = struct
     Preds.is_subset preds ~subset:t.preds_required &&
     not (Preds.intersects preds t.preds_forbidden)
 
+
   let make (rule : Meta.rule) =
     let preds_required, preds_forbidden =
       List.partition_map rule.predicates ~f:(function
diff --git a/src/import.ml b/src/import.ml
index 135575a..0308ad3 100644
--- a/src/import.ml
+++ b/src/import.ml
@@ -78,11 +78,6 @@ module List = struct
       max acc (String.length (f x)))
 
   let longest l = longest_map l ~f:(fun x -> x)
-
-  let assoc_opt e l =
-    match List.assoc e l with
-    | e -> Some e
-    | exception Not_found -> None
 end
 
 module Hashtbl = struct
diff --git a/src/sexp.ml b/src/sexp.ml
index f63e9f6..53bc05d 100644
--- a/src/sexp.ml
+++ b/src/sexp.ml
@@ -450,7 +450,7 @@ module Of_sexp = struct
       | Record x -> x.name
   end
   module C = Constructor_spec
-  
+
   let cstr_loc name args make =
     C.Tuple { name; args; make; rest = No_rest }
   let cstr_rest_loc name args rest make =
diff --git a/src/sexp.mli b/src/sexp.mli
index e820b53..4c2401b 100644
--- a/src/sexp.mli
+++ b/src/sexp.mli
@@ -99,8 +99,8 @@ module Of_sexp : sig
     -> ('a -> 'b, 'c) Constructor_args_spec.t
 
   val cstr : string -> ('a, 'b) Constructor_args_spec.t -> 'a -> 'b Constructor_spec.t
-  val cstr_rest :
-    string
+  val cstr_rest
+    :  string
     -> ('a, 'b list -> 'c) Constructor_args_spec.t
     -> 'b t
     -> 'a

You can try the old branch and see if there's a difference.

rgrinberg and others added 6 commits January 1, 2018 21:48
Necessary to read toolchains
Determines the .install depending on the toolchain for x compilation
To control installation prefix
Jeremie Dimino and others added 5 commits January 1, 2018 22:34
* Create targets from findlib toolchains by reading findlib configs
* Define targets inside workspace files
* Set cross compilation targets with -x argument
In a host/target setup, all binaries that are built (including preprocessors)
are ran using the host *for* building targets. Final target artifacts are
compiled using the target toolchain
Describes how to setup targets and toolchains and the changes to the workspace
syntax.
@rgrinberg
Copy link
Member Author

I merged the branch because it's really unlikely this is caused by any of the changes above. We can address the problem in a later PR if it's really a fault introduced here.

@ghost
Copy link

ghost commented Jan 22, 2018

The docs only mention opam-cross-Windows and opam-cross-android. Is there a particular reason why opam-cross-ios is not supported ?

@wokalski, no reason. I just didn't see the opam-cross-ios repository. I listed the repositories explicitly to be clear about what jbuilder was expected to work with. I see that these have now moved to a new organization so I'll update the doc.

@wokalski
Copy link

@diml I'm already using jbuilder with opam-cross-ios. That said landing #23 would be helpful to improve it. Is it just the matter of rebasing those changes?

@ghost
Copy link

ghost commented Jan 22, 2018

I'm not sure, @bobot, do you remember the status of #23?

@ghost
Copy link

ghost commented Jan 22, 2018

I updated the doc BTW: #434

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.

5 participants