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

Select unsafe.ml with just dune rules #46

Merged
merged 1 commit into from
Jun 30, 2020

Conversation

emillon
Copy link
Contributor

@emillon emillon commented Jun 30, 2020

Hi,

I was reviewing some uses of configurator and found that base64 uses it.

This is not necessary in this case so I'm sure you'll enjoy having one fewer dependency :)

In general, it is not necessary to use configurator to select a file depending on the OCaml version. This pattern looks like this:

  • a config.exe program (with no dependencies) checks Sys.ocaml_version (scanf will only look at the beginning of the string, so no need to parse the patch version etc) and just outputs the name of the file to copy
  • a rule links a file name to the output of config.exe
  • a rule copies the content of that file to unsafe.ml

Let me know what you think!

It is not necessary to use configurator to select a file depending on
the OCaml version. This pattern looks like this:

- a `config.exe` program (with no dependencies) checks
  `Sys.ocaml_version` (`scanf` will only look at the beginning of the
  string, so no need to parse the patch version etc) and just outputs
  the name of the file to copy
- a rule links a file name to the output of `config.exe`
- a rule copies the content of that file to `unsafe.ml`
@emillon emillon force-pushed the select-dune-rules branch from accde1d to d122ecc Compare June 30, 2020 14:49
@dinosaure
Copy link
Member

Thanks

@dinosaure dinosaure merged commit fa375d8 into mirage:master Jun 30, 2020
@emillon emillon deleted the select-dune-rules branch June 30, 2020 14:56
dinosaure added a commit to dinosaure/opam-repository that referenced this pull request Feb 8, 2021
CHANGES:

- Fix support for `x-compilation` (@samoht, mirage/ocaml-base64#44)
- Update to `dune.2.0` and apply `ocamlformat` (@samoht, mirage/ocaml-base64#45)
- Select `unsafe.ml` only with `dune` (@emillon, mirage/ocaml-base64#46)
- Remove indirect dependecy to `ocamlfind` (@kit-ty-kate, mirage/ocaml-base64#49)
- Hide internals of `base64` and return a `string` as the alphabet (@reynir, mirage/ocaml-base64#48)
  **breaking chnages** `Base64.alphabet` is updated and return a simple `string` now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants