Commits
meta_of_span picked the wider of the two byte offsets with the
polymorphic max. The operands are Loc.byte_pos, an int alias, so the
structural comparison was doing a boxed generic descent to answer a
question about two immediates.
Int.max is the same answer monomorphically.
The README fork warning landed for these nine forks, but the established
standard also carries a WARNING: prefix in the package description (21 other
forks do). Add it to each main package's description crediting the upstream
(digestif, cohttp, checkseum, mirage-tcpip, mirage, kdf, osrelease,
ocaml-dockerfile, jsont) and regenerate the opam files. Secondary packages
(-eio, mrg, -js) are left as-is, matching the main-package-only convention
the other forks follow.
These packages are forks of an external upstream but their READMEs were
missing the house experimental-fork warning that the other forks carry. Add
the standard blockquote crediting each upstream (digestif, cohttp, checkseum,
mirage-tcpip, mirage, kdf, osrelease, ocaml-dockerfile, jsont) so they are
not mistaken for production-ready. ocaml-xdg is intentionally excluded: it
has diverged into its own canonical source with no upstream to redirect to.
These packages are published only to the opam overlay, not the public
opam-repository. Without the repo-add line a reader who runs opam install
gets nothing and has to hunt down the overlay URL by hand.
Comment reflow and header reindent produced by the new ocamlformat;
no code changes.
Value.Number now carries a Number.t instead of a float, so packages that
pattern-match on a JSON number or read it as a float go through
Json.Number.to_float / to_int* explicitly. Mechanical updates across the
nox-json consumers (jwt, sigstore, yaml, rego, cdm, atp, gdocs, gsheets,
gslides, slack, linkedin, claude, requests) keeping behaviour identical.
The curated [instruction] view dropped the --from= argument of COPY and
ADD: the parser never extracted it and [copy_view] discarded the raw
[`From] field, so a front-end translating a Dockerfile could not tell a
context copy from a copy out of an earlier build stage.
Extract --from in [parse_copy_args] and add a [from] field to the curated
[copy] record, so a multi-stage COPY --from=<stage> survives the trip
into another build representation.
Repo-wide merlint cleanup (0 issues across 96 rules):
- Rename module constructors make/create -> v throughout (the idiomatic
primary-constructor name), updating every caller. Modules that expose
both a smart and an all-fields constructor (claude content_block /
message, qemu Command) keep create -> v and make -> of_parts.
- builder Xattr.get -> find (it returns an option) and add test_xattr.
- Tidy assorted findings: Fmt.failwith over failwith (Fmt.str ...), odoc
{!field-..}/{!val-..} cross-references, snake_case test-suite names,
the verity test split into a suite + test.ml, redundant make_/create_
prefixes on test helpers, and doc-comment leads/metavariables left
stale by the renames.
- Reduce two ocaml-fat functions under the complexity/length thresholds
(name.ml marshal, fs.ml write_to_location).
Completes the encoding-library layer model with a cursor for navigating
and editing a parsed Dockerfile (swap a base image, inject a step). It is
a list zipper over the instruction list: focus reads through the curated
instruction view; replace/insert/delete splice Dockerfile.t fragments so
edits go through the same eDSL constructors as authoring, and the internal
representation is kept so to_dockerfile reconstructs losslessly.
The curated instructions view folded parser directives, here-doc RUN/COPY,
HEALTHCHECK, and ONBUILD into a bare [Other] with no payload, so a consumer
(e.g. a builder front-end translating via [instructions]) could not even
tell what it had dropped -- a here-doc RUN is a real build step.
[Other] now carries the instruction's rendered Dockerfile text, so an
unhandled instruction is visible and a consumer can detect, pass through,
or reject it instead of silently losing it.
of_string returned a bare [`Msg of string] that discarded the parser's
position, so a syntax error or unsupported instruction in a large
Dockerfile reported no line. Parse and interpretation errors now carry a
Loc.Error.t pointing at the offending line:
- Error: a facade over Loc.Error -- the typed Unsupported_instruction
kind with its printer, plus located message and relocate helpers.
- parser: carry each line's startpos/endpos so the interpreter can stamp
the source span onto the error it raises.
- of_string : ?file:string -> string -> (t, Error.t) result, and a new
of_string_exn raising Loc.Error.
- tests: a good-error-message suite -- the keyword/value is named and the
error points at the right line (checked structurally via the location)
-- plus test_error for the facade itself.
The eDSL constructors and the curated instruction view are unchanged.
of_dockerfile needs to read a parsed Dockerfile, but only the abstract t was
exposed. Add Dockerfile.instructions : t -> instruction list -- a curated,
builder-friendly view (From/Run/Cmd/Copy/Env/...), folding the rare cases into
Other rather than leaking the internal line AST.
A Run carries its BuildKit modifiers -- command, network, security, and a
curated run_mount list (Cache/Bind/Secret/Ssh/Tmpfs) -- so a build front-end can
map them onto its own notions (e.g. obuilder's cache and network). The parser
now understands RUN --mount=type=cache,target=...,id=..., --network=none|host,
and --security=insecure|sandbox: it strips those flags before the command, and
they round-trip through to_string.
Dockerfile.of_string parses a Dockerfile back into a Dockerfile.t: an ocamllex
lexer splits logical lines (joining backslash continuations, handling comments
and blanks), a thin menhir grammar collects them, and an interpreter maps each
to the eDSL builders. Both shell and exec (JSON-array) forms of RUN/CMD/
ENTRYPOINT are handled, COPY/ADD accept the shell and JSON forms, and FROM keeps
a registry-port host distinct from a tag. of_string is total -- arbitrary bytes
yield Ok/Error, never an exception.
Tests cover parse/print round-trip, line continuation, registry-port FROM, and
clean errors. Fuzz (alcobar) round-trips generated Dockerfiles and asserts the
parser never raises on random input.
Renames the opam package to nox-dockerfile (the bare dockerfile name is
upstream's), matching the nox-* convention; dir, library and Dockerfile module
are unchanged.
Imports Anil Madhavapeddy's ocaml-dockerfile core (the typed Dockerfile AST,
the eDSL combinators, and the string/pp printer) as a new package, adapted for
this tree: the ppx_sexp_conv / sexplib serialization is dropped (fmt only, no
new external deps), the printer moves from Printf to Fmt, string_of_t becomes
to_string, and the doc comments are brought to the house style. ISC, credited
to Anil Madhavapeddy in LICENSE.md / NOTICE / README.
Adds unit tests for the eDSL and printer (from/run/copy/env/workdir, pipelines,
crunch layer-merging, pp/to_string agreement, and env-value escaping). A
Dockerfile parser (planned, menhir-based) will let the format round-trip with
to_string and serve as a builder spec front-end.
The README fork warning landed for these nine forks, but the established
standard also carries a WARNING: prefix in the package description (21 other
forks do). Add it to each main package's description crediting the upstream
(digestif, cohttp, checkseum, mirage-tcpip, mirage, kdf, osrelease,
ocaml-dockerfile, jsont) and regenerate the opam files. Secondary packages
(-eio, mrg, -js) are left as-is, matching the main-package-only convention
the other forks follow.
These packages are forks of an external upstream but their READMEs were
missing the house experimental-fork warning that the other forks carry. Add
the standard blockquote crediting each upstream (digestif, cohttp, checkseum,
mirage-tcpip, mirage, kdf, osrelease, ocaml-dockerfile, jsont) so they are
not mistaken for production-ready. ocaml-xdg is intentionally excluded: it
has diverged into its own canonical source with no upstream to redirect to.
Value.Number now carries a Number.t instead of a float, so packages that
pattern-match on a JSON number or read it as a float go through
Json.Number.to_float / to_int* explicitly. Mechanical updates across the
nox-json consumers (jwt, sigstore, yaml, rego, cdm, atp, gdocs, gsheets,
gslides, slack, linkedin, claude, requests) keeping behaviour identical.
The curated [instruction] view dropped the --from= argument of COPY and
ADD: the parser never extracted it and [copy_view] discarded the raw
[`From] field, so a front-end translating a Dockerfile could not tell a
context copy from a copy out of an earlier build stage.
Extract --from in [parse_copy_args] and add a [from] field to the curated
[copy] record, so a multi-stage COPY --from=<stage> survives the trip
into another build representation.
Repo-wide merlint cleanup (0 issues across 96 rules):
- Rename module constructors make/create -> v throughout (the idiomatic
primary-constructor name), updating every caller. Modules that expose
both a smart and an all-fields constructor (claude content_block /
message, qemu Command) keep create -> v and make -> of_parts.
- builder Xattr.get -> find (it returns an option) and add test_xattr.
- Tidy assorted findings: Fmt.failwith over failwith (Fmt.str ...), odoc
{!field-..}/{!val-..} cross-references, snake_case test-suite names,
the verity test split into a suite + test.ml, redundant make_/create_
prefixes on test helpers, and doc-comment leads/metavariables left
stale by the renames.
- Reduce two ocaml-fat functions under the complexity/length thresholds
(name.ml marshal, fs.ml write_to_location).
Completes the encoding-library layer model with a cursor for navigating
and editing a parsed Dockerfile (swap a base image, inject a step). It is
a list zipper over the instruction list: focus reads through the curated
instruction view; replace/insert/delete splice Dockerfile.t fragments so
edits go through the same eDSL constructors as authoring, and the internal
representation is kept so to_dockerfile reconstructs losslessly.
The curated instructions view folded parser directives, here-doc RUN/COPY,
HEALTHCHECK, and ONBUILD into a bare [Other] with no payload, so a consumer
(e.g. a builder front-end translating via [instructions]) could not even
tell what it had dropped -- a here-doc RUN is a real build step.
[Other] now carries the instruction's rendered Dockerfile text, so an
unhandled instruction is visible and a consumer can detect, pass through,
or reject it instead of silently losing it.
of_string returned a bare [`Msg of string] that discarded the parser's
position, so a syntax error or unsupported instruction in a large
Dockerfile reported no line. Parse and interpretation errors now carry a
Loc.Error.t pointing at the offending line:
- Error: a facade over Loc.Error -- the typed Unsupported_instruction
kind with its printer, plus located message and relocate helpers.
- parser: carry each line's startpos/endpos so the interpreter can stamp
the source span onto the error it raises.
- of_string : ?file:string -> string -> (t, Error.t) result, and a new
of_string_exn raising Loc.Error.
- tests: a good-error-message suite -- the keyword/value is named and the
error points at the right line (checked structurally via the location)
-- plus test_error for the facade itself.
The eDSL constructors and the curated instruction view are unchanged.
of_dockerfile needs to read a parsed Dockerfile, but only the abstract t was
exposed. Add Dockerfile.instructions : t -> instruction list -- a curated,
builder-friendly view (From/Run/Cmd/Copy/Env/...), folding the rare cases into
Other rather than leaking the internal line AST.
A Run carries its BuildKit modifiers -- command, network, security, and a
curated run_mount list (Cache/Bind/Secret/Ssh/Tmpfs) -- so a build front-end can
map them onto its own notions (e.g. obuilder's cache and network). The parser
now understands RUN --mount=type=cache,target=...,id=..., --network=none|host,
and --security=insecure|sandbox: it strips those flags before the command, and
they round-trip through to_string.
Dockerfile.of_string parses a Dockerfile back into a Dockerfile.t: an ocamllex
lexer splits logical lines (joining backslash continuations, handling comments
and blanks), a thin menhir grammar collects them, and an interpreter maps each
to the eDSL builders. Both shell and exec (JSON-array) forms of RUN/CMD/
ENTRYPOINT are handled, COPY/ADD accept the shell and JSON forms, and FROM keeps
a registry-port host distinct from a tag. of_string is total -- arbitrary bytes
yield Ok/Error, never an exception.
Tests cover parse/print round-trip, line continuation, registry-port FROM, and
clean errors. Fuzz (alcobar) round-trips generated Dockerfiles and asserts the
parser never raises on random input.
Renames the opam package to nox-dockerfile (the bare dockerfile name is
upstream's), matching the nox-* convention; dir, library and Dockerfile module
are unchanged.
Imports Anil Madhavapeddy's ocaml-dockerfile core (the typed Dockerfile AST,
the eDSL combinators, and the string/pp printer) as a new package, adapted for
this tree: the ppx_sexp_conv / sexplib serialization is dropped (fmt only, no
new external deps), the printer moves from Printf to Fmt, string_of_t becomes
to_string, and the doc comments are brought to the house style. ISC, credited
to Anil Madhavapeddy in LICENSE.md / NOTICE / README.
Adds unit tests for the eDSL and printer (from/run/copy/env/workdir, pipelines,
crunch layer-merging, pp/to_string agreement, and env-value escaping). A
Dockerfile parser (planned, menhir-based) will let the format round-trip with
to_string and serve as a builder spec front-end.