Commit Graph

20045 Commits (f52fdc2068204da5d78678b02ee0ac2444b6f8c1)

Author SHA1 Message Date
Sébastien Briais f52fdc2068
Define to_rev_seq in Set and Map module (#9075) 2020-05-15 17:38:45 +02:00
Xavier Leroy 914dd057b5
win32unix: quote the arguments to the Unix.exec* functions (#9550)
Otherwise, arguments get split at spaces.
This is the same quoting that the Win32 implementation of
Unix.create_process does.

A test was added.

Fixes: 9320
2020-05-14 18:15:10 +02:00
Florian Angeletti 1a8a4dfd85
Merge pull request #9552 from Octachron/forgotten_ocamloptp
Restore ocamloptp
2020-05-14 16:10:05 +02:00
octachron 0963b0c6b6 Restore ocamloptp 2020-05-14 10:11:42 +02:00
Gabriel Scherer b3434751e2
Merge pull request #9520 from trefis/rematch-make_matching-cleanup
pattern-matching refactoring: refactor the `make_<foo>_matching` functions
2020-05-14 09:21:07 +02:00
Nicolás Ojeda Bär 153eee9678
Merge pull request #9554 from nojb/__SCOPE__
Add primitive __FUNCTION__ that returns the name of current scope
2020-05-14 00:01:07 +02:00
Nicolás Ojeda Bär ea835ee45e Changes 2020-05-13 20:57:21 +02:00
Nicolás Ojeda Bär f3e6d27e30 Add test 2020-05-13 20:57:21 +02:00
Nicolás Ojeda Bär 4a44bf1767 Expose %loc_FUNCTION as __FUNCTION__ 2020-05-13 20:57:21 +02:00
Nicolás Ojeda Bär 6e3f710d78 Bootstrap 2020-05-13 20:57:18 +02:00
Nicolás Ojeda Bär 4e33dcf35f Add %loc_FUNCTION primitive 2020-05-13 20:49:01 +02:00
Xavier Leroy c17f6c2956
Protect against bad rounding of mtime / atime / ctime stats (#9505)
Some file systems maintain time stamps with sub-second resolution, up
to nanosecond resolution.  When converting from a "(seconds, nanoseconds)"
timestamp to a floating-point timestamp, rounding to nearest can produce
"seconds + 1" as a result, i.e. the integer part of the FP timestamp
is not equal to "seconds".  As described in #9490, this is a problem
in some cases.

This commit implements a more careful conversion of "(seconds,
nanoseconds)" pairs to FP timestamps so that the integer part of the
FP result is always "seconds".

Both the otherlibs/unix and the otherlibs/win32unix implementations are affected
and corrected.

Closes: #9490
2020-05-13 18:43:46 +02:00
David Allsopp b6c8b35e2d
Make -flarge-toc the default for PowerPC (#9557)
Introduce -fsmall-toc in order to access the previous behaviour and
document both options in the manual and ocamlopt manpage.
2020-05-13 18:23:37 +02:00
Gabriel Scherer 065139617f matching: factorize the make_*_matching functions
Before, each head construction had a `make_<foo>_matching` construct that
was responsible for three things:
- consuming the argument from the argument list
  (the "argument" is a piece of lambda code to access
   the value of the current scrutinee)
- building arguments for the subpatterns of the scrutinee
  and pushing them to the argument list
- building a `cell` structure out of this, representing a head group
  during compilation

Only the second point is really specific to each construction.

This refactoring turns this second point into a construct-specific
`get_expr_args_<foo>` function (similarly to `get_pat_args_<foo>`),
and moves the first and third point to a generic `make_matching`
function.

Note: this commit contains a minor improvement to the location used to
force (lazy ..) arguments.
2020-05-13 17:18:08 +02:00
Xavier Leroy 3a408ff3e8
Modernize signal handling on Linux i386, PowerPC64, and s390x (#9543)
OCaml's signal handlers need to know the state of the processor when the signal was received. The approach standardized by the Single Unix specification is to use 3-argument signal handing functions and the SA_SIGINFO flag to sigaction. However, as the Linux man page for sigaction says,

Undocumented:
Before the introduction of SA_SIGINFO, it was also possible to get some
additional information, namely by using a sa_handler with a second
argument of type struct sigcontext. See the relevant Linux kernel
sources for details. This use is obsolete now.

For historical reasons, the i386, PowerPC and s390x Linux ports of OCaml still use the undocumented, obsolete approach, while the other Linux ports use the modern SA_SIGINFO approach. 

For consistency and future-proofing, this PR updates the i386, PowerPC64, and s390x Linux ports to use the modern approach to signal handling.  PowerPC32 was left as before because of technical subtleties and lack of hardware to test changes.

The new code for PowerPC 64 bits includes the trick proposed in PR#1795 to support Musl in addition to Glibc on ppc64le.
2020-05-13 11:15:13 +02:00
Gabriel Scherer f81e2b6a59
testsuite: remove a slow exhaustiveness check (#9555)
The test takes 14s to run every time we run the checksuite, and it
does not seem to serve an easily identifiable purpose. In theory
similar tests could help detect a performance regression in
exhaustiveness checking, but this test seems to only degrade in
constant factor (#9152 proposed to use ocamlc.opt instead of ocamlc to
run it, but it was declined as "hiding" potential problems, which
suggests constant-factor differences). We do not monitor the testsuite
for 10s timing difference, so it is unlikely that we would notice
a constant-factor difference during automated testing.
2020-05-13 10:52:56 +02:00
Christophe Troestler c920ea142b
Fix comment about NaN propagation (#9536)
Fix documentation comment about NaN propagation

Closes: #7891

Co-authored-by: David Allsopp <david.allsopp@metastack.com>
2020-05-12 15:35:04 +02:00
Florian Angeletti c86a5d8d11
#9189: avoid one-letter make variables (#9281) 2020-05-11 12:21:59 +02:00
Xavier Leroy 37c5bd87a9 Run the "stale" script 3 times a week 2020-05-09 10:42:01 +02:00
Gabriel Scherer f7ec223df9 add a known-bug test for buggy 'rec' (non)use in the #show command 2020-05-09 08:43:23 +02:00
Xavier Leroy 4ac06a874a
Merge pull request #9522 from gasche/compare-infix-function
compare: correctly compare a Closure_tag with an Infix_tag
2020-05-07 14:42:41 +02:00
Gabriel Scherer fc35f8baa0 compare: move Forward/Infix tests outside the hot path 2020-05-06 22:29:01 +02:00
Gabriel Scherer 3a43b84e8a compare: correctly compare a Closure_tag with an Infix_tag 2020-05-06 22:29:01 +02:00
Gabriel Scherer 20e1d6e478 fix 'dune build @libs' after #9257 2020-05-06 21:37:08 +02:00
David Allsopp f5006025d6
Merge pull request #9527 from gasche/clean-without-deps
Clean without deps: reworking CAN_BE_UNCONFIGURED
2020-05-06 16:29:42 +01:00
Gabriel Scherer ffbea08d02 Changes entry 2020-05-06 12:10:02 +02:00
Gabriel Scherer fd789b5cec [minor] stdlib/Makefile: remove redundant clean action
There is already a more precise

    clean::
            rm -f $(CAMLHEADERS)

rule above.

(Change suggested by David Allsopp.)
2020-05-06 12:10:02 +02:00
Gabriel Scherer 67f6128ebd [minor] Makefile: move ARCH_SPECIFIC back to the main Makefile
(This is a small, independent readability fix.)

ARCH_SPECIFIC was moved into Makefile.compilerlibs by mistake; it is
not used in Makefile.compilerlibs (in particular the
ARCH_SPECIFIC_ASMCOMP_* variables do not depend on it), and it is used
in the main Makefile.
2020-05-06 12:10:02 +02:00
Gabriel Scherer 11c9d92732 ocamltest/Makefile: do not depend on UNIX_OR_WIN32 for 'clean'
Change suggested by David Allsopp.
2020-05-06 12:10:02 +02:00
Gabriel Scherer 3489e002c6 refactor Makefile.config_if_required for easier reuse of variables 2020-05-06 12:10:02 +02:00
Gabriel Scherer e34e62253f move the REQUIRES_CONFIGURATION logic in Makefile.config_if_required
This lets us share the logic between Makefile.common and Makefile.tools.
2020-05-06 12:10:02 +02:00
Gabriel Scherer 8d716a1712 Makefile: no need for REQUIRES_CONFIGURATION check on config.status
Now that Makefile.build_config is only included when configuration is
required, we can remove the REQUIRES_CONFIGURATION logic here.
2020-05-06 12:10:02 +02:00
Gabriel Scherer 21f5ad3b4a build system: skip Makefile.build_config when REQUIRES_CONFIGURATION is empty
Before we would include it if present, but support building without
it. Unless I misunderstand something, this is unnecessarily complex:

- If we want to support building without it, we may as well
  do without it all the time (in particular it makes it easier
  to spot bugs which occurs when it is missing).

- Certain makefile rules (see config.status) work by being added
  as dependencies to Makefile.build_config, and requiring this file
  only when actually needed makes it possible to simplify those.
  (simplifications not included in this commit)

I reviewed all 'clean' rules to check that they do not depend on
variables defined in the configure. On the other hand, the main
makefiles do a lot of conditional tests on those variables,
so --warn-undefined-variables warns quite a bit. (This could be solved
by a Makefile.no_config rule that mirrors Makefile.config with dummy
definitions.)
2020-05-06 12:10:02 +02:00
Gabriel Scherer 472a20d735 [minor] rename CAN_BE_UNCONFIGURED into REQUIRES_CONFIGURATION 2020-05-06 12:10:02 +02:00
Gabriel Scherer fab58a938a makefiles: move the inclusion of Makefile.build_config in Makefile.common 2020-05-06 12:10:02 +02:00
Xavier Leroy f2587c1fb1
Merge pull request #9529 from dra27/macos-gnu-make
Further C dependency fixes
2020-05-06 09:53:45 +02:00
Xavier Leroy 29d5f485d8 Jenkins CI job to test the Dune-based build 2020-05-05 19:21:42 +02:00
Xavier Leroy 9414e5af09
Add a "stale" Github action to process inactive issues (#9530)
As discussed among the core OCaml developers.

This commit adds a Github action that "pings" issues that have been inactive for one year and schedules them for closing 30 days later if no action has been taken.
2020-05-05 18:36:10 +02:00
octachron 273f2f8c7d Changes: move 9228 to 4.11.0 section 2020-05-05 15:12:42 +02:00
David Allsopp d4009ac4e3 Move 9437 to 4.10 2020-05-05 10:13:23 +01:00
David Allsopp 21654fcbf2 Move Changes entry for 9531 to 4.10 2020-05-04 14:28:48 +01:00
Hannes Mehnert 3f7e56c40d
configure: support bfd on FreeBSD (#9531)
On FreeBSD, libbfd is - similarly to OpenBSD - not installed by default, but
can be added via the devel/libbfd port. This will install libbfd into the
/usr/local prefix, thus configure needs to look there for include and library
2020-05-04 14:26:32 +01:00
Xavier Leroy 1c7d5f4ab4 check-typo attributes for .github directory
Expect no headers, long lines, and very long lines.
2020-05-04 15:25:45 +02:00
Florian Angeletti 24806a0223
Merge pull request #9228 from yallop/map-documentation
Fix some issues in the Map documentation
2020-05-04 09:49:53 +02:00
David Allsopp 312ec987b6 Update Changes 2020-05-03 17:07:17 +01:00
David Allsopp 942105f49e Remove unneeded $(otherfiles) in runtime/Makefile
No longer required, and in fact causing breakages now that -MG isn't used.
2020-05-03 16:07:07 +01:00
David Allsopp c948b8d051 Don't use -MG
It's a subtly broken thing to do, as discovered on the ARM workers on
Inria's CI.
2020-05-03 16:03:46 +01:00
David Allsopp 617522ec95 Restore compatibility with GNU make 3.81
It's the macOS default installed version still. The dependency generation
inadvertently relies on behaviour introduced in GNU make 3.82 a decade ago.

The fix in otherlibs/systhreads/Makefile also corrects missing
NATIVE_CPPFLAGS when generating st_stubs.n.d, so st_stubs.n.o now
correctly depends on caml/stacks.h instead of caml/stack.h
2020-05-03 16:00:28 +01:00
David Allsopp b3af8ca2a9 Tighten dependencies for C files
The $(wildcard *.h) should only be there with
--disable-dependency-generation, since otherwise gcc -MM will be
determining exactly which header files should be checked.
2020-05-03 15:27:14 +01:00
David Allsopp e3dffa8a7f Silence CI warning for undefined variable 2020-05-03 15:26:53 +01:00