Skip to content

Commit

Permalink
Merge pull request #627 from edwintorok/consistent
Browse files Browse the repository at this point in the history
Make xs-opam self-consistent and able to run unit tests
  • Loading branch information
edwintorok authored Feb 21, 2023
2 parents 1fd0bd7 + 8b06741 commit 34595e1
Show file tree
Hide file tree
Showing 9 changed files with 185 additions and 84 deletions.
33 changes: 33 additions & 0 deletions packages/upstream-extra/bechamel-notty.0.3.0/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
opam-version: "2.0"
maintainer: "Romain Calascibetta <romain.calascibetta@gmail.com>"
authors: "Romain Calascibetta <romain.calascibetta@gmail.com>"
homepage: "https://github.com/mirage/bechamel"
bug-reports: "https://github.com/mirage/bechamel/issues"
dev-repo: "git+https://github.com/mirage/bechamel.git"
doc: "https://mirage.github.io/bechamel/"
license: "MIT"
synopsis: "CLI generator for bechamel's output"
description: """A simple tool to generate a CLI output with notty
which shows results from bechamel's benchmarks (as core_bench)."""

build: [
[ "dune" "build" "-p" name "-j" jobs ]
[ "dune" "runtest" "-p" name "-j" jobs ] {with-test}
]

depends: [
"ocaml" {>= "4.08.0"}
"dune" {>= "2.0.0"}
"bechamel" {= version}
"notty"
"fmt" {>= "0.9.0"}
]
url {
src:
"https://github.com/mirage/bechamel/releases/download/v0.3.0/bechamel-0.3.0.tbz"
checksum: [
"sha256=d719040841a1a3be6f93699ae9bf1f8cb2c5d294f0218c0bc0a735386c2d71a0"
"sha512=dc1233d4dcf01a997a3fcbafc116df0aae22ea5a6c98c09e200e4aa984c558976c8290b3e14b1156519ad12a6cc4b1b9fa4adf3dc2458d373d77a07fb9f7acff"
]
}
x-commit-hash: "adf2b19fe09be6f405f11a69e15845529a5d80b7"
34 changes: 34 additions & 0 deletions packages/upstream-extra/bechamel.0.3.0/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
opam-version: "2.0"
maintainer: "Romain Calascibetta <romain.calascibetta@gmail.com>"
authors: "Romain Calascibetta <romain.calascibetta@gmail.com>"
homepage: "https://github.com/mirage/bechamel"
bug-reports: "https://github.com/mirage/bechamel/issues"
dev-repo: "git+https://github.com/mirage/bechamel.git"
doc: "https://mirage.github.io/bechamel/"
license: "MIT"
synopsis: "Yet Another Benchmark in OCaml"
description: """BEnchmark for a CHAMEL/camel/caml which
is agnostic to the system. It's a micro-benchmark tool
which lets the user to re-analyzes and prints samples."""

build: [
[ "dune" "build" "-p" name "-j" jobs ]
[ "dune" "runtest" "-p" name "-j" jobs ] {with-test}
]

depends: [
"ocaml" {>= "4.08.0"}
"dune" {>= "2.0.0"}
"fmt" {>= "0.9.0"}
"base-bytes"
"stdlib-shims"
]
url {
src:
"https://github.com/mirage/bechamel/releases/download/v0.3.0/bechamel-0.3.0.tbz"
checksum: [
"sha256=d719040841a1a3be6f93699ae9bf1f8cb2c5d294f0218c0bc0a735386c2d71a0"
"sha512=dc1233d4dcf01a997a3fcbafc116df0aae22ea5a6c98c09e200e4aa984c558976c8290b3e14b1156519ad12a6cc4b1b9fa4adf3dc2458d373d77a07fb9f7acff"
]
}
x-commit-hash: "adf2b19fe09be6f405f11a69e15845529a5d80b7"
32 changes: 32 additions & 0 deletions packages/upstream-extra/cinaps.v0.15.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
opam-version: "2.0"
maintainer: "Jane Street developers"
authors: ["Jane Street Group, LLC"]
homepage: "https://github.com/ocaml-ppx/cinaps"
bug-reports: "https://github.com/ocaml-ppx/cinaps/issues"
dev-repo: "git+https://github.com/ocaml-ppx/cinaps.git"
license: "MIT"
build: [
["dune" "build" "-p" name "-j" jobs]
]
depends: [
"ocaml" {>= "4.04"}
"dune" {>= "2.0.0"}
"re" {>= "1.8.0"}
"base-unix"
]
synopsis: "Trivial metaprogramming tool"
description: "
Cinaps is a trivial Metaprogramming tool using the OCaml toplevel. It
is based on the same idea as expectation tests. The user write some
OCaml code inside special comments and cinaps make sure that what
follows is what is printed by the OCaml code.
"
x-commit-hash: "86f2f05c4605572022cdb794c5542d220fb14be5"
url {
src:
"https://github.com/ocaml-ppx/cinaps/archive/v0.15.1.tar.gz"
checksum: [
"sha256=1be18e70f5d8a6b03566c3619b62836a26094fc7208fde46ab7b32ee64116170"
"sha512=ca53a9da8aa71ce7cddf7e24778e9c4d3f3e5784209da85a5a6b2d5af83cd8ad769fbe3009d2757ebf4a25ca39d76af00ebc693b1b01c3b53c8775ea479123a5"
]
}
65 changes: 0 additions & 65 deletions packages/upstream-extra/mdx.1.8.1/opam

This file was deleted.

35 changes: 35 additions & 0 deletions packages/upstream-extra/notty.0.2.3/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
opam-version: "2.0"
homepage: "https://github.com/pqwy/notty"
dev-repo: "git+https://github.com/pqwy/notty.git"
bug-reports: "https://github.com/pqwy/notty/issues"
doc: "https://pqwy.github.io/notty/doc"
maintainer: "David Kaloper <dk505@cam.ac.uk>"
license: "ISC"
synopsis: "Declaring terminals"
description:
"Notty is a declarative terminal library for OCaml structured around a notion
of composable images. It tries to abstract away the basic terminal programming
model, providing something simpler and more expressive."

build: [ [ "dune" "subst" ] {dev}
[ "dune" "build" "-p" name "-j" jobs ] ]
depends: [
"ocaml" {>= "4.08.0"}
"dune" {>= "1.7"}
"cppo" {build & >= "1.1.0"}
"uutf" {>= "1.0.0"}
]
depopts: [ "lwt" ]
conflicts: [
"lwt" {<"2.6.0"}
]
authors: "David Kaloper <dk505@cam.ac.uk>"
url {
src:
"https://github.com/pqwy/notty/releases/download/v0.2.3/notty-0.2.3.tbz"
checksum: [
"sha256=74659fb14073db4438989891ab24f24bef81aa497dac16d9a67f9a1c9c200824"
"sha512=6e21d44fe39f3d80884b87635bebae55cb2b931ef74f9184ba4d74cc3e51cb0b3e976c3b6dc61d377288504e8bfabe21acdc1069eacb30df1fbf6686b80f7c6b"
]
}
x-commit-hash: "e035d069370da436f1fc53525c1e16bff3ed687e"
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
opam-version: "2.0"
name: "ca-certs"
version: "0.2.2"
synopsis: "Detect root CA certificates from the operating system"
description: """\
description: """
TLS requires a set of root anchors (Certificate Authorities) to
authenticate servers. This library exposes this list so that it can be
registered with ocaml-tls."""
maintainer: "Etienne Millon <me@emillon.org>"
authors:
registered with ocaml-tls.
"""
maintainer: ["Etienne Millon <me@emillon.org>"]
authors: [
"Etienne Millon <me@emillon.org>, Hannes Mehnert <hannes@mehnert.org>"
]
license: "ISC"
tags: "org:mirage"
homepage: "https://github.com/mirage/ca-certs"
doc: "https://mirage.github.io/ca-certs/doc"
bug-reports: "https://github.com/mirage/ca-certs/issues"
Expand All @@ -30,6 +29,7 @@ depends: [
conflicts: [
"result" {< "1.5"}
]
dev-repo: "git+https://github.com/mirage/ca-certs.git"
build: [
["dune" "subst"] {dev}
[
Expand All @@ -40,18 +40,20 @@ build: [
"-j"
jobs
"@install"
"@runtest" {with-test & os != "macos"}
"@runtest" {with-test & os != "macos"} # the opam sandbox on macos leads to test failures (ocaml/opam#4389)
"@doc" {with-doc}
]
]
depexts: ["ca_root_nss"] {os = "freebsd"}
dev-repo: "git+https://github.com/mirage/ca-certs.git"
tags: ["org:mirage"]
depexts: [
["ca_root_nss"] {os = "freebsd"}
]
url {
src:
"https://github.com/mirage/ca-certs/releases/download/v0.2.2/ca-certs-v0.2.2.tbz"
"https://github.com/mirage/ca-certs/releases/download/v0.2.3/ca-certs-0.2.3.tbz"
checksum: [
"sha256=4f1e77cc125e99987738387ff22cda8710e826f5ef3452f2000f0b30cd668652"
"sha512=70e564a5bb69a66018ff3387bf7b4b6af2ec1507d9f2f140f2aa8519e405920ec1469e56d1fa2aa8b452d05531a35f22df2c1ac08071f9a322525e95de8e3e1f"
"sha256=d2d8d6457d915ef6d783def82f3be5ec2f56f92e20214f58edd63c9c2fc60e9c"
"sha512=e945112be3b2f1fbcaeb95aebb600cd5119f1f05583ebcc0a4a20dd159d8cfec5adc3443aae678ee159c0e0c32b1d7c0ba3ba4405e3483e3f565e4d29d3da0f7"
]
}
x-commit-hash: "20c2d4ed91bc7cd76a1bc289ad8dcc5a80006cc6"
x-commit-hash: "9ee07b8ab77eb9ec8b6d84f98359e45e1beb9b9d"
18 changes: 15 additions & 3 deletions tools/cleanup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
#!/bin/sh
#!/bin/bash
#
# list packages that are not required by packages in this repo
#
exec opam admin filter --dry-run --resolve=xs-toolstack --resolve upstream-extra-dummy --resolve depext.transition --resolve opam-ed.0.3 --resolve ocaml-base-compiler.4.08.1 --resolve ppx_tools.6.0+4.08.0 --resolve ocaml-system.4.08.1 --or --with-test

# with-test only looks at test dependencies of the packages listed on the
# cmdline, not everything recursively
# so find out recursive deps of xs-toolstack: we want to run tests for all of
# those (but we don't necessarily need to run the tests of packages pulled in
# only for testing - that is sometimes not all solvable with same versions)
set -euo pipefail
. "$(dirname "$0")/xs-opam-ci.env"
opam admin check --ignore-test-doc
# there is a conflict in ppxlib and sexplib0 version in with-test, ignore its tests for now
RESOLVE=$(opam admin filter --verbose --dry-run --resolve=xs-toolstack | sed -n 2p | grep -v ppxlib)
RESOLVE+=" upstream-extra-dummy xenctrl.dummy opam-depext opam-ed.0.3"
RESOLVE+=" ocaml-base-compiler.${OCAML_VERSION_FULL} ocaml-system.${OCAML_VERSION_FULL}"
exec opam admin filter --dry-run "--resolve=$(echo ${RESOLVE} | tr ' ' ',')" --or --with-test
4 changes: 2 additions & 2 deletions tools/find-unused-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -euo pipefail

USED=$(opam list -t --required-by xs-toolstack --recursive --short | sort)
UPSTREAM=$(find "packages/upstream/" -mindepth 1 -maxdepth 1 -type d -print0 | xargs -0 -I {} echo "{}" | cut -d "/" -f 3 | cut -d "." -f 1 | sort)
XS=$(find "packages/xs/" -mindepth 1 -maxdepth 1 -type d -print0 | xargs -0 -I {} echo "{}" | cut -d "/" -f 3 | cut -d "." -f 1 | sort)
UPSTREAM=$(find "packages/upstream/" -mindepth 1 -maxdepth 1 -type d -print0 | xargs -0 -I {} echo "{}" | cut -d "/" -f 3 | cut -d "." -f 1 | sort | uniq)
XS=$(find "packages/xs/" -mindepth 1 -maxdepth 1 -type d -print0 | xargs -0 -I {} echo "{}" | cut -d "/" -f 3 | cut -d "." -f 1 | sort | uniq)
diff -u .github/unused-upstream.txt <(comm -23 <(echo "$UPSTREAM") <(echo "$USED"))
diff -u .github/unused-xs.txt <(comm -23 <(echo "$XS") <(echo "$USED"))
echo OK
18 changes: 18 additions & 0 deletions tools/installtest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
#
# list packages that are not required by packages in this repo

# with-test only looks at test dependencies of the packages listed on the
# cmdline, not everything recursively
# so find out recursive deps of xs-toolstack: we want to run tests for all of
# those (but we don't necessarily need to run the tests of packages pulled in
# only for testing - that is sometimes not all solvable with same versions)
set -euo pipefail

# there are conflicts with some of these test dependencies or bring in too many other packages
# next time we upgrade them we should aim to make them testable
# ocaml-system should always be excluded because the system compiler may be quite different from what we use here
NOTEST=ocaml-system\|ppx_cstruct\|ipaddr-sexp\|vhd-format-lwt\|cohttp-async\|ezjsonm\|ppxlib\|mirage-crypto-ec
ALLDEPS=$(opam admin filter --dry-run --resolve=xs-toolstack | sed -n 2p | tr ' ' '\n' |grep -vE ${NOTEST} | tr '\n' ' ')
#opam install --no-depexts --with-test ${ALLDEPS} -y
opam install --with-test ${ALLDEPS} -y

0 comments on commit 34595e1

Please sign in to comment.