Conversation
36189dd to
a2046d8
Compare
ad279c4 to
8deaf61
Compare
|
Note when you are working on a draft PR and trying to get the test suite to pass, it is better to work on a separate branch (after activating Appveyor on your fork), otherwise you are consuming CI time that could be used for non-draft PRs. Also cc @shindere that might be interested by this PR making the build system works with path containing spaces. |
|
Thanks, @Octachron.
Will review next week. On vacation at the moment.
|
Have link how to enable it ? I was only able to set as new project but it didn't loaded the yml file so I have to fill the gui dashboard. Edit: ok I found it I will create another branch to test without triggering this CI. |
2a9b761 to
0d0a5ae
Compare
|
Ok squashed my commit --fixup and rebased on trunk. Trunk head is broken for windows but it succeeded before so it should keep passing. |
|
(closed/re-opened to force GitHub to redo the merge commit and pull in the fix for AppVeyor) |
|
Many thanks for your work, @Et7f3. I find it both brave and cool Regarding your first commit, I have another, configure-based fix that I couldn't review the rest of your PR now but will try to do so starting Did you also try |
|
I haven't tried I came after failure of ocamlmklib wrt to bad quoting of arguments. This isn't addressed. OCaml was builded in sane path and used in path with space. So this PR only address build system. I wonder If I should rewrite to use utils and then it will fix automatically or other solution are preferable. |
|
Et7f3 (2021/11/09 04:47 -0800):
Usable no: ocamlmklib still need fix.
You may want to describe clearly what works and what does not andperhaps
create some checkboxes so that the work gets easier to track and to make
it clearer when this is really ready to be examined for being merged.
I wonder If I should rewrite to use utils ?
I don't understand the question, I'm sorry.
the compiler is gcc/clang I suspect that setting a compiler with a
space will cause failure also but can be addressed in other PR.
Perhaps you could open issues to keep track of where spaces are not
supported _and_ you think it would be important they are supported?
If you do so, I think it would be helpful to give the number of the
issues you created here.
Thanks!
|
|
I have updated my message on GitHub with better explanation. ocamlmklib don't quote args: Line 299 in edf0075
I see the ocamlmklib call the linker and the linker |
|
I ignored the four failings tests and tried Lines 60 to 62 in edf0075 Here we want to check that all cmi we try to install are absent ? Why not test existence/emptiness of the folder ? |
|
Et7f3 (2021/11/09 06:41 -0800):
I have updated my message on GitHub with better explanation.
Thanks.
ocamlmklib don't quote args:
https://github.com/ocaml/ocaml/blob/edf0075888ec27a50c4f50f76dba46f730797651/tools/ocamlmklib.ml#L299
Do you intend to fix it here? Otherwise I'd say it'd be good to report
it as an issue on its own.
> I don't understand the question, I'm sorry.
I see the ocamlmklib call the linker and the linker `Config.mkdll` and the linker is also called in utils/ccomp.ml
So I was asking if ocamlmklib should instead of directly call the
linker reuse the code in ccomp.ml
Why not. Especially if that would also fix the arg quoting issue!
|
|
Et7f3 (2021/11/09 06:45 -0800):
I ignored the four failings tests and tried `make install`
I choke on this line: https://github.com/ocaml/ocaml/blob/edf0075888ec27a50c4f50f76dba46f730797651/stdlib/Makefile#L60-L62
Here we want to check that all cmi we try to install are absent ? Why
not test existence/emptiness of the folder ?
Yeah, looks reasnoable to me. Another option would be to get rid of that
test completely since I don't know whether it's actually still usefull
or not.
|
I think I will only fix the build system in this PR so fix |
0d0a5ae to
3602209
Compare
|
Ok workaround found so |
pwd: /Users/Et7f3/projects/space with ocaml/ocamltest pwd/..: /Users/Et7f3/projects/space with ocaml/ocamltest/.. abspath: /Users/Et7f3/projects/space /Users/Et7f3/projects/space with ocaml/ocamltest/with /Users/Et7f3/projects/space with ocaml/ocamltest/ocaml+ With this path make produce same ouput in directory with space and without space.
Summary: 646 tests passed 29 tests skipped 1655 tests failed 775 tests not started (parent test skipped or failed) 11 unexpected errors 3116 tests considered
for file in $(grep -rl 'sh ${test_source_directory}' .); do sed -i '' -e 's|sh ${test_source_directory}|sh '"'"'${test_source_directory}'"'|" "$file"; done
^^^^^ Sorry for this and this^^^^^
for file in $(grep -rl '\-I \?${' .); do sed -i '' -e 's|-I\( *\)${\([^}]*\)}|-I\1'"'"'${\2}'"'|g" "$file"; done
^^^^^ and ^^^
And fix others places manually.
Summary:
653 tests passed
32 tests skipped
1659 tests failed
766 tests not started (parent test skipped or failed)
6 unexpected errors
3116 tests considered
Summary:
657 tests passed
32 tests skipped
1660 tests failed
764 tests not started (parent test skipped or failed)
2 unexpected errors
3115 tests considered
make one TEST=tests/tool-debugger/find-artifacts/'debuggee.ml' before exited without error. This can be replaced with the following commit. To be decided on review.
Summary:
657 tests passed
32 tests skipped
1661 tests failed
769 tests not started (parent test skipped or failed)
0 unexpected errors
3119 tests considered
Summary:
1636 tests passed
32 tests skipped
991 tests failed
460 tests not started (parent test skipped or failed)
0 unexpected errors
3119 tests considered
Summary:
2838 tests passed
37 tests skipped
59 tests failed
185 tests not started (parent test skipped or failed)
0 unexpected errors
3119 tests considered
Summary:
2961 tests passed
37 tests skipped
8 tests failed
113 tests not started (parent test skipped or failed)
0 unexpected errors
3119 tests considered
List of failed tests:
tests/typing-misc/'typecore_empty_polyvariant_error.ml' with 1.1.1 (toplevel)
tests/parsing/'broken_invariants.ml' with 1.1.1 (toplevel)
tests/ppx-contexts/'test.ml' with 1.1.1 (ocamlc.byte)
Summary:
2973 tests passed
37 tests skipped
3 tests failed
106 tests not started (parent test skipped or failed)
0 unexpected errors
3119 tests considered
3d25274 to
de1c552
Compare
|
I rebased (I needed a buildable branch). This PR don't cause regression with test added on trunk. For the last three tests I have a dirty patch for unix but since quoting is shell dependent it don't work on cmd. Dirty hackThis patch is also dirty because it use " around ppx path so if ppx is located in space with $ or ` it can have unexpected side effect. I tried with strong quote but they all cancel. I suspect String.word to be responsible.From 94f57affd438c21c9d587ff75f8138b18e92b2b7 Mon Sep 17 00:00:00 2001
From: Et7f3 <cadeaudeelie@gmail.com>
Date: Fri, 12 Nov 2021 22:55:57 +0100
Subject: [PATCH] fix(tests): Dirty hack to have all tests green.
---
ocamltest/tsl_lexer.mll | 2 ++
testsuite/tests/parsing/broken_invariants.ml | 2 +-
testsuite/tests/ppx-contexts/test.ml | 4 ++--
.../tests/typing-misc/typecore_empty_polyvariant_error.ml | 2 +-
4 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/ocamltest/tsl_lexer.mll b/ocamltest/tsl_lexer.mll
index 3a7f91748..d9d3c397c 100644
--- a/ocamltest/tsl_lexer.mll
+++ b/ocamltest/tsl_lexer.mll
@@ -90,6 +90,8 @@ and string acc = parse
string (acc ^ space) lexbuf }
| '\\'
{string (acc ^ "\\") lexbuf}
+ | '\\' '"'
+ {string (acc ^ "\"") lexbuf}
| '"'
{acc}
and comment = parse
diff --git a/testsuite/tests/parsing/broken_invariants.ml b/testsuite/tests/parsing/broken_invariants.ml
index 29e09a191..74774a463 100644
--- a/testsuite/tests/parsing/broken_invariants.ml
+++ b/testsuite/tests/parsing/broken_invariants.ml
@@ -6,7 +6,7 @@
program="ppx.exe"
*** toplevel
all_modules="broken_invariants.ml"
- flags="-ppx '${ocamlrun} ${test_build_directory_prefix}/ocamlc.byte/ppx.exe'"
+ flags="-ppx '\"${ocamlrun}\" \"${test_build_directory_prefix}/ocamlc.byte/ppx.exe\"'"
*)
let empty_tuple = [%tuple];;
diff --git a/testsuite/tests/ppx-contexts/test.ml b/testsuite/tests/ppx-contexts/test.ml
index 75d942fdc..b642118a3 100644
--- a/testsuite/tests/ppx-contexts/test.ml
+++ b/testsuite/tests/ppx-contexts/test.ml
@@ -14,13 +14,13 @@ flags = "-thread \
-principal \
-alias-deps \
-unboxed-types \
- -ppx ${program}"
+ -ppx '\"${program}\"'"
**** ocamlc.byte
module = "test.ml"
flags = "-g \
-no-alias-deps \
-no-unboxed-types \
- -ppx ${program}"
+ -ppx '\"${program}\"'"
***** check-ocamlc.byte-output
*)
diff --git a/testsuite/tests/typing-misc/typecore_empty_polyvariant_error.ml b/testsuite/tests/typing-misc/typecore_empty_polyvariant_error.ml
index 9b4624d3e..6a03fbcfe 100644
--- a/testsuite/tests/typing-misc/typecore_empty_polyvariant_error.ml
+++ b/testsuite/tests/typing-misc/typecore_empty_polyvariant_error.ml
@@ -6,7 +6,7 @@
program="ppx.exe"
*** toplevel
all_modules="${test_file}"
- flags="-ppx '${ocamlrun} ${test_build_directory_prefix}/ocamlc.byte/ppx.exe'"
+ flags="-ppx '\"${ocamlrun}\" \"${test_build_directory_prefix}/ocamlc.byte/ppx.exe\"'"
*)
type t = [%empty_polyvar];;
--
2.30.1 (Apple Git-130)For the original issue it should be enough. |
| echo ' rm '"'"'$(INSTALL_LIBDIR)'"'"'/stdlib__[a-z]*.cm*'; \ | ||
| echo 'and re-run make install'; \ |
There was a problem hiding this comment.
This command might delete more file that necessary on Cygwin because we don't add shopt command.
Also instead of re-run make install I could have printed the original command If makefile weren't recursive: https://stackoverflow.com/a/38754878/7227940
One more point for "Recursive Make Considered Harmful". Do you want I help to de-recursify Makefile ?
|
Et7f3 (2021/11/09 11:39 -0800):
Ok workaround found so `make install` successfully install all pieces.
But the generated ocaml doesn't seem to have the workaround shebang.
Should I bootstrap ?
Not yet, I think. That will be discussed once we reach a state were
there is agreement to merge the PR.
|
|
Et7f3 (2021/11/12 16:15 -0800):
@Et7f3 commented on this pull request.
> + echo ' rm '"'"'$(INSTALL_LIBDIR)'"'"'/stdlib__[a-z]*.cm*'; \
+ echo 'and re-run make install'; \
This command might delete more file that necessary on Cygwin because we don't add `shopt` command.
Also instead of `re-run make install` I could have printed the original command If makefile weren't recursive: https://stackoverflow.com/a/38754878/7227940
One more point for "Recursive Make Considered Harmful". Do you want I
help to de-recursify Makefile ?
Yes I do agree that recursive makefiles are harmful and do wnat them to
go away but it's a big task and other stuff must be done before so
please let's this one be in peace for the moment, but many thanks for
your interest in the compiler's build system.
|
Ok I will come back after 5.1 |
|
most conflict are fix that were upstreamed independently so it is easy to chose which one we need to keep. many runtime-errors come from this commit 24bed4c. Almost all test pass like before. I have a dirty hack for the last one. |
|
Either is fine, although personally I prefer rebasing, please. |
|
I also prefer a rebase and yes, I like @gasche's suggestion to split
this in several smaller, easier to review bits, if possible.
|
Hello,
This is my hacktoberfest contribution. In a downstream project someone tried to compile with a space in his path (his username) and he reported to us. This PR intend to only fix the build system. So now we can build OCaml in path with space. The generated compiler are still broken (shebang, missing quoting, ...). We can also launch the test suite (-3 tests) in folder with space.
I did three iterations:
third iteration:
To reviewer: can you compare these two commits: 6c0c5c4
3dce845
and say which one I keep ? both ?
Edit: I redid a review and saw I forgotten file like testsuite/tests/asmgen/immediates.cmmpp I don't know if I have missed other.