Skip to content
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

add ocaml-variants.5.1.1+flambda2 #25928

Closed
wants to merge 9 commits into from
8 changes: 8 additions & 0 deletions packages/base-flambda2/base-flambda2.base/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
opam-version: "2.0"
maintainer: "https://github.com/ocaml-flambda2/"
description: """
Flambda2-enhanced version of the OCaml compiler"
"""
depends: [
"ocaml-variants" {= "5.1.1+flambda2"}
]
60 changes: 60 additions & 0 deletions packages/dune-secondary/dune-secondary.3.8.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
opam-version: "2.0"
synopsis: "Fast, portable, and opinionated build system"
description: """

dune is a build system that was designed to simplify the release of
Jane Street packages. It reads metadata from "dune" files following a
very simple s-expression syntax.

dune is fast, has very low-overhead, and supports parallel builds on
all platforms. It has no system dependencies; all you need to build
dune or packages using dune is OCaml. You don't need make or bash
as long as the packages themselves don't use bash explicitly.

dune supports multi-package development by simply dropping multiple
repositories into the same directory.

It also supports multi-context builds, such as building against
several opam roots/switches simultaneously. This helps maintaining
packages across several versions of OCaml and gives cross-compilation
for free.
"""
maintainer: ["Jane Street Group, LLC <[email protected]>"]
authors: ["Jane Street Group, LLC <[email protected]>"]
license: "MIT"
homepage: "https://github.com/ocaml/dune"
doc: "https://dune.readthedocs.io/"
bug-reports: "https://github.com/ocaml/dune/issues"
conflicts: [
"merlin" {< "3.4.0"}
"ocaml-lsp-server" {< "1.3.0"}
"dune-configurator" {< "2.3.0"}
"odoc" {< "2.0.1"}
"dune-release" {< "1.3.0"}
"js_of_ocaml-compiler" {< "3.6.0"}
"jbuilder" {= "transition"}
]
dev-repo: "git+https://github.com/ocaml/dune.git"
build-env: [PATH += "%{ocaml-secondary-compiler:share}%/bin"]
Copy link
Member

@dra27 dra27 May 23, 2024

Choose a reason for hiding this comment

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

Unfortunately, this requires ocaml/opam#5352, which restricts it to opam 2.1.5+

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 9871990 to support both versions. I still have a number of machines on (e.g.) Ubuntu 22.04 which still have opam 2.1.2 as their pre-bundled version. It's uglier here to duplicate the build commands, but we can just delete the extra lines when opam < 2.1.5 rotate out of circulation in a few years.

Copy link
Member

Choose a reason for hiding this comment

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

Darn, I'm really sorry - it is indeed true that ocaml/opam#5352 is necessary for the variable to be set correctly, but then the issue I've identified in ocaml/opam#6051 bites... %{ocaml-secondary-compiler:share}%/bin appears after the bin directory, so you still get the 4.07 compiler in the switch rather than the secondary one.

Alas, it would appear that for now it has to be done with the ugly "sh" "-exc" version, but I've opened that issue/draft-PR to track improving this.

build: [
["sh" "-exc" "PATH=%{ocaml-secondary-compiler:share}%/bin:$PATH ocaml boot/bootstrap.ml -j %{jobs}%"] { opam-version < "2.1.5"}
["ocaml" "boot/bootstrap.ml" "-j" jobs] { opam-version >= "2.1.5" }
["sh" "-exc" "PATH=%{ocaml-secondary-compiler:share}%/bin:$PATH ./_boot/dune.exe build dune.install --release --profile dune-bootstrap -j %{jobs}%" ] { opam-version < "2.1.5" }
["./_boot/dune.exe" "build" "dune.install" "--release" "--profile" "dune-bootstrap" "-j" jobs] { opam-version >= "2.1.5" }
]
install: [
["./_boot/dune.exe" "install" "dune" "--prefix" "%{ocaml-secondary-compiler:share}%"] { opam-version >= "2.1.5" }
["sh" "-exc" "PATH=%{ocaml-secondary-compiler:share}%/bin:$PATH ./_boot/dune.exe install dune --prefix %{ocaml-secondary-compiler:share}%"] { opam-version < "2.1.5" }
]
depends: [
"ocaml-secondary-compiler" {>="4.14.1"}
"base-unix"
"base-threads"
]
url {
src: "https://github.com/ocaml/dune/releases/download/3.8.1/dune-3.8.1.tbz"
checksum: [
"sha256=9413a5d6eb9d7968a0463debb9d9f1be73025345809b827978d0c14db76cf914"
"sha512=6857b64e7ca8ba452937539d5996c8d0941b25d82313cfad9e1e6b835a04fb86605beccdc86400cc705ad6a969171524091ab6981df87629b542cc172b38746b"
]
}
34 changes: 34 additions & 0 deletions packages/menhir-secondary/menhir-secondary.20210419/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
opam-version: "2.0"
maintainer: "David Allsopp <[email protected]>"
authors: [
"François Pottier <[email protected]>"
"Yann Régis-Gianas <[email protected]>"
]
homepage: "http://gitlab.inria.fr/fpottier/menhir"
dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git"
bug-reports: "https://gitlab.inria.fr/fpottier/menhir/-/issues"
license: "LGPL-2.0-only WITH OCaml-LGPL-linking-exception"
build-env: [
[PATH += "%{ocaml-secondary-compiler:share}%/bin"]
]
build: [
["dune" "build"] { opam-version >= "2.1.5" }
["sh" "-exc" "PATH=%{ocaml-secondary-compiler:share}%/bin:$PATH dune build"] { opam-version < "2.1.5"}
]
install: [
["sh" "-exc" "PATH=%{ocaml-secondary-compiler:share}%/bin:$PATH dune install --prefix %{ocaml-secondary-compiler:share}%"] { opam-version < "2.1.5"}
["dune" "install" "--prefix" ocaml-secondary-compiler:share] { opam-version >= "2.1.5" }
]
depends: [
"dune-secondary"
"ocaml-secondary-compiler"
]
synopsis: "Adds Menhir to ocaml-secondary-compiler"
url {
src:
"https://gitlab.inria.fr/fpottier/menhir/-/archive/20210419/archive.tar.gz"
checksum: [
"md5=1af2d137eb20811c74ca516500164fd4"
"sha512=37a88b3ea0bde6089e5fbf0c1f10c1867c4edcd033ed3d5b75e7ed93e14ddd4f4c4db96baf638a054f65e294b83411497615c7fc14c6ff3a2a007e70f9d12c98"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
opam-version: "2.0"
synopsis: "OCaml 4.14.2 Secondary Switch Compiler"
maintainer: "David Allsopp <[email protected]>"
authors: "Xavier Leroy and many contributors"
license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception"
homepage: "https://ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
dev-repo: "git+https://github.com/ocaml/ocaml"
build: [
[
"./configure"
"--prefix=%{_:share}%"
"--libdir=%{_:share}%/lib"
"--disable-debugger"
"--disable-installing-bytecode-programs"
"--disable-debug-runtime"
"--disable-instrumented-runtime"
"CC=cc" {os = "openbsd" | os = "freebsd" | os = "macos"}
"ASPP=cc -c" {os = "openbsd" | os = "freebsd" | os = "macos"}
]
[make "-j%{jobs}%"]
]
install: [make "install"]
url {
src: "https://github.com/ocaml/ocaml/archive/4.14.2.tar.gz"
checksum: "sha256=c2d706432f93ba85bd3383fa451d74543c32a4e84a1afaf3e8ace18f7f097b43"
}
description: "Installs an additional compiler to the opam switch in
%{_:share}%/ocaml-secondary-compiler which can be accessed using
`ocamlfind -toolchain secondary`."
46 changes: 46 additions & 0 deletions packages/ocaml-variants/ocaml-variants.5.1.1+flambda2/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
opam-version: "2.0"
version: "5.1.1+flambda2"
synopsis: "Jane Street compiler variant with Flambda2 backend"
depends: [
"ocaml" {= "5.1.1" & post}
"base-unix" {post}
"base-bigarray" {post}
"base-threads" {post}
"base-flambda2" {post}
"dune-secondary" {="3.8.1"}
Copy link
Member

Choose a reason for hiding this comment

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

I'm presuming it really has to be 3.8.1 and nothing more recent?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm deferring to downstream here, as those are the versions they are using for their bootstrap.

Choose a reason for hiding this comment

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

I think actually it's ok to use a more recent dune now.

"menhir-secondary"
Copy link
Member

Choose a reason for hiding this comment

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

menhir-secondary (as dune-secondary) is quite old - is there a reason it's not therefore constrained here? (curiosity more than anything else)

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm deferring to downstream here, as those are the versions they are using for their bootstrap.

Choose a reason for hiding this comment

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

I think menhir versions need to stay as-is, at least for the moment.

"conf-autoconf" {build}
]
conflict-class: "ocaml-core-compiler"
flags: [ compiler avoid-version ]
setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs"
build-env: [
[PATH += "%{ocaml-secondary-compiler:share}%/bin"]
]
build: [
["autoconf"] { opam-version >= "2.1.5" }
["sh" "-exc" "PATH=%{ocaml-secondary-compiler:share}%/bin:$PATH autoconf"] { opam-version < "2.1.5" }
["./configure" "--prefix=%{prefix}%" "--enable-flambda2" "--enable-runtime5=yes"] { opam-version >= "2.1.5" }
["sh" "-exc" "PATH=%{ocaml-secondary-compiler:share}%/bin:$PATH ./configure --prefix=%{prefix}% --enable-flambda2 --enable-runtime5=yes"] { opam-version < "2.1.5" }
[make "-j%{jobs}%"] { opam-version >= "2.1.5" }
["sh" "-exc" "PATH=%{ocaml-secondary-compiler:share}%/bin:$PATH make -j%{jobs}%"] { opam-version < "2.1.5" }
]
install: [
[make "install"] { opam-version >= "2.1.5" }
["sh" "-exc" "PATH=%{ocaml-secondary-compiler:share}%/bin:$PATH make install"] { opam-version < "2.1.5" }
]
maintainer: "[email protected]"
homepage: "https://github.com/ocaml-flambda/flambda-backend/"
bug-reports: "https://github.com/ocaml-flambda/flambda-backend/issues"
url {
src: "git+https://github.com/ocaml-flambda/flambda-backend.git"
}
authors: [ "The Jane Street compiler team"
"Xavier Leroy"
"Damien Doligez"
"Alain Frisch"
"Jacques Garrigue"
"Didier Rémy"
"Jérôme Vouillon"
]
available: [ os = "linux" & arch = "x86_64" ]
Loading