Skip to content

[new release] ancient (0.10.0) #27965

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Halbaroth
Copy link
Contributor

Use data structures larger than available memory

CHANGES:

Build

Features

CHANGES:

### Build
- Install the dynamic library (PR OCamlPro/ocaml-ancient#12)
- Build the library with Dune (PR OCamlPro/ocaml-ancient#13)
- Prevent installation of the opam package on Windows (PR OCamlPro/ocaml-ancient#13, OCamlPro/ocaml-ancient#15)
- Add ocaml-option-nnp as dependency (PR OCamlPro/ocaml-ancient#16)

### Features
- Support for OCaml 5 (PR OCamlPro/ocaml-ancient#7, OCamlPro/ocaml-ancient#10)
@Halbaroth
Copy link
Contributor Author

Halbaroth commented May 30, 2025

I want to ensure that ocaml-option-nnp is installed if the ancient is installed in a switch using OCaml 4. The ocaml-option-nnp package is only available for OCaml 4, while base-nnp is for OCaml 5. I know that no-naked-pointer is the default behavior in OCaml 5. How can I express this condition in the opam file?

@mseri mseri added the question label Jun 2, 2025
@Leonidas-from-XIV
Copy link
Contributor

@Halbaroth Maybe something like this?

depends: [
  (("ocaml" {< "5"} & "ocaml-option-nnp") | "ocaml" {>= "5"})
]

@Halbaroth
Copy link
Contributor Author

Thanks, it works :)

"-j"
jobs
"@install"
"@runtest" {with-test}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"@runtest" {with-test}
"@runtest" {with-test & arch != "arm32" & arch != "x86_32"}

Due to trying to deserialize a too large integer in tests (I think):

#=== ERROR while compiling ancient.0.10.0 =====================================#
# context              2.3.0 | linux/arm32 | ocaml-base-compiler.5.3.0 | pinned(https://github.com/OCamlPro/ocaml-ancient/releases/download/0.10.0/ancient-0.10.0.tbz)
# path                 ~/.opam/5.3/.opam-switch/build/ancient.0.10.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p ancient -j 79 @install @runtest
# exit-code            1
# env-file             ~/.opam/log/ancient-7-634cbb.env
# output-file          ~/.opam/log/ancient-7-634cbb.out
### output ###
# (cd _build/default/src && /usr/bin/gcc -O2 -fno-strict-aliasing -fwrapv -fPIC -pthread -D_FILE_OFFSET_BITS=64 -Wall -fdiagnostics-color=always -DHAVE_LIMITS_H -DHAVE_UNISTD_H -DHAVE_MMAP -g -I /home/opam/.opam/5.3/lib/ocaml -I /home/opam/.opam/5.3/lib/ocaml/unix -o mmtrace.o -c mmalloc/mmtrace.c)
# mmalloc/mmtrace.c: In function 'tr_mallochook':
# mmalloc/mmtrace.c:90:35: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
#    90 |   fprintf (mallstream, "+ %08lx %lx\n", (unsigned long) hdr, size);
#       |                                 ~~^                          ~~~~
#       |                                   |                          |
#       |                                   long unsigned int          size_t {aka unsigned int}
#       |                                 %x
# mmalloc/mmtrace.c: In function 'tr_reallochook':
# mmalloc/mmtrace.c:118:37: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
#   118 |     fprintf (mallstream, "! %08lx %lx\n", (unsigned long) ptr, size);
#       |                                   ~~^                          ~~~~
#       |                                     |                          |
#       |                                     long unsigned int          size_t {aka unsigned int}
#       |                                   %x
# mmalloc/mmtrace.c:120:46: warning: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
#   120 |     fprintf (mallstream, "< %08lx\n> %08lx %lx\n", (unsigned long) ptr,
#       |                                            ~~^
#       |                                              |
#       |                                              long unsigned int
#       |                                            %x
#   121 |              (unsigned long) hdr, size);
#       |                                   ~~~~        
#       |                                   |
#       |                                   size_t {aka unsigned int}
# mmalloc/mmtrace.c: At top level:
# mmalloc/mmtrace.c:99:1: warning: 'tr_reallochook' defined but not used [-Wunused-function]
#    99 | tr_reallochook (PTR md, PTR ptr, size_t size)
#       | ^~~~~~~~~~~~~~
# File "test/dune", lines 21-27, characters 0-176:
# 21 | (rule
# 22 |   (alias runtest)
# 23 |   (deps (:dict ./words))
# 24 |   (action
# 25 |     (progn
# 26 |       (run ./dict_write.exe %{dict} output 0x440000000000)
# 27 |       (run ./dict_verify.exe %{dict} output))))
# (cd _build/default/test && ./dict_write.exe words output 0x440000000000)
# Fatal error: exception Failure("Nativeint.of_string")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that all right or this is an indication of incompatibility with 32 bit systems or bytecode compilers? (I did not look at the code yet)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't plan to support 32 bit systems. We should put these indications on the package itself. If tests failed, there is no reason to support this architecture.

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.

3 participants