GNU bug report logs - #46806
[PATCH] gnu: ocaml-4.07: Bootstrap.

Previous Next

Package: guix-patches;

Reported by: Julien Lepiller <julien <at> lepiller.eu>

Date: Fri, 26 Feb 2021 23:15:01 UTC

Severity: normal

Tags: patch

Done: Julien Lepiller <julien <at> lepiller.eu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 46806 in the body.
You can then email your comments to 46806 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#46806; Package guix-patches. (Fri, 26 Feb 2021 23:15:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julien Lepiller <julien <at> lepiller.eu>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 26 Feb 2021 23:15:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: ocaml-4.07: Bootstrap.
Date: Sat, 27 Feb 2021 00:13:39 +0100
[Message part 1 (text/plain, inline)]
Hi Guix!

This small series adds camlboot, a project to reimplement a bootstrap
for OCaml, which lets us remove the pre-built boot/ocaml{c,lex} :)

The first patch builds the bootstraped ocamlc and ocamllex. This takes
around 4 hours to build. The second patch rebuilds them using the source
code for ocaml 4.07.1, instead of the modified sources used in
camlboot, and reuse them to run the main Makefile (make world.opt).

As a result, we have identical files for this bootstrap and the
unbootstrapped OCaml (up to output store paths and hash of some files
that get embedded in native files, which differ because of the
different output path).
[0001-gnu-Add-camlboot.patch (text/x-patch, attachment)]
[0002-gnu-ocaml-4.07-Bootstrap.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#46806; Package guix-patches. (Sun, 28 Feb 2021 02:10:02 GMT) Full text and rfc822 format available.

Message #8 received at 46806 <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: 46806 <at> debbugs.gnu.org
Subject: Re: [bug#46806] [PATCH] gnu: ocaml-4.07: Bootstrap.
Date: Sun, 28 Feb 2021 03:09:05 +0100
Le Sat, 27 Feb 2021 00:13:39 +0100,
Julien Lepiller <julien <at> lepiller.eu> a écrit :

> Hi Guix!
> 
> This small series adds camlboot, a project to reimplement a bootstrap
> for OCaml, which lets us remove the pre-built boot/ocaml{c,lex} :)
> 
> The first patch builds the bootstraped ocamlc and ocamllex. This takes
> around 4 hours to build. The second patch rebuilds them using the
> source code for ocaml 4.07.1, instead of the modified sources used in
> camlboot, and reuse them to run the main Makefile (make world.opt).
> 
> As a result, we have identical files for this bootstrap and the
> unbootstrapped OCaml (up to output store paths and hash of some files
> that get embedded in native files, which differ because of the
> different output path).

Here's the second version of the series: the first patch is unchanged,
the second patch is slightly better: the bootstrap ocaml 4.07 now run
"make alldepends" to generate all the .depend files, and installs them
to its output at share/depends. Then, ocaml-4.07 simply copies the
bootstrap data from this package (ocamlc, ocamllex, ocamlrun and all
the .depends) that were deleted from the archive, since they were
pre-generated. I feel much better about this patch than the previous
one. Thoughts?




Information forwarded to guix-patches <at> gnu.org:
bug#46806; Package guix-patches. (Sun, 28 Feb 2021 02:30:02 GMT) Full text and rfc822 format available.

Message #11 received at 46806 <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: 46806 <at> debbugs.gnu.org
Subject: Re: [bug#46806] [PATCH] gnu: ocaml-4.07: Bootstrap.
Date: Sun, 28 Feb 2021 03:29:33 +0100
[Message part 1 (text/plain, inline)]
Of course I forgot to attach the patches ^^'
[0001-gnu-Add-camlboot.patch (text/x-patch, attachment)]
[0002-gnu-ocaml-4.07-Bootstrap.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#46806; Package guix-patches. (Sun, 28 Feb 2021 09:20:01 GMT) Full text and rfc822 format available.

Message #14 received at 46806 <at> debbugs.gnu.org (full text, mbox):

From: pukkamustard <pukkamustard <at> posteo.net>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 46806 <at> debbugs.gnu.org
Subject: Re: [bug#46806] [PATCH] gnu: ocaml-4.07: Bootstrap.
Date: Sun, 28 Feb 2021 10:19:09 +0100
Fantastic! Thank you and thanks to the camlboot project! I will 
try and
build this tonight.

Julien Lepiller <julien <at> lepiller.eu> writes:

> Hi Guix!
>
> This small series adds camlboot, a project to reimplement a 
> bootstrap
> for OCaml, which lets us remove the pre-built boot/ocaml{c,lex} 
> :)
>
> The first patch builds the bootstraped ocamlc and ocamllex. This 
> takes
> around 4 hours to build. The second patch rebuilds them using 
> the source
> code for ocaml 4.07.1, instead of the modified sources used in
> camlboot, and reuse them to run the main Makefile (make 
> world.opt).
>
> As a result, we have identical files for this bootstrap and the
> unbootstrapped OCaml (up to output store paths and hash of some 
> files
> that get embedded in native files, which differ because of the
> different output path).





Information forwarded to guix-patches <at> gnu.org:
bug#46806; Package guix-patches. (Sun, 28 Feb 2021 10:58:01 GMT) Full text and rfc822 format available.

Message #17 received at 46806 <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: pukkamustard <pukkamustard <at> posteo.net>
Cc: 46806 <at> debbugs.gnu.org
Subject: Re: [bug#46806] [PATCH] gnu: ocaml-4.07: Bootstrap.
Date: Sun, 28 Feb 2021 05:57:10 -0500
[Message part 1 (text/plain, inline)]
Would be fantastic if you could report build time for camlboot too :). The result should be almost identical to our current ocaml-4.07, though there are some due to different output directory being embedded.

Le 28 février 2021 04:19:09 GMT-05:00, pukkamustard <pukkamustard <at> posteo.net> a écrit :
>
>Fantastic! Thank you and thanks to the camlboot project! I will 
>try and
>build this tonight.
>
>Julien Lepiller <julien <at> lepiller.eu> writes:
>
>> Hi Guix!
>>
>> This small series adds camlboot, a project to reimplement a 
>> bootstrap
>> for OCaml, which lets us remove the pre-built boot/ocaml{c,lex} 
>> :)
>>
>> The first patch builds the bootstraped ocamlc and ocamllex. This 
>> takes
>> around 4 hours to build. The second patch rebuilds them using 
>> the source
>> code for ocaml 4.07.1, instead of the modified sources used in
>> camlboot, and reuse them to run the main Makefile (make 
>> world.opt).
>>
>> As a result, we have identical files for this bootstrap and the
>> unbootstrapped OCaml (up to output store paths and hash of some 
>> files
>> that get embedded in native files, which differ because of the
>> different output path).
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#46806; Package guix-patches. (Mon, 01 Mar 2021 09:17:01 GMT) Full text and rfc822 format available.

Message #20 received at 46806 <at> debbugs.gnu.org (full text, mbox):

From: pukkamustard <pukkamustard <at> posteo.net>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 46806 <at> debbugs.gnu.org
Subject: Re: [bug#46806] [PATCH] gnu: ocaml-4.07: Bootstrap.
Date: Mon, 01 Mar 2021 10:16:14 +0100
I managed to build camlboot and ocaml <at> 4.07 with your patches.

> Would be fantastic if you could report build time for camlboot 
> too :).

Build time (on a quad-core i7 laptop):

```
$ time ./pre-inst-env guix build camlboot --no-offload
.
.
.
successfully built 
/gnu/store/ddi5n28hsrgvb89r8vjs0rfvapxfbaj2-camlboot-0.0.0-0.506280c.drv
/gnu/store/79bqayhrc6qfr2k7pfk7fn6lim0f8cfx-camlboot-0.0.0-0.506280c

real	322m35.119s
user	0m1.523s
sys	0m0.140s
```

ocaml <at> 4.07 with your patches applied:

```
$ time ./pre-inst-env guix build ocaml <at> 4.07 --no-offload
successfully built 
/gnu/store/sdxybpxzjhib5ijn3fx3r29ycp5vvafd-ocaml-4.07.1.drv
/gnu/store/cniid9xi3dck7kdpfm77h56h1s0701fm-ocaml-4.07.1

real	17m52.923s
user	0m9.268s
sys	0m1.013s
```

ocaml <at> 4.07 at master:

```
$ time ./pre-inst-env guix build ocaml <at> 4.07 --no-offload --check
successfully built 
/gnu/store/v599h0bhpyh2rq4nrnqqf56lwbsf0f71-ocaml-4.07.1.drv
successfully built 
/gnu/store/v599h0bhpyh2rq4nrnqqf56lwbsf0f71-ocaml-4.07.1.drv
/gnu/store/s7j0vl88zakkdcyvw1jw8cypfzi6ljnd-ocaml-4.07.1

real	21m44.000s
user	0m14.546s
sys	0m1.217s
```

> The result should be almost identical to our current ocaml-4.07, 
> though there are some due to different output directory being 
> embedded.

Checked some random files in both ocaml's with diffoscope and can 
confirm that differences seem to be mostly different output 
directories.

Haven't run diffoscope on everything as that would take quite some 
time...

-pukkamustard


>>
>>Fantastic! Thank you and thanks to the camlboot project! I will
>>try and
>>build this tonight.
>>
>>Julien Lepiller <julien <at> lepiller.eu> writes:
>>
>>> Hi Guix!
>>>
>>> This small series adds camlboot, a project to reimplement a
>>> bootstrap
>>> for OCaml, which lets us remove the pre-built 
>>> boot/ocaml{c,lex}
>>> :)
>>>
>>> The first patch builds the bootstraped ocamlc and ocamllex. 
>>> This
>>> takes
>>> around 4 hours to build. The second patch rebuilds them using
>>> the source
>>> code for ocaml 4.07.1, instead of the modified sources used in
>>> camlboot, and reuse them to run the main Makefile (make
>>> world.opt).
>>>
>>> As a result, we have identical files for this bootstrap and 
>>> the
>>> unbootstrapped OCaml (up to output store paths and hash of 
>>> some
>>> files
>>> that get embedded in native files, which differ because of the
>>> different output path).





Information forwarded to guix-patches <at> gnu.org:
bug#46806; Package guix-patches. (Mon, 01 Mar 2021 11:46:01 GMT) Full text and rfc822 format available.

Message #23 received at 46806 <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: pukkamustard <pukkamustard <at> posteo.net>
Cc: 46806 <at> debbugs.gnu.org
Subject: Re: [bug#46806] [PATCH] gnu: ocaml-4.07: Bootstrap.
Date: Mon, 01 Mar 2021 06:44:32 -0500
[Message part 1 (text/plain, inline)]
Thanks! OK to push?

Le 1 mars 2021 04:16:14 GMT-05:00, pukkamustard <pukkamustard <at> posteo.net> a écrit :
>
>I managed to build camlboot and ocaml <at> 4.07 with your patches.
>
>> Would be fantastic if you could report build time for camlboot 
>> too :).
>
>Build time (on a quad-core i7 laptop):
>
>```
>$ time ./pre-inst-env guix build camlboot --no-offload
>.
>.
>.
>successfully built 
>/gnu/store/ddi5n28hsrgvb89r8vjs0rfvapxfbaj2-camlboot-0.0.0-0.506280c.drv
>/gnu/store/79bqayhrc6qfr2k7pfk7fn6lim0f8cfx-camlboot-0.0.0-0.506280c
>
>real	322m35.119s
>user	0m1.523s
>sys	0m0.140s
>```
>
>ocaml <at> 4.07 with your patches applied:
>
>```
>$ time ./pre-inst-env guix build ocaml <at> 4.07 --no-offload
>successfully built 
>/gnu/store/sdxybpxzjhib5ijn3fx3r29ycp5vvafd-ocaml-4.07.1.drv
>/gnu/store/cniid9xi3dck7kdpfm77h56h1s0701fm-ocaml-4.07.1
>
>real	17m52.923s
>user	0m9.268s
>sys	0m1.013s
>```
>
>ocaml <at> 4.07 at master:
>
>```
>$ time ./pre-inst-env guix build ocaml <at> 4.07 --no-offload --check
>successfully built 
>/gnu/store/v599h0bhpyh2rq4nrnqqf56lwbsf0f71-ocaml-4.07.1.drv
>successfully built 
>/gnu/store/v599h0bhpyh2rq4nrnqqf56lwbsf0f71-ocaml-4.07.1.drv
>/gnu/store/s7j0vl88zakkdcyvw1jw8cypfzi6ljnd-ocaml-4.07.1
>
>real	21m44.000s
>user	0m14.546s
>sys	0m1.217s
>```
>
>> The result should be almost identical to our current ocaml-4.07, 
>> though there are some due to different output directory being 
>> embedded.
>
>Checked some random files in both ocaml's with diffoscope and can 
>confirm that differences seem to be mostly different output 
>directories.
>
>Haven't run diffoscope on everything as that would take quite some 
>time...
>
>-pukkamustard
>
>
>>>
>>>Fantastic! Thank you and thanks to the camlboot project! I will
>>>try and
>>>build this tonight.
>>>
>>>Julien Lepiller <julien <at> lepiller.eu> writes:
>>>
>>>> Hi Guix!
>>>>
>>>> This small series adds camlboot, a project to reimplement a
>>>> bootstrap
>>>> for OCaml, which lets us remove the pre-built 
>>>> boot/ocaml{c,lex}
>>>> :)
>>>>
>>>> The first patch builds the bootstraped ocamlc and ocamllex. 
>>>> This
>>>> takes
>>>> around 4 hours to build. The second patch rebuilds them using
>>>> the source
>>>> code for ocaml 4.07.1, instead of the modified sources used in
>>>> camlboot, and reuse them to run the main Makefile (make
>>>> world.opt).
>>>>
>>>> As a result, we have identical files for this bootstrap and 
>>>> the
>>>> unbootstrapped OCaml (up to output store paths and hash of 
>>>> some
>>>> files
>>>> that get embedded in native files, which differ because of the
>>>> different output path).
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#46806; Package guix-patches. (Mon, 01 Mar 2021 12:05:01 GMT) Full text and rfc822 format available.

Message #26 received at 46806 <at> debbugs.gnu.org (full text, mbox):

From: pukkamustard <pukkamustard <at> posteo.net>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 46806 <at> debbugs.gnu.org
Subject: Re: [bug#46806] [PATCH] gnu: ocaml-4.07: Bootstrap.
Date: Mon, 01 Mar 2021 13:04:11 +0100
> Thanks! OK to push?

Ok for me!

> Le 1 mars 2021 04:16:14 GMT-05:00, pukkamustard 
> <pukkamustard <at> posteo.net> a écrit :
>>
>>I managed to build camlboot and ocaml <at> 4.07 with your patches.
>>
>>> Would be fantastic if you could report build time for camlboot
>>> too :).
>>
>>Build time (on a quad-core i7 laptop):
>>
>>```
>>$ time ./pre-inst-env guix build camlboot --no-offload
>>.
>>.
>>.
>>successfully built
>>/gnu/store/ddi5n28hsrgvb89r8vjs0rfvapxfbaj2-camlboot-0.0.0-0.506280c.drv
>>/gnu/store/79bqayhrc6qfr2k7pfk7fn6lim0f8cfx-camlboot-0.0.0-0.506280c
>>
>>real	322m35.119s
>>user	0m1.523s
>>sys	0m0.140s
>>```
>>
>>ocaml <at> 4.07 with your patches applied:
>>
>>```
>>$ time ./pre-inst-env guix build ocaml <at> 4.07 --no-offload
>>successfully built
>>/gnu/store/sdxybpxzjhib5ijn3fx3r29ycp5vvafd-ocaml-4.07.1.drv
>>/gnu/store/cniid9xi3dck7kdpfm77h56h1s0701fm-ocaml-4.07.1
>>
>>real	17m52.923s
>>user	0m9.268s
>>sys	0m1.013s
>>```
>>
>>ocaml <at> 4.07 at master:
>>
>>```
>>$ time ./pre-inst-env guix build ocaml <at> 4.07 --no-offload --check
>>successfully built
>>/gnu/store/v599h0bhpyh2rq4nrnqqf56lwbsf0f71-ocaml-4.07.1.drv
>>successfully built
>>/gnu/store/v599h0bhpyh2rq4nrnqqf56lwbsf0f71-ocaml-4.07.1.drv
>>/gnu/store/s7j0vl88zakkdcyvw1jw8cypfzi6ljnd-ocaml-4.07.1
>>
>>real	21m44.000s
>>user	0m14.546s
>>sys	0m1.217s
>>```
>>
>>> The result should be almost identical to our current 
>>> ocaml-4.07,
>>> though there are some due to different output directory being
>>> embedded.
>>
>>Checked some random files in both ocaml's with diffoscope and 
>>can
>>confirm that differences seem to be mostly different output
>>directories.
>>
>>Haven't run diffoscope on everything as that would take quite 
>>some
>>time...
>>
>>-pukkamustard
>>
>>
>>>>
>>>>Fantastic! Thank you and thanks to the camlboot project! I 
>>>>will
>>>>try and
>>>>build this tonight.
>>>>
>>>>Julien Lepiller <julien <at> lepiller.eu> writes:
>>>>
>>>>> Hi Guix!
>>>>>
>>>>> This small series adds camlboot, a project to reimplement a
>>>>> bootstrap
>>>>> for OCaml, which lets us remove the pre-built
>>>>> boot/ocaml{c,lex}
>>>>> :)
>>>>>
>>>>> The first patch builds the bootstraped ocamlc and ocamllex.
>>>>> This
>>>>> takes
>>>>> around 4 hours to build. The second patch rebuilds them 
>>>>> using
>>>>> the source
>>>>> code for ocaml 4.07.1, instead of the modified sources used 
>>>>> in
>>>>> camlboot, and reuse them to run the main Makefile (make
>>>>> world.opt).
>>>>>
>>>>> As a result, we have identical files for this bootstrap and
>>>>> the
>>>>> unbootstrapped OCaml (up to output store paths and hash of
>>>>> some
>>>>> files
>>>>> that get embedded in native files, which differ because of 
>>>>> the
>>>>> different output path).





Information forwarded to guix-patches <at> gnu.org:
bug#46806; Package guix-patches. (Wed, 03 Mar 2021 00:33:02 GMT) Full text and rfc822 format available.

Message #29 received at 46806 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 46806 <at> debbugs.gnu.org
Subject: Re: [bug#46806] [PATCH] gnu: ocaml-4.07: Bootstrap.
Date: Wed, 03 Mar 2021 01:22:20 +0100
[Message part 1 (text/plain, inline)]
Hi Julien,

On Sun, 28 Feb 2021 at 03:29, Julien Lepiller <julien <at> lepiller.eu> wrote:
> Of course I forgot to attach the patches ^^'

Awesome!


> +(define-public camlboot
> +  (let ((commit "506280c6e0813e0e794988151a8e46be55373ebc")
> +        (revision "0"))
> +    (package
> +      (name "camlboot")
> +      (version (git-version "0.0.0" revision commit))
> +      (source (origin
> +                (method git-fetch)
> +                (uri (git-reference
> +                       (url "https://github.com/Ekdohibs/camlboot")
> +                       (commit commit)
> +                       (recursive? #t)))

Is the indentation right?  Below with my config (which could be wrong).

[...]

> +      (synopsis "OCaml bootstrap")

I have no opinion but elsewhere it also appears «Bootstrap XXX».

> +      (description "OCaml is written in OCaml. Its sources contain a pre-compiled
> +bytecode version of ocamlc and ocamllex that are used to build the
> next version

Maybe @code{ocamlc} and @code{ocamlex}

> +of the compiler. Camlboot implements a bootstrap for the OCaml
> compiler and

Missing double space after compiler.  Camlboot…


> +provides a bootstrapped equivalent to these files.
> +
> +It contains a compiler for a small subset of OCaml written in Guile Scheme,
> +an interpreter for OCaml written in that subset and a manually-written lexer
> +for OCaml.  These elements eliminate the need for the binary bootstrap in
> +OCaml and can effectively bootstrap OCaml 4.07.
> +
> +This package produces a native ocamlc and a bytecode ocamllex.")

Maybe again @code.


LGTM!

Thanks again!
Cheers,
simon


[indentation.diff (text/x-diff, inline)]
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index f2185aeb4e..b8b2f684df 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -115,9 +115,9 @@
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
-                       (url "https://github.com/Ekdohibs/camlboot")
-                       (commit commit)
-                       (recursive? #t)))
+                      (url "https://github.com/Ekdohibs/camlboot")
+                      (commit commit)
+                      (recursive? #t)))
                 (file-name (git-file-name name version))
                 (sha256
                  (base32
@@ -132,13 +132,13 @@
                     (delete-file "ocaml-src/boot/ocamllex")
                     ;; Ensure writable
                     (for-each
-                      (lambda (file)
-                        (chmod file (logior (stat:mode (stat file)) #o200)))
-                      (find-files "." "."))))))
+                     (lambda (file)
+                       (chmod file (logior (stat:mode (stat file)) #o200)))
+                     (find-files "." "."))))))
       (build-system gnu-build-system)
       (arguments
-       `(#:make-flags (list "_boot/ocamlc"); build target
-         #:tests? #f; no tests
+       `(#:make-flags (list "_boot/ocamlc") ; build target
+         #:tests? #f                        ; no tests
          #:phases
          (modify-phases %standard-phases
            (delete 'configure)

Information forwarded to guix-patches <at> gnu.org:
bug#46806; Package guix-patches. (Wed, 03 Mar 2021 13:31:02 GMT) Full text and rfc822 format available.

Message #32 received at 46806 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 46806 <at> debbugs.gnu.org
Subject: Re: [bug#46806] [PATCH] gnu: ocaml-4.07: Bootstrap.
Date: Wed, 03 Mar 2021 13:54:39 +0100
Hi Julien,


>>From ed2c4c1c221eb60ddc9e47b58c03d9194c6a2beb Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien <at> lepiller.eu>
> Date: Sat, 27 Feb 2021 00:07:30 +0100
> Subject: [PATCH 2/2] gnu: ocaml-4.07: Bootstrap.
>
> * gnu/packages/ocaml.scm (ocaml-4.07): Implement bootstrap via camlboot.
> ---

[...]

> -(define-public ocaml-4.07
> +;; This package is a bootstrap package for ocaml-4.07. It builds from camlboot,
> +;; using the upstream sources for ocaml 4.07. It installs a bytecode ocamllex
> +;; and ocamlc, the bytecode interpreter ocamlrun, and generated .depend files
> +;; that we otherwise remove for bootstrap purposes.
> +(define ocaml-4.07-boot
>    (package
>      (inherit ocaml-4.09)
>      (version "4.07.1")
> @@ -267,11 +271,149 @@ functional, imperative and object-oriented styles of programming.")
>                      "/ocaml-" version ".tar.xz"))

[...]

> +             (for-each
> +               (lambda (file)

With my config (with could be wrong), it spots out an indentation issue here.

> +                 (copy-file file (string-append "boot/" (basename file))))
> +               (cons* "stdlib/stdlib.cma" "stdlib/std_exit.cmo" "stdlib/camlheader"
> +                      (find-files "stdlib" ".*.cmi$")))
> +             (symlink "../byterun/libcamlrun.a" "boot/libcamlrun.a")
> +             (make "parsing/parser.mli"); required for ocamldoc/stdlib_non_prefixed

It seems better to have extra space between the closing parenthesis and
the semi colon.

> +             ;; required for dependencies
> +             (make "-C" "tools"
> +                   "CAMLC=../boot/ocamlc -nostdlib -I ../boot -use-prims ../byterun/primitives -I .."
> +                   "make_opcodes" "cvt_emit")
> +             ;; generate all remaining .depend files
> +             (make "alldepend"
> +                   (string-append "ocamllex=" (getcwd) "/boot/ocamlrun "
> +                                  (getcwd) "/boot/ocamllex")
> +                   (string-append "CAMLDEP=" (getcwd) "/boot/ocamlc -depend")
> +                   (string-append "OCAMLDEP=" (getcwd) "/boot/ocamlc -depend")
> +                   (string-append "ocamldep=" (getcwd) "/boot/ocamlc -depend"))

Indentation issue?

> +             ;; Build ocamllex
> +             (make "CAMLC=boot/ocamlc -nostdlib -I boot -use-prims byterun/primitives"
> +                   "ocamlc")

Here too?

> +             ;; Build ocamlc
> +             (make "-C" "lex"
> +                   "CAMLC=../boot/ocamlc -strict-sequence -nostdlib -I ../boot -use-prims ../byterun/primitives"
> +                   "all")))
> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin (string-append out "/bin"))
> +                    (depends (string-append out "/share/depends")))
> +               (mkdir-p bin)
> +               (mkdir-p depends)
> +               (install-file "ocamlc" bin)
> +               (install-file "lex/ocamllex" bin)
> +               (for-each
> +                 (lambda (file)
> +                   (let ((dir (string-append depends "/" (dirname file))))
> +                     (mkdir-p dir)
> +                     (install-file file dir)))
> +                 (find-files "." "^\\.depend$"))))))))

Maybe here too?


Cheers,
simon




Information forwarded to guix-patches <at> gnu.org:
bug#46806; Package guix-patches. (Wed, 03 Mar 2021 13:31:02 GMT) Full text and rfc822 format available.

Message #35 received at 46806 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 46806 <at> debbugs.gnu.org
Subject: Re: [bug#46806] [PATCH] gnu: ocaml-4.07: Bootstrap.
Date: Wed, 03 Mar 2021 14:27:54 +0100
Hi Julien,

On Sat, 27 Feb 2021 at 00:13, Julien Lepiller <julien <at> lepiller.eu> wrote:

> The first patch builds the bootstraped ocamlc and ocamllex. This takes
> around 4 hours to build. The second patch rebuilds them using the source
> code for ocaml 4.07.1, instead of the modified sources used in
> camlboot, and reuse them to run the main Makefile (make world.opt).

On my machine, camlboot takes ~3h to build.  Then ocaml-4.07-boot takes
~30s.  Last there is no meaningful difference between building
ocaml-4.07 using the embedded ocamlc and ocamlex binaries and using the
binaries from ocaml-4.04-boot; both ~6m.

I have check that camlboot, ocaml-4.07-boot and ocaml-4.07 build
reproducibly with ’--check’.  They do.


> As a result, we have identical files for this bootstrap and the
> unbootstrapped OCaml (up to output store paths and hash of some files
> that get embedded in native files, which differ because of the
> different output path).

At first look, yes. :-)


Modulo the minor comments I made, patches LGTM!  Thanks.


Well, the next steps are to build ocaml-4.09 and ocaml-4.11 using the
previous ocamlc and ocamlex version, right?

Then, it implies rebuild all the OCaml packages, right?  It could be
done in this core-updates cycle, WDYT?

Cheers,
simon




Information forwarded to guix-patches <at> gnu.org:
bug#46806; Package guix-patches. (Wed, 03 Mar 2021 13:47:02 GMT) Full text and rfc822 format available.

Message #38 received at 46806 <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: zimoun <zimon.toutoune <at> gmail.com>
Cc: 46806 <at> debbugs.gnu.org
Subject: Re: [bug#46806] [PATCH] gnu: ocaml-4.07: Bootstrap.
Date: Wed, 03 Mar 2021 08:46:08 -0500
[Message part 1 (text/plain, inline)]
We'd have to check we actually can build them. The plan was to build menhir with this ocaml4.07, since it's required to generate the parser for ocaml >= 4.08, and improve camlboot to support more recent versions. We would prevent the need for a chain of bootstraps that way.

Anyway, I'll push that after fixing your comments, and we'll see what we can do for the following ocaml versions. Thanks for the review!

I don't think ocaml has so many dependants that it requires core-updates. Not even sure it needs staging.

Le 3 mars 2021 08:27:54 GMT-05:00, zimoun <zimon.toutoune <at> gmail.com> a écrit :
>Hi Julien,
>
>On Sat, 27 Feb 2021 at 00:13, Julien Lepiller <julien <at> lepiller.eu>
>wrote:
>
>> The first patch builds the bootstraped ocamlc and ocamllex. This
>takes
>> around 4 hours to build. The second patch rebuilds them using the
>source
>> code for ocaml 4.07.1, instead of the modified sources used in
>> camlboot, and reuse them to run the main Makefile (make world.opt).
>
>On my machine, camlboot takes ~3h to build.  Then ocaml-4.07-boot takes
>~30s.  Last there is no meaningful difference between building
>ocaml-4.07 using the embedded ocamlc and ocamlex binaries and using the
>binaries from ocaml-4.04-boot; both ~6m.
>
>I have check that camlboot, ocaml-4.07-boot and ocaml-4.07 build
>reproducibly with ’--check’.  They do.
>
>
>> As a result, we have identical files for this bootstrap and the
>> unbootstrapped OCaml (up to output store paths and hash of some files
>> that get embedded in native files, which differ because of the
>> different output path).
>
>At first look, yes. :-)
>
>
>Modulo the minor comments I made, patches LGTM!  Thanks.
>
>
>Well, the next steps are to build ocaml-4.09 and ocaml-4.11 using the
>previous ocamlc and ocamlex version, right?
>
>Then, it implies rebuild all the OCaml packages, right?  It could be
>done in this core-updates cycle, WDYT?
>
>Cheers,
>simon
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#46806; Package guix-patches. (Wed, 03 Mar 2021 14:06:02 GMT) Full text and rfc822 format available.

Message #41 received at 46806 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 46806 <at> debbugs.gnu.org
Subject: Re: [bug#46806] [PATCH] gnu: ocaml-4.07: Bootstrap.
Date: Wed, 3 Mar 2021 15:05:18 +0100
On Wed, 3 Mar 2021 at 14:46, Julien Lepiller <julien <at> lepiller.eu> wrote:
>
> We'd have to check we actually can build them. The plan was to build menhir with this ocaml4.07, since it's required to generate the parser for ocaml >= 4.08, and improve camlboot to support more recent versions. We would prevent the need for a chain of bootstraps that way.

Thanks for the explanations.
I have tried to replace gcc by clang for camlboot but it fails.
And also tried other Scheme than Guile, obviously fails. :-)


> I don't think ocaml has so many dependants that it requires core-updates. Not even sure it needs staging.

Oh right, I thought that more OCaml packages were in Guix. :-)

Cheers,
simon




Reply sent to Julien Lepiller <julien <at> lepiller.eu>:
You have taken responsibility. (Wed, 03 Mar 2021 16:15:03 GMT) Full text and rfc822 format available.

Notification sent to Julien Lepiller <julien <at> lepiller.eu>:
bug acknowledged by developer. (Wed, 03 Mar 2021 16:15:03 GMT) Full text and rfc822 format available.

Message #46 received at 46806-done <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: zimoun <zimon.toutoune <at> gmail.com>
Cc: 46806-done <at> debbugs.gnu.org
Subject: Re: [bug#46806] [PATCH] gnu: ocaml-4.07: Bootstrap.
Date: Wed, 3 Mar 2021 17:14:16 +0100
Le Wed, 3 Mar 2021 15:05:18 +0100,
zimoun <zimon.toutoune <at> gmail.com> a écrit :

> On Wed, 3 Mar 2021 at 14:46, Julien Lepiller <julien <at> lepiller.eu>
> wrote:
> >
> > We'd have to check we actually can build them. The plan was to
> > build menhir with this ocaml4.07, since it's required to generate
> > the parser for ocaml >= 4.08, and improve camlboot to support more
> > recent versions. We would prevent the need for a chain of
> > bootstraps that way.  
> 
> Thanks for the explanations.
> I have tried to replace gcc by clang for camlboot but it fails.
> And also tried other Scheme than Guile, obviously fails. :-)
> 
> 
> > I don't think ocaml has so many dependants that it requires
> > core-updates. Not even sure it needs staging.  
> 
> Oh right, I thought that more OCaml packages were in Guix. :-)
> 
> Cheers,
> simon

Pushed as 0bd58ae7ff0d5c3935b0d660819aca4a0493ef8a, thanks for the
review!

Yeah, we might need some work to support other schemes. There's no C in
camlboot, but we reuse some of OCaml's sources, for the bytecode
interpreter (camlrun) and parser generator (ocamlyacc). So that's a
problem with OCaml.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 01 Apr 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 24 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.