Conversation
|
xref MPR 7014. |
|
Just to clarify: the proposed change does what one would expect, that is install the bytecode tool as Naive question: Is it safe to use
so we cannot assume that this has been tested before. |
|
Yes, the bytecode tool is now The idea is that running I got rid of the use of |
|
If there is no reason to use the bytecode version, why do we install them at all? |
|
I have at least two use cases for installing bytecode.
I don't really see the small overhead incurred by installing the bytecode versions to be a problem, and would suggest erring on the side of caution in any case. |
This suggest that we rather want to be able to |
|
I have changed the makefile so that all of the installed tools that are built in the Should I squash the commits? The history is 16 commits long and some of them involve trivial typos. |
84d4386 to
a34b668
Compare
|
@damiendoligez any thoughts? |
tools/Makefile.shared
Outdated
| include ../config/Makefile | ||
| CAMLRUN ?= ../boot/ocamlrun | ||
| CAMLYACC ?= ../boot/ocamlyacc | ||
| ifndef CAMLRUN |
There was a problem hiding this comment.
$$$$ looks a bit scary. Could you maybe add a comment on what the subtle code below is doing and why it is necessary?
8258420 to
b53be9e
Compare
tools/primreq.ml
Outdated
| let scan_obj filename = | ||
| let ic = open_in_bin filename in | ||
| let buffer = String.create (String.length cmo_magic_number) in | ||
| let buffer = Bytes.create (String.length cmo_magic_number) in |
There was a problem hiding this comment.
You should replace this and the following really_input by a single call to really_input_string, which allows to avoid the unsafe coercions below. If you do that and rebase the changes to this file in a single commit at the bottom of your commit stack (close to master), I'll push it to master now.
There was a problem hiding this comment.
Can you explain how to do this? This is really hard in git.
There was a problem hiding this comment.
@drbo There are some good tutorials online about git rebase --interactive. The high level explanation is that since your branch and the branch you want to merge into have both evolved independently, there'll be conflicts and the merge is guaranteed to be messy. By doing a rebase, git reapplies each of the commits in your branch on top of the branch to merge into, so you get to deal with conflicts one at a time and even do some cleanup like merging some of your commits together. Then once that's done you can open a Pull Request and it's easier to review and the merge is clean and painless. I can help you with this if you have Skype or Hangouts.
There was a problem hiding this comment.
So here git rebase --interactive master is the command to start from (after you have pushed a last patch implementing the change in this file that you want to merge with the current diff). Feel free to accept @SGrondin's offer for additional explanations, otherwise just add a patch and I can rebase it on my side.
c8eff40 to
5f9c9c8
Compare
|
Testsuite failure is same as trunk. |
|
I pushed the |
4c472aa to
48b4451
Compare
Makefile
Outdated
| INSTALL_MANDIR=$(DESTDIR)$(MANDIR) | ||
| override shellquote = ""'''$(subst ','\'',$1)'#)' | ||
|
|
||
| INSTALL_BINDIR:=$(call shellquote,$(DESTDIR)$(BINDIR)) |
There was a problem hiding this comment.
Why do we need to shellquote these variables and not directly DESTDIR, BINDIR, etc?
Why should it be done in the Makefile rather than the configure script?
Address review comments and clean up quoting Fix inconsistent makefile quoting and testsuite bustage Fix includes of makefiles Fix configure bug make travis rerun Trying to debug travis issue Try to fix configure on Travis Add config.mk which I had previously forgotten to commit. Fix silly makefile bug Fix bug causing STUBLIBDIR to be empty Fix makefile quoting bugs Fix MSVC build break
52a1eed to
a778e49
Compare
| } | ||
| }' | ||
|
|
||
| configure_options="$(awk -- "$awk_script" "$@" </dev/null)" || exit 1 |
There was a problem hiding this comment.
Looks like you're trying to quote the arguments, but:
- Your script doesn't work (try an argument with a quote on a system with gawk 4.1.1).
- We don't want to depend on
awk. - It's pointless anyway because
configure_optionsis only used for debugging output (modulo your addition of themake configuretarget, a lot of complexity for little benefit IMO).
FWIW, here's my own implementation of a quoting function, without awk (using sed, which we already depend on):
quote1(){ printf "'%s'" "`printf %s "$1" | sed -e "s/'/'\\\\\\\\''/g"`"; }
quote(){
while : ; do
case $# in 0) break;; esac
quote1 "$1"
shift
case $# in 0) ;; *) printf " ";; esac
done
}
usage: quote1 "$1" or quote "$@"
|
There are too many changes in this PR that are not related to installing the native tools. You need to concentrate on the task at hand and leave other changes for other PRs. |
|
Can anyone help me figure out quoting on the Windows port? |
|
@damiendoligez would it be okay if I closed this PR and opened a new one with only the relevant changes included? |
Previously, `ocamlc`, `ocamlopt`, `ocamllex`, and `ocamldep` defaulted to the bytecode versions of the tools. However, there is normally no advantage to the bytecode versions if the native-code versions are available, except in unusual circumstances. Instead, install the native-code versions without the `.opt` suffix. They are still installed with the `.opt` suffix for backwards compatibility. Finally, install the bytecode versions with the `.byte` suffix, and build native-code versions of tools that are not currently built in native code. Also, remove some duplication in tools/Makefile.shared. Supersedes GPR ocaml#512.
|
Superseded by #587. |
Previously, `ocamlc`, `ocamlopt`, `ocamllex`, and `ocamldep` defaulted to the bytecode versions of the tools. However, there is normally no advantage to the bytecode versions if the native-code versions are available, except in unusual circumstances. Instead, install the native-code versions without the `.opt` suffix. They are still installed with the `.opt` suffix for backwards compatibility. Finally, install the bytecode versions with the `.byte` suffix, and build native-code versions of tools that are not currently built in native code. Also, remove some duplication in tools/Makefile.shared. Supersedes GPR ocaml#512.
|
I realise this answer comes too late for this PR but for the next ones
I think it may have been better to just cleanup the branch, I don't
think it really makes sense to close the PR itself.
|
Previously, `ocamlc`, `ocamlopt`, `ocamllex`, and `ocamldep` defaulted to the bytecode versions of the tools. However, there is normally no advantage to the bytecode versions if the native-code versions are available, except in unusual circumstances. Instead, install the native-code versions without the `.opt` suffix. They are still installed with the `.opt` suffix for backwards compatibility. Finally, install the bytecode versions with the `.byte` suffix, and build native-code versions of tools that are not currently built in native code. Also, remove some duplication in tools/Makefile.shared. Supersedes GPR ocaml#512.
Previously, `ocamlc`, `ocamlopt`, `ocamllex`, and `ocamldep` defaulted to the bytecode versions of the tools. However, there is normally no advantage to the bytecode versions if the native-code versions are available, except in unusual circumstances. Instead, install the native-code versions without the `.opt` suffix. They are still installed with the `.opt` suffix for backwards compatibility. Finally, install the bytecode versions with the `.byte` suffix, and build native-code versions of tools that are not currently built in native code. Also, remove some duplication in tools/Makefile.shared. Supersedes GPR ocaml#512.
Previously, `ocamlc`, `ocamlopt`, `ocamllex`, and `ocamldep` defaulted to the bytecode versions of the tools. However, there is normally no advantage to the bytecode versions if the native-code versions are available, except in unusual circumstances. Instead, install the native-code versions without the `.opt` suffix. They are still installed with the `.opt` suffix for backwards compatibility. Finally, install the bytecode versions with the `.byte` suffix, and build native-code versions of tools that are not currently built in native code. Also, remove some duplication in tools/Makefile.shared. Supersedes GPR ocaml#512.
Currently the "obvious" choice for the OCaml tools are ocamllex,
ocamlc, and ocamlopt. However, there is no good reason to use them
when ocamllex.opt, ocamlc.opt, and ocamlopt.opt are available.
Therefore, install the native-code versions with no suffixes when
they are present. The bytecode versions are now available with
the
.bytesuffix.