diff --git a/.ci/build.yaml b/.ci/build.yaml new file mode 100644 index 00000000..3359bd28 --- /dev/null +++ b/.ci/build.yaml @@ -0,0 +1,61 @@ +parameters: + host: '' + pool: '' + sign: false + +jobs: +- job: ${{ parameters.host }} + pool: ${{ parameters.pool }} + steps: + - ${{ if eq(parameters.sign, 'true') }}: + - script: 'npm install -g @esy-nightly/esy@0.4.10-e6e1e7 --unsafe-perm' + displayName: 'Installing deps' + workingDirectory: 're' + - ${{ if eq(parameters.sign, 'false') }}: + - script: 'sudo npm install -g @esy-nightly/esy@0.4.10-e6e1e7 --unsafe-perm' + displayName: 'Installing deps' + workingDirectory: 're' + - script: esy install + displayName: 'Installing deps' + workingDirectory: 're' + - script: esy build + displayName: 'Building' + workingDirectory: 're' + - ${{ if ne(parameters.sign, 'true') }}: + - script: esy test + displayName: 'Running inline tests' + workingDirectory: 're' + - script: esy npm-release + displayName: 'Creating npm release' + workingDirectory: 're' + - script: npm pack + displayName: 'NPM packing...' + workingDirectory: 're/_release' + - ${{ if eq(parameters.host, 'Windows') }}: + - script: 'npm install -g .\pesy-0.0.0.tgz --unsafe-perm=true' + displayName: 'npm link... for tests' + workingDirectory: 're/_release' + - ${{ if eq(parameters.host, 'Linux') }}: + - script: 'sudo npm install -g ./pesy-0.0.0.tgz --unsafe-perm=true' + displayName: 'npm link... for tests' + workingDirectory: 're/_release' + - ${{ if eq(parameters.host, 'macOS') }}: + - script: 'sudo npm install -g ./pesy-0.0.0.tgz --unsafe-perm=false' + displayName: 'npm link... for tests' + workingDirectory: 're/_release' + - ${{ if eq(parameters.sign, 'false') }}: + - script: ./_build/install/default/bin/TestBootstrapper.exe + displayName: 'Running tests' + workingDirectory: 're' + - ${{ if eq(parameters.sign, 'true') }}: + - script: .\_build\install\default\bin\TestBootstrapper.exe + displayName: 'Running tests' + workingDirectory: 're' + - ${{ if eq(parameters.sign, 'false') }}: + - script: ./_build/install/default/bin/TestPesyConfigure.exe + displayName: 'Running tests' + workingDirectory: 're' + - ${{ if eq(parameters.sign, 'true') }}: + - script: .\_build\install\default\bin\TestPesyConfigure.exe + displayName: 'Running tests' + workingDirectory: 're' diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..3860a9fe --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +.DS_Store +npm-debug.log +.merlin +yarn-error.log +node_modules/ +_build +_esy +_release +pesy.install +.DS_Store +*.install +*~ \ No newline at end of file diff --git a/ORIGIN.md b/ORIGIN.md new file mode 100644 index 00000000..ffb347ad --- /dev/null +++ b/ORIGIN.md @@ -0,0 +1,4 @@ + +- Includes vendored copy of [JSON.sh](https://github.com/dominictarr/JSON.sh) + (under MIT LICENSE) which has been renamed to `pesy-JSON.sh` to avoid name + collisions. diff --git a/README.md b/README.md index 1c361230..a2fb8d14 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,282 @@ # pesy -esy pesy - project configuration for esy + +[![Build Status](https://dev.azure.com/prometheansacrifice/pesy/_apis/build/status/prometheansacrifice.pesy)](https://dev.azure.com/prometheansacrifice/pesy/_build/latest?definitionId=1) + + +- Use `package.json` to automatically configure libraries and executables built + with Dune. + +![screenshot](./images/screenshot.png "Demo") + +### Create New Project: + +`pesy` global command creates `esy` projects instantly inside of any directory. + +```sh +npm install -g pesy + +cd my-project +pesy # Hit enter to accept default name +``` + + +This creates: + +- `package.json` with useful dependencies/compilers. +- `.gitignore` and `README.md` with instructions for new contributors. +- `.circleci` continuous integration with cache configured for ultra-fast pull + requests. +- `library/`, `executable/` and `test/` directory with starter modules. + +The created project uses `pesy` in its build step. As always, run `esy pesy` +any time you update the build config in the `package.json`. + + +Once you've created a project, you normally only ever run `esy build` on the +command line. If you update your `package.json` `buildDirs` field, you will +need to run `esy pesy` which will update all the project build config based on +your `package.json` file changes. Then, you just run `esy build` as usual. You +only need to run `esy pesy` if you change your `package.json` file. + +(Hopefully, this could be automatically done in the future so you only ever run +`esy build` as usual). + +### Build `pesy` Project: + +```sh +esy build +``` + +Your project's `esy.build` field is set to `pesy`, which will run `pesy` to +verify that all your build config is up to date before invoking the Dune build. +It will let you know if you need to run `esy pesy` to update your build config +from new changes to `package.json`. + +### Update `pesy` Project: + +```sh +esy pesy +``` + +If you change your `buildDirs` config in `package.json`, run this command to +update build configuration. + + + +## Configuring: + +Configure your `package.json`'s `buildDirs` field for multiple libraries and +executables. +`buildDirs.DirectoryName` means that a library or executable will be located at +`./DirectoryName`. The `buildDirs.DirectoryName.name` field determines the +public name of the library or executable. a `name` ending in `.exe` is +automatically configured as an executable, and a name of the form +`packageName.anything` is automatically configured to be a library with the +public name of `packageName.anything`. + + +```json +"buildDirs": { + "MyLibrary": { + "name": "packageNameMyLibrary", + "namespace": "MyLibrary", + "require": ["console.lib"] + }, + "Tests": { + "name": "Tests.exe", + "description": "Runs all the tests natively", + "flags": ["-linkall"], + "require": ["console.lib", "packageNameMyLibrary""] + } +} +``` + +### Supported Config +Not all config is supported. This is just a proof of concept. If you'd like to +add support for more config fields, PRs are welcomed. + +**Binaries** + +| Field | Type | Description | +|--------|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|`name` | `string` | The name of the binary **that must end with `.exe`**. | +|`main` | `string` | The name of the module that serves as the main entrypoint of the binary. | +|`modes` | `list(string)` | [Advanced linking modes](https://jbuilder.readthedocs.io/en/latest/dune-files.html?highlight=modules_without_implementation#linking-modes). Each string should be of the form `"( )"` where `` is one `byte`, `native` or `best` and `` is one of `c`, `exe`, `object`, `shared_object`. | + +**Libraries** + +| Field | Type | Description | +|-----------------|-----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +|`name` | `string` | The name of the library | +|`modes` | `list("byte"\|"native"\|"best")` | Mode which should be built by default. Useful for disabling native compilation for some libraries. | +|`cNames` | `list(string)` | List of strings to use as C stubs (filenames without the `.c` extension). | +|`virtualModules` | `list(string)` | List of modules within the library that will have interfaces but no implementation, causing this library to be considered "virtual". Another library can then claim to "implement" this library by including `"implements": "yourLibName"`. See [Virtual Libraries](https://jbuilder.readthedocs.io/en/latest/variants.html) | +|`implements` | `list(string)` | List of virtual library names that this library implements. | +|`wrapped` | `true|false` | Default `true`, and it's a good idea to keep it that way. Setting to `false` will put all your library modules in the global namespace. + +**Both Libraries And Binaries** + +| Field | Type | Description | +|-----------------------|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|`require` | `list(string)` | Public library names you want to be able to use. | +|`flags` | `list(string)` | List of strings to pass to both native and bytecode compilers. | +|`ocamlcFlags` | `list(string)` | List of flags to pass to `ocamlc` | +|`ocamloptFlags` | `list(string)` | List of flags to pass to `ocamlopt` | +|`jsooFlags` | `list(string)` | List of flags passed to `jsoo` | +|`preprocess` | `list(string)` | List of preprocess options to enable. Primarily used to enable PPX | +|`ignoredSubdirs` | `list(string)` | Subdirectory names to ignore (This feature is soon to be deprecated). | +|`includeSubdirs` | `"no"\|"unqualified"` | Default is `"no"`, and changing to `"unqualified"` will compile modules at deeper directories than the place where the `dune` file is generated. See [Dune docs](https://jbuilder.readthedocs.io/en/latest/dune-files.html?highlight=include_subdirs#include-subdirs) | +|`rawBuildConfig` | `list(string)` | Raw build config to be injected into the build config for _this_ target. | +|`rawBuildConfigFooter` | `list(string)` | Raw build config to be injected into the footer of the build config. | + + + + +## Consuming New Package And Library Dependencies: + +- Add dependencies to `dependencies` in `package.json`. +- Add the name of that new dependencies *library* to `package.json`'s + `buildDirs` section that you want to use the library within. For example, if + your project builds a library in the `exampleLib/` directory, and you want it + to depend on a library named `bos.top` from an opam package named `bos`, + change the `package.json` to look like this: + + ```json + { + "name": "my-package", + "dependencies": { + "@opam/bos": "*" + }, + "buildDirs": { + "exampleLib": { + "namespace": "Examples", + "name": "my-package.example-lib", + "require": [ "bos.top" ] + } + } + } + ``` + +- Then run: + ```sh + esy install # Fetch dependency sources + esy pesy # Configure the build based on package.json + esy build # Do the build + ``` + +> Note: After adding/building a new dependency you can use `esy ls-libs` to see +> which named libraries become available to you by adding the package +> dependency. + + + +## Tradeoffs: +`esy-pesy` is good for rapidly making new small executables/libraries. Once they +grow, you'll want to "eject out" of `esy-pesy` and begin customizing using a more +advanced build system. + + +## Adding `pesy` to an existing project. + +You probably don't need `pesy` if you have an existing project that is working +well, but to add `pesy` to an existing project, follow these steps: + +**1. Add a dependency on `pesy`, and configure `buildDirs`:** + +```json +{ + "name": "my-package", + "dependencies": { + "pesy": "*" + }, + "buildDirs": { + "exampleLib": { + "namespace": "Examples", + "name": "my-package.example-lib", + "require": [ "bos.top" ] + }, + "bin": { + "name": "my-package.exe", + "require": [ + "my-package.lib" + ] + } + } +} +``` + +**2.Install and Build:** + +```sh +esy install +esy pesy # Generate the project build config from json +esy build +``` + +## Example Project: + +The following example project already has an example config. You can base your +project off of this one. + +```sh +npm install -g esy@next +git clone git@github.com:jordwalke/esy-peasy-starter.git + +esy install +esy pesy # Use pesy to configure build from package.json +esy build +``` + +- Change the `name` of the package, and names of libraries in `buildDirs` + accordingly. +- Then rerun: + +```sh +esy pesy +esy build +``` + +# Development + +```sh +cd re/ +esy install +esy build +esy dune runtest # Unit tests +``` + +## e2e tests +`./_build/install/default/bin` would contain (after running `esy build`) `TestBootstrapper.exe` and `TestPesyConfigure.exe` +to test if simple workflows work as expected. They assume both `esy` and `pesy` are installed +globally (as on user's machines). TODO: improve error messages + +`run.bat` and `run.sh` inside `scripts` can be used to globally install using npm pack. Then run +the e2e scripts. + +```sh +./scripts/run.sh +./_build/install/default/bin/TestBootstrapper.exe +./_build/install/default/bin/TestPesyConfigure.exe +``` + +# Changes: + +**version 0.4.0 (12/21/2018)** + +- Allow `buildDirs` to contain deeper directories such as `"path/to/my-lib": {...}"`. +- Added support for `wrapped` property on libraries. +- Added support for `virtualModules` and `implements` - properties for Dune + virtual libraries. (This will only be supported if you mark your project as + Dune 1.7 - not yet released). +- Stopped using `ignore_subdirs` in new projects, instead using + `(dirs (:standard \ _esy))` which only works in Dune `1.6.0+`, so made new + projects have a lower bound of Dune `1.6.0`. +- Support new properties `rawBuildConfig` which will be inserted at the bottom + of the _target_ being configured (library/executable). + - It expects an array of strings, each string being a separate line in the + generated config. +- Support new properties `rawBuildConfigFooter` which will be inserted at the + bottom of the entire Dune file for the _target_ being configured. + - It expects an array of strings, each string being a separate line in the + generated config. +- Support new properties `modes` for binaries and libraries `list(string)`. diff --git a/assets/azure-pipeline-templates/pesy-azure-pipelines.yml b/assets/azure-pipeline-templates/pesy-azure-pipelines.yml new file mode 100644 index 00000000..820a1994 --- /dev/null +++ b/assets/azure-pipeline-templates/pesy-azure-pipelines.yml @@ -0,0 +1,67 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +name: $(Build.SourceVersion) +jobs: +- job: Linux + timeoutInMinutes: 0 + pool: + vmImage: 'Ubuntu 16.04' + + variables: + ESY__CACHE_INSTALL_PATH: /home/vsts/.esy/3_____________________________________________________________________/i/ + ESY__CACHE_SOURCE_TARBALL_PATH: /home/vsts/.esy/source/i + + steps: + # TODO: Uncomment both this and 'publish-build-cache' below to enable build caching for Linux. + # - template: .ci/restore-build-cache.yml + - template: .ci/esy-build-steps.yml + # - template: .ci/publish-build-cache.yml + +- job: MacOS + timeoutInMinutes: 0 + pool: + vmImage: 'macOS 10.13' + + variables: + ESY__CACHE_INSTALL_PATH: /Users/vsts/.esy/3____________________________________________________________________/i/ + ESY__CACHE_SOURCE_TARBALL_PATH: /Users/vsts/.esy/source/i + + steps: + # TODO: Uncomment both this and 'publish-build-cache' below to enable build caching for Mac. + # - template: .ci/restore-build-cache.yml + - template: .ci/esy-build-steps.yml + # - template: .ci/publish-build-cache.yml + +- job: Windows + timeoutInMinutes: 0 + pool: + vmImage: 'vs2017-win2016' + + variables: + ESY__CACHE_INSTALL_PATH: C:\Users\VssAdministrator\.esy\3_\i + ESY__CACHE_SOURCE_TARBALL_PATH: C:\Users\VssAdministrator\.esy\source\i + + steps: + - template: .ci/restore-build-cache.yml + - template: .ci/esy-build-steps.yml + - template: .ci/publish-build-cache.yml + +- job: Release + timeoutInMinutes: 0 + displayName: Release + dependsOn: + - Linux + - MacOS + - Windows + condition: succeeded() + pool: + vmImage: ubuntu-16.04 + steps: + - task: PublishBuildArtifacts@1 + displayName: 'Release Package' + inputs: + PathtoPublish: '.' + ArtifactName: npm-package diff --git a/assets/azure-pipeline-templates/pesy-esy-build-steps.template.yml b/assets/azure-pipeline-templates/pesy-esy-build-steps.template.yml new file mode 100644 index 00000000..8de0815d --- /dev/null +++ b/assets/azure-pipeline-templates/pesy-esy-build-steps.template.yml @@ -0,0 +1,24 @@ +# Cross-platform set of build steps for building esy projects + +steps: + - task: NodeTool@0 + inputs: + versionSpec: '8.9' + - script: npm install -g esy@0.4.3 + displayName: 'npm install -g esy@0.4.3' + - script: esy install + displayName: 'esy install' + - script: esy pesy-configure + displayName: 'esy pesy' + - script: esy build + displayName: 'esy build' + - script: esy test + displayName: 'esy test' + - script: esy x App.exe + displayName: 'Run the main binary' + - script: esy ls-libs + continueOnError: true + displayName: 'Show all libraries including this package lib' + - script: esy release + displayName: 'Test Creation of Prebuilt Binary Releases' + continueOnError: true diff --git a/assets/azure-pipeline-templates/pesy-publish-build-cache.yml b/assets/azure-pipeline-templates/pesy-publish-build-cache.yml new file mode 100644 index 00000000..faeb3f8a --- /dev/null +++ b/assets/azure-pipeline-templates/pesy-publish-build-cache.yml @@ -0,0 +1,11 @@ +# Steps for publishing project cache + +steps: + - task: PublishBuildArtifacts@1 + displayName: 'Cache: Upload install folder' + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) + inputs: + pathToPublish: '$(ESY__CACHE_INSTALL_PATH)' + artifactName: 'cache-$(Agent.OS)-install' + parallel: true + parallelCount: 8 diff --git a/assets/azure-pipeline-templates/pesy-restore-build-cache.yml b/assets/azure-pipeline-templates/pesy-restore-build-cache.yml new file mode 100644 index 00000000..41bd5c83 --- /dev/null +++ b/assets/azure-pipeline-templates/pesy-restore-build-cache.yml @@ -0,0 +1,23 @@ +# Steps for restoring project cache + +steps: + - task: DownloadBuildArtifacts@0 + condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/master')) + displayName: 'Cache: Restore install' + inputs: + buildType: 'specific' + project: '$(System.TeamProject)' + pipeline: '$(Build.DefinitionName)' + branchName: 'refs/heads/master' + buildVersionToDownload: 'latestFromBranch' + downloadType: 'single' + artifactName: 'cache-$(Agent.OS)-install' + downloadPath: '$(System.ArtifactsDirectory)' + continueOnError: true + + - task: CopyFiles@2 + condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/master')) + inputs: + sourceFolder: '$(System.ArtifactsDirectory)\cache-$(Agent.OS)-install' + targetFolder: '$(ESY__CACHE_INSTALL_PATH)' + continueOnError: true diff --git a/assets/dune b/assets/dune new file mode 100644 index 00000000..ad93b086 --- /dev/null +++ b/assets/dune @@ -0,0 +1,18 @@ +(library + (name PesyAssets) + (public_name pesy.assets) +) + +(install + (section share_root) + (files + (pesy-package.template.json as template-repo/pesy-package.template.json) + (pesy-gitignore.template as template-repo/pesy-gitignore.template) + (pesy-Util.template.re as template-repo/pesy-Util.template.re) + (pesy-README.template.md as template-repo/pesy-README.template.md) + (pesy-Test.template.re as template-repo/pesy-Test.template.re) + (pesy-App.template.re as template-repo/pesy-App.template.re) + (azure-pipeline-templates/pesy-azure-pipelines.yml as template-repo/azure-pipeline-templates/pesy-azure-pipelines.yml) + (azure-pipeline-templates/pesy-esy-build-steps.template.yml as template-repo/azure-pipeline-templates/pesy-esy-build-steps.template.yml) + (azure-pipeline-templates/pesy-publish-build-cache.yml as template-repo/azure-pipeline-templates/pesy-publish-build-cache.yml) + (azure-pipeline-templates/pesy-restore-build-cache.yml as template-repo/azure-pipeline-templates/pesy-restore-build-cache.yml))) diff --git a/assets/pesy-App.template.re b/assets/pesy-App.template.re new file mode 100644 index 00000000..acdf128a --- /dev/null +++ b/assets/pesy-App.template.re @@ -0,0 +1 @@ +.Util.foo() diff --git a/assets/pesy-README.template.md b/assets/pesy-README.template.md new file mode 100644 index 00000000..9f7e5c63 --- /dev/null +++ b/assets/pesy-README.template.md @@ -0,0 +1,50 @@ +# + + +[![CircleCI](https://circleci.com/gh/yourgithubhandle//tree/master.svg?style=svg)](https://circleci.com/gh/yourgithubhandle//tree/master) + + +**Contains the following libraries and executables:** + +``` +@0.0.0 +│ +├─test/ +│ name: Test.exe +│ main: Test +│ require: +│ +├─library/ +│ library name: +│ namespace: +│ require: +│ +└─executable/ + name: App.exe + main: App + require: +``` + +## Developing: + +``` +npm install -g esy +git clone +esy install +esy build +``` + +## Running Binary: + +After building the project, you can run the main binary that is produced. + +``` +esy x App.exe +``` + +## Running Tests: + +``` +# Runs the "test" command in `package.json`. +esy test +``` diff --git a/assets/pesy-Test.template.re b/assets/pesy-Test.template.re new file mode 100644 index 00000000..c09f8fb9 --- /dev/null +++ b/assets/pesy-Test.template.re @@ -0,0 +1,2 @@ +.Util.foo(); +print_endline("Add Your Test Cases Here"); diff --git a/assets/pesy-Util.template.re b/assets/pesy-Util.template.re new file mode 100644 index 00000000..0e752684 --- /dev/null +++ b/assets/pesy-Util.template.re @@ -0,0 +1 @@ +let foo = () => print_endline("Hello"); diff --git a/assets/pesy-gitignore.template b/assets/pesy-gitignore.template new file mode 100644 index 00000000..ae81586b --- /dev/null +++ b/assets/pesy-gitignore.template @@ -0,0 +1,9 @@ +npm-debug.log +.merlin +yarn-error.log +node_modules/ +_build +_release +.install +.DS_Store +*.install diff --git a/assets/pesy-package.template.json b/assets/pesy-package.template.json new file mode 100644 index 00000000..183f3213 --- /dev/null +++ b/assets/pesy-package.template.json @@ -0,0 +1,42 @@ +{ + "name": "", + "version": "0.0.0", + "description": "My Project", + "esy": { + "build": "dune build -p #{self.name}", + "release": { + "releasedBinaries": [ + "App.exe" + ] + } + }, + "buildDirs": { + "test": { + "require": [""], + "main": "Test", + "name": "Test.exe" + }, + "library": { + "name": "", + "namespace": "" + }, + "executable": { + "require": [""], + "main": "App", + "name": "App.exe" + } + }, + "scripts": { + "test": "esy x Test.exe" + }, + "dependencies": { + "@opam/dune": "*", + "@esy-ocaml/reason": "*", + "refmterr": "*", + "ocaml": "~4.6.0", + "pesy": "*" + }, + "devDependencies": { + "@opam/merlin": "*" + } +} diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..4dd71a49 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,26 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + + +jobs: +- template: .ci/build.yaml # Template reference + parameters: + host: macOS + pool: + vmImage: 'macOS-10.13' + +- template: .ci/build.yaml # Template reference + parameters: + host: Linux + pool: + vmImage: 'Ubuntu-16.04' + +- template: .ci/build.yaml # Template reference + parameters: + host: Windows + pool: + vmImage: 'vs2017-win2016' + sign: true # Extra step on Windows only + diff --git a/bootstrapper/Pesy.re b/bootstrapper/Pesy.re new file mode 100644 index 00000000..d689d6e4 --- /dev/null +++ b/bootstrapper/Pesy.re @@ -0,0 +1,93 @@ +open Printf; + +let userCommand = + if (Array.length(Sys.argv) > 1) { + Some(Sys.argv[1]); + } else { + None; + }; + +/* TODO: prompt user for their choice */ +let projectRoot = Sys.getcwd(); + +/* use readFileOpt to read previously computed directory path */ +printf("Bootstrapping files..."); +flush_all(); +PesyLib.bootstrapIfNecessary(projectRoot); +print_endline("done"); +PesyLib.generateBuildFiles(projectRoot); + +/* @esy-ocaml/foo-package -> foo-package */ +print_endline("Installing deps and building..."); + +let esyCommand = + Sys.unix ? + "esy" : + { + let pathVars = + Array.to_list(Unix.environment()) + |> List.map(e => + switch (Str.split(Str.regexp("="), e)) { + | [k, v, ...rest] => Some((k, v)) + | _ => None + } + ) + |> List.filter( + fun + | None => false + | _ => true, + ) + |> List.filter(e => + switch (e) { + | Some((k, _)) => String.lowercase_ascii(k) == "path" + | _ => false + } + ) + |> List.map( + fun + | Some(x) => x + | None => ("", "") /* Why not filter_map? */ + ); + + let v = + List.fold_right( + (e, acc) => { + let (_, v) = e; + acc ++ (Sys.unix ? ":" : ";") ++ v; + }, + pathVars, + "", + ); + + /* Unix.putenv("PATH", v); /\* This didn't work! *\/ */ + + let paths = Str.split(Str.regexp(Sys.unix ? ":" : ";"), v); + + let npmPaths = + List.filter( + path => Sys.file_exists(Filename.concat(path, "esy.cmd")), + paths, + ); + switch (npmPaths) { + | [] => + fprintf(stderr, "No npm bin path found"); + exit(-1); + | [h, ..._] => Filename.concat(h, "esy.cmd") + }; + }; + +print_endline("Running esy install..."); + +let setupStatus = PesyUtils.runCommandWithEnv(esyCommand, [|"install"|]); +if (setupStatus != 0) { + fprintf(stderr, "esy (%s) install failed!", esyCommand); + exit(-1); +}; + +print_endline("Running esy build..."); +let setupStatus = PesyUtils.runCommandWithEnv(esyCommand, [|"build"|]); +if (setupStatus != 0) { + fprintf(stderr, "esy (%s) build failed!", esyCommand); + exit(-1); +}; +print_endline("You can now run `esy test`"); diff --git a/bootstrapper/dune b/bootstrapper/dune new file mode 100644 index 00000000..f4c9ad32 --- /dev/null +++ b/bootstrapper/dune @@ -0,0 +1,4 @@ +(executable +(name Pesy) +(public_name pesy) +(libraries pesy.lib pesy.utils)) diff --git a/configure/PesyConfigure.re b/configure/PesyConfigure.re new file mode 100644 index 00000000..383877cd --- /dev/null +++ b/configure/PesyConfigure.re @@ -0,0 +1,45 @@ +open PesyUtils; + +let userCommand = + if (Array.length(Sys.argv) > 1) { + Some(Sys.argv[1]); + } else { + None; + }; + +let projectRoot = + switch (Sys.getenv_opt("cur__root")) { + | Some(curRoot) => + /** + * This means the user ran pesy in an esy environment. + * Either as + * 1. esy pesy + * 2. esy b pesy + * 3. esy pesy build + * 4. esy b pesy build + */ + curRoot + | None => + /** + * This mean pesy is being run naked on the shell. + * Either it was: + */ + print_endline("pesy-configure must be run in esy's env"); + exit(0); + }; + +/* use readFileOpt to read previously computed directory path */ +let mode = + PesyLib.Mode.EsyEnv.( + switch (userCommand) { + | _ => UPDATE + } + ); + +switch (mode) { +| UPDATE => + let packageJSONPath = Path.(projectRoot / "package.json"); + PesyLib.PesyConf.gen(projectRoot, packageJSONPath); +}; + +print_endline("Build config updated!"); diff --git a/configure/dune b/configure/dune new file mode 100644 index 00000000..babf4287 --- /dev/null +++ b/configure/dune @@ -0,0 +1,4 @@ +(executable +(name PesyConfigure) +(public_name pesy-configure) +(libraries pesy.lib pesy.utils)) diff --git a/dune b/dune new file mode 100644 index 00000000..4234f609 --- /dev/null +++ b/dune @@ -0,0 +1 @@ +(dirs :standard \ node_modules tmp) diff --git a/dune-project b/dune-project new file mode 100644 index 00000000..1e87df8f --- /dev/null +++ b/dune-project @@ -0,0 +1,2 @@ +(lang dune 1.6) +(name pesy) diff --git a/e2e-tests/.gitignore b/e2e-tests/.gitignore new file mode 100644 index 00000000..527eab15 --- /dev/null +++ b/e2e-tests/.gitignore @@ -0,0 +1,6 @@ +esy.lock +node_modules +_esy +library/dune +executable/dune +test/dune \ No newline at end of file diff --git a/e2e-tests/TestBootstrapper.re b/e2e-tests/TestBootstrapper.re new file mode 100644 index 00000000..ad760380 --- /dev/null +++ b/e2e-tests/TestBootstrapper.re @@ -0,0 +1,152 @@ +open Printf; + +let rimraf = s => + switch (Bos.OS.Dir.delete(~recurse=true, Fpath.v(s))) { + | Ok () => () + | _ => Printf.fprintf(stdout, "Warning: Could not delete %s\n", s) + }; + +let buffer_size = 8192; +let buffer = Bytes.create(buffer_size); + +let runCommandWithEnv = (command, args) => { + let attach = + Unix.create_process_env( + command, + Array.append([|command|], args), + Unix.environment(), + ); + let pid = attach(Unix.stdin, Unix.stdout, Unix.stderr); + switch (Unix.waitpid([], pid)) { + | (_, WEXITED(c)) => c + | (_, WSIGNALED(c)) => c + | (_, WSTOPPED(c)) => c + }; +}; + +let mkdir = (~perms=?, p) => + switch (perms) { + | Some(x) => Unix.mkdir(p, x) + | None => Unix.mkdir(p, 0o755) + }; + +let file_copy = (input_name, output_name) => { + open Unix; + let fd_in = openfile(input_name, [O_RDONLY], 0); + let fd_out = openfile(output_name, [O_WRONLY, O_CREAT, O_TRUNC], 438); + let rec copy_loop = () => + switch (read(fd_in, buffer, 0, buffer_size)) { + | 0 => () + | r => + ignore(write(fd_out, buffer, 0, r)); + copy_loop(); + }; + + copy_loop(); + close(fd_in); + close(fd_out); +}; + +module Path = { + let (/) = Filename.concat; +}; + +let parent = Filename.dirname; + +let tmpDir = Filename.get_temp_dir_name(); +let testProject = "test-project"; +let testProjectDir = Filename.concat(tmpDir, testProject); +let pesyBinPath = "pesy"; + +let esyCommand = + Sys.unix ? + "esy" : + { + let pathVars = + Array.to_list(Unix.environment()) + |> List.map(e => + switch (Str.split(Str.regexp("="), e)) { + | [k, v, ...rest] => Some((k, v)) + | _ => None + } + ) + |> List.filter( + fun + | None => false + | _ => true, + ) + |> List.filter(e => + switch (e) { + | Some((k, _)) => String.lowercase_ascii(k) == "path" + | _ => false + } + ) + |> List.map( + fun + | Some(x) => x + | None => ("", "") /* Why not filter_map? */ + ); + + let v = + List.fold_right( + (e, acc) => { + let (_, v) = e; + acc ++ (Sys.unix ? ":" : ";") ++ v; + }, + pathVars, + "", + ); + + Unix.putenv("PATH", v); + + let paths = Str.split(Str.regexp(Sys.unix ? ":" : ";"), v); + List.iter(print_endline, paths); + let npmPaths = + List.filter( + path => Sys.file_exists(Filename.concat(path, "esy.cmd")), + paths, + ); + switch (npmPaths) { + | [] => + fprintf(stderr, "No npm bin path found"); + exit(-1); + | [h, ..._] => Filename.concat(h, "esy.cmd") + }; + }; + +rimraf(testProjectDir); /* So that we can run it stateless locally */ +mkdir(testProjectDir); +Sys.chdir(testProjectDir); + +let exitStatus = runCommandWithEnv(pesyBinPath, [||]); +if (exitStatus != 0) { + Printf.fprintf( + stderr, + "Test failed: Non zero exit when running bootstrapper", + ); + exit(-1); +}; + +let exitStatus = + runCommandWithEnv(esyCommand, [|"x", "TestProjectApp.exe"|]); + +if (exitStatus != 0) { + Printf.fprintf( + stderr, + "Test failed: Non zero exit when running TestProjectApp.exe\n Code: %d", + exitStatus, + ); + exit(-1); +}; + +let exitStatus = + runCommandWithEnv(esyCommand, [|"x", "TestTestProject.exe"|]); + +if (exitStatus != 0) { + Printf.fprintf( + stderr, + "Test failed: Non zero exit when running TestTestProject.exe\n Code: %d\n", + exitStatus, + ); + exit(-1); +}; diff --git a/e2e-tests/TestPesyConfigure.re b/e2e-tests/TestPesyConfigure.re new file mode 100644 index 00000000..f8f184f6 --- /dev/null +++ b/e2e-tests/TestPesyConfigure.re @@ -0,0 +1,235 @@ +open Printf; + +let rimraf = s => + switch (Bos.OS.Dir.delete(~recurse=true, Fpath.v(s))) { + | Ok () => () + | _ => Printf.fprintf(stdout, "Warning: Could not delete %s\n", s) + }; + +let buffer_size = 8192; +let buffer = Bytes.create(buffer_size); + +let runCommandWithEnv = (command, args) => { + let attach = + Unix.create_process_env( + command, + Array.append([|command|], args), + Unix.environment(), + ); + let pid = attach(Unix.stdin, Unix.stdout, Unix.stderr); + switch (Unix.waitpid([], pid)) { + | (_, WEXITED(c)) => c + | (_, WSIGNALED(c)) => c + | (_, WSTOPPED(c)) => c + }; +}; + +module Path = { + let (/) = Filename.concat; +}; + +let parent = Filename.dirname; + +let file_copy = (input_name, output_name) => { + open Unix; + let fd_in = openfile(input_name, [O_RDONLY], 0); + let fd_out = openfile(output_name, [O_WRONLY, O_CREAT, O_TRUNC], 438); + let rec copy_loop = () => + switch (read(fd_in, buffer, 0, buffer_size)) { + | 0 => () + | r => + ignore(write(fd_out, buffer, 0, r)); + copy_loop(); + }; + + copy_loop(); + close(fd_in); + close(fd_out); +}; + +let set_infos = (filename, infos) => { + open Unix; + utimes(filename, infos.st_atime, infos.st_mtime); + chmod(filename, infos.st_perm); + try (chown(filename, infos.st_uid, infos.st_gid)) { + | Unix_error(EPERM, _, _) => () + }; +}; + +let iter_dir = (f, d) => Sys.readdir(d) |> Array.to_list |> List.iter(f); + +let rec copy_rec = (source, dest) => { + open Unix; + let infos = lstat(source); + switch (infos.st_kind) { + | S_REG => + file_copy(source, dest); + | S_LNK => + let link = readlink(source); + symlink(link, dest); + | S_DIR => + mkdir(dest, 0o755); + iter_dir( + file => + if (file != Filename.current_dir_name + && file != Filename.parent_dir_name) { + copy_rec( + Filename.concat(source, file), + Filename.concat(dest, file), + ); + }, + source, + ); + | _ => prerr_endline("Can't cope with special file " ++ source) + }; +}; + +let tmpDir = Filename.get_temp_dir_name(); +let testProject = "test-project"; +let testProjectDir = Filename.concat(tmpDir, testProject); +let pesyConfigureCommand = Sys.unix ? "pesy-configure": "pesy-configure.cmd"; + +let esyCommand = + Sys.unix ? + "esy" : + { + let pathVars = + Array.to_list(Unix.environment()) + |> List.map(e => + switch (Str.split(Str.regexp("="), e)) { + | [k, v, ...rest] => Some((k, v)) + | _ => None + } + ) + |> List.filter( + fun + | None => false + | _ => true, + ) + |> List.filter(e => + switch (e) { + | Some((k, _)) => String.lowercase_ascii(k) == "path" + | _ => false + } + ) + |> List.map( + fun + | Some(x) => x + | None => ("", "") /* Why not filter_map? */ + ); + + let v = + List.fold_right( + (e, acc) => { + let (_, v) = e; + acc ++ (Sys.unix ? ":" : ";") ++ v; + }, + pathVars, + "", + ); + + Unix.putenv("PATH", v); + + let paths = Str.split(Str.regexp(Sys.unix ? ":" : ";"), v); + List.iter(print_endline, paths); + let npmPaths = + List.filter( + path => Sys.file_exists(Filename.concat(path, "esy.cmd")), + paths, + ); + switch (npmPaths) { + | [] => + fprintf(stderr, "No npm bin path found"); + exit(-1); + | [h, ..._] => Filename.concat(h, "esy.cmd") + }; + }; + +let mkdir = (~perms=?, p) => + switch (perms) { + | Some(x) => Unix.mkdir(p, x) + | None => Unix.mkdir(p, 0o755) + }; + +let tmpDir = Filename.get_temp_dir_name(); +let testDirName = "pesy-configure-test-projects"; +let testDir = Path.(tmpDir / testDirName); + +Printf.printf("Deleting %s", testDir); +print_newline(); +rimraf(testDir); + +let pesyConfigureTestProjectsDir = + Path.(Sys.getcwd() / "e2e-tests" / testDirName); + +Printf.printf("Copying %s to %s", pesyConfigureTestProjectsDir, testDir); +print_newline(); +copy_rec(pesyConfigureTestProjectsDir, testDir); + +let testProjects = + Sys.readdir(testDir) + |> Array.to_list + |> List.filter(dir => + try (Sys.is_directory(Path.(testDir / dir))) { + | Sys_error(e) => false + } + ) + |> List.map(d => Path.(testDir / d)); + +List.iter( + testProject => { + Printf.printf("Entering %s", testProject); + print_newline(); + Sys.chdir(testProject); + + /* So that we can run it stateless locally */ + rimraf(Path.(testProject / "esy.lock")); + rimraf(Path.(testProject / "node_modules")); + rimraf(Path.(testProject / "_esy")); + + Printf.printf("Running `esy install`"); + print_newline(); + let exitStatus = runCommandWithEnv(esyCommand, [|"install"|]); + if (exitStatus != 0) { + Printf.fprintf( + stderr, + "Test failed: Non zero exit when running esy install", + ); + exit(-1); + }; + + Printf.printf("Running `esy pesy-configure`"); + print_newline(); + let exitStatus = runCommandWithEnv(esyCommand, [|pesyConfigureCommand|]); + if (exitStatus != 0) { + Printf.fprintf( + stderr, + "Test failed: Non zero exit when running esy pesy-configure", + ); + exit(-1); + }; + + Printf.printf("Running `esy build`"); + print_newline(); + let exitStatus = runCommandWithEnv(esyCommand, [|"build"|]); + if (exitStatus != 0) { + Printf.fprintf( + stderr, + "Test failed: Non zero exit when running esy build", + ); + exit(-1); + }; + + Printf.printf("Running `esy test`"); + print_newline(); + let exitStatus = runCommandWithEnv(esyCommand, [|"test"|]); + if (exitStatus != 0) { + Printf.fprintf( + stderr, + "Test failed: Non zero exit when running esy test", + ); + exit(-1); + }; + }, + testProjects, +); diff --git a/e2e-tests/dune b/e2e-tests/dune new file mode 100644 index 00000000..7cf01b05 --- /dev/null +++ b/e2e-tests/dune @@ -0,0 +1,6 @@ +(executables +(names TestBootstrapper TestPesyConfigure) +(public_names TestBootstrapper.exe TestPesyConfigure.exe) +(libraries unix pesy.lib bos fpath)) + +(data_only_dirs pesy-configure-test-projects) diff --git a/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/.gitignore b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/.gitignore new file mode 100644 index 00000000..8119574c --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/.gitignore @@ -0,0 +1,11 @@ +npm-debug.log +.merlin +yarn-error.log +node_modules +node_modules/ +_build +_release +_esy/ +y.install +.DS_Store +*.install diff --git a/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/dune b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/dune new file mode 100644 index 00000000..c8e261a1 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/dune @@ -0,0 +1 @@ +(dirs (:standard \ node_modules \ _esy)) \ No newline at end of file diff --git a/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/dune-project b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/dune-project new file mode 100644 index 00000000..1d19c4a0 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/dune-project @@ -0,0 +1,2 @@ +(lang dune 1.6) + (name pesy-c-stubs) \ No newline at end of file diff --git a/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/executable/PesyCStubsApp.re b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/executable/PesyCStubsApp.re new file mode 100644 index 00000000..8f680d27 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/executable/PesyCStubsApp.re @@ -0,0 +1 @@ +PesyCStubs.Util.foo(5); diff --git a/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/library/Util.re b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/library/Util.re new file mode 100644 index 00000000..71958da0 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/library/Util.re @@ -0,0 +1,2 @@ +external foo: int => unit = "caml_foo"; + diff --git a/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/library/stubs.c b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/library/stubs.c new file mode 100644 index 00000000..faec4598 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/library/stubs.c @@ -0,0 +1,9 @@ +#include +#include + +CAMLprim value +caml_foo(value a) { + int c_a = Int_val(a); + printf("foo received: %d", c_a); + return Val_unit; +} diff --git a/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/package.json b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/package.json new file mode 100644 index 00000000..52d4b142 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/package.json @@ -0,0 +1,44 @@ +{ + "name": "pesy-c-stubs", + "version": "0.0.0", + "description": "My Project", + "esy": { + "build": "dune build -p #{self.name}", + "release": { + "releasedBinaries": [ + "PesyCStubsApp.exe" + ] + } + }, + "buildDirs": { + "test": { + "require": ["pesy-c-stubs.lib"], + "main": "TestPesyCStubs", + "name": "TestPesyCStubs.exe" + }, + "library": { + "name": "pesy-c-stubs.lib", + "cNames": ["stubs"], + "namespace": "PesyCStubs" + }, + "executable": { + "require": ["pesy-c-stubs.lib"], + "main": "PesyCStubsApp", + "name": "PesyCStubsApp.exe" + } + }, + "scripts": { + "pesy": "bash -c 'env PESY_MODE=update pesy'", + "test": "esy x TestPesyCStubs.exe" + }, + "dependencies": { + "@opam/dune": ">=1.6.0", + "@esy-ocaml/reason": "*", + "refmterr": "*", + "ocaml": "^4.4.0", + "pesy": "*" + }, + "devDependencies": { + "@opam/merlin": "*" + } +} diff --git a/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/pesy-c-stubs.opam b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/pesy-c-stubs.opam new file mode 100644 index 00000000..e69de29b diff --git a/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/test/TestPesyCStubs.re b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/test/TestPesyCStubs.re new file mode 100644 index 00000000..3823115e --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-c-stubs/test/TestPesyCStubs.re @@ -0,0 +1,2 @@ +PesyCStubs.Util.foo(77); +print_endline("Add Your Test Cases Here"); diff --git a/e2e-tests/pesy-configure-test-projects/pesy-flags/dune b/e2e-tests/pesy-configure-test-projects/pesy-flags/dune new file mode 100644 index 00000000..c8e261a1 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-flags/dune @@ -0,0 +1 @@ +(dirs (:standard \ node_modules \ _esy)) \ No newline at end of file diff --git a/e2e-tests/pesy-configure-test-projects/pesy-flags/dune-project b/e2e-tests/pesy-configure-test-projects/pesy-flags/dune-project new file mode 100644 index 00000000..709d7531 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-flags/dune-project @@ -0,0 +1,2 @@ +(lang dune 1.6) + (name pesy-flags) \ No newline at end of file diff --git a/e2e-tests/pesy-configure-test-projects/pesy-flags/executable/PesyFlagsApp.re b/e2e-tests/pesy-configure-test-projects/pesy-flags/executable/PesyFlagsApp.re new file mode 100644 index 00000000..22bb7605 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-flags/executable/PesyFlagsApp.re @@ -0,0 +1 @@ +PesyFlags.Util.foo(); diff --git a/e2e-tests/pesy-configure-test-projects/pesy-flags/library/Util.re b/e2e-tests/pesy-configure-test-projects/pesy-flags/library/Util.re new file mode 100644 index 00000000..0e752684 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-flags/library/Util.re @@ -0,0 +1 @@ +let foo = () => print_endline("Hello"); diff --git a/e2e-tests/pesy-configure-test-projects/pesy-flags/package.json b/e2e-tests/pesy-configure-test-projects/pesy-flags/package.json new file mode 100644 index 00000000..720add7d --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-flags/package.json @@ -0,0 +1,44 @@ +{ + "name": "pesy-flags", + "version": "0.0.0", + "description": "My Project", + "esy": { + "build": "dune build -p #{self.name}", + "release": { + "releasedBinaries": [ + "PesyFlagsApp.exe" + ] + } + }, + "buildDirs": { + "test": { + "require": ["pesy-flags.lib"], + "main": "TestPesyFlags", + "name": "TestPesyFlags.exe" + }, + "library": { + "name": "pesy-flags.lib", + "namespace": "PesyFlags", + "flags": [ "-color", "always"] + }, + "executable": { + "require": ["pesy-flags.lib"], + "main": "PesyFlagsApp", + "name": "PesyFlagsApp.exe" + } + }, + "scripts": { + "pesy": "bash -c 'env PESY_MODE=update pesy'", + "test": "esy x TestPesyFlags.exe" + }, + "dependencies": { + "@opam/dune": ">=1.6.0", + "@esy-ocaml/reason": "*", + "refmterr": "*", + "ocaml": "^4.4.0", + "pesy": "*" + }, + "devDependencies": { + "@opam/merlin": "*" + } +} diff --git a/e2e-tests/pesy-configure-test-projects/pesy-flags/pesy-flags.opam b/e2e-tests/pesy-configure-test-projects/pesy-flags/pesy-flags.opam new file mode 100644 index 00000000..e69de29b diff --git a/e2e-tests/pesy-configure-test-projects/pesy-flags/test/TestPesyFlags.re b/e2e-tests/pesy-configure-test-projects/pesy-flags/test/TestPesyFlags.re new file mode 100644 index 00000000..02e74fde --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-flags/test/TestPesyFlags.re @@ -0,0 +1,2 @@ +PesyFlags.Util.foo(); +print_endline("Add Your Test Cases Here"); diff --git a/e2e-tests/pesy-configure-test-projects/pesy-modes/.gitignore b/e2e-tests/pesy-configure-test-projects/pesy-modes/.gitignore new file mode 100644 index 00000000..cb44ea94 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-modes/.gitignore @@ -0,0 +1,11 @@ +npm-debug.log +.merlin +yarn-error.log +node_modules +node_modules/ +_build +_release +_esy/ +pesy-mode.install +.DS_Store +*.install diff --git a/e2e-tests/pesy-configure-test-projects/pesy-modes/dune b/e2e-tests/pesy-configure-test-projects/pesy-modes/dune new file mode 100644 index 00000000..c8e261a1 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-modes/dune @@ -0,0 +1 @@ +(dirs (:standard \ node_modules \ _esy)) \ No newline at end of file diff --git a/e2e-tests/pesy-configure-test-projects/pesy-modes/dune-project b/e2e-tests/pesy-configure-test-projects/pesy-modes/dune-project new file mode 100644 index 00000000..0dc1ccaa --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-modes/dune-project @@ -0,0 +1,2 @@ +(lang dune 1.6) + (name pesy-mode) \ No newline at end of file diff --git a/e2e-tests/pesy-configure-test-projects/pesy-modes/executable/PesyModeApp.re b/e2e-tests/pesy-configure-test-projects/pesy-modes/executable/PesyModeApp.re new file mode 100644 index 00000000..7e387eab --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-modes/executable/PesyModeApp.re @@ -0,0 +1 @@ +PesyMode.Util.foo(); diff --git a/e2e-tests/pesy-configure-test-projects/pesy-modes/library/Util.re b/e2e-tests/pesy-configure-test-projects/pesy-modes/library/Util.re new file mode 100644 index 00000000..0e752684 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-modes/library/Util.re @@ -0,0 +1 @@ +let foo = () => print_endline("Hello"); diff --git a/e2e-tests/pesy-configure-test-projects/pesy-modes/package.json b/e2e-tests/pesy-configure-test-projects/pesy-modes/package.json new file mode 100644 index 00000000..35f7f496 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-modes/package.json @@ -0,0 +1,47 @@ +{ + "name": "pesy-mode", + "version": "0.0.0", + "description": "My Project", + "esy": { + "build": "dune build -p #{self.name}", + "buildsInSource": "_build", + "release": { + "releasedBinaries": [ + "PesyModeApp.exe" + ] + } + }, + "buildDirs": { + "test": { + "require": ["pesy-mode.lib"], + "main": "TestPesyMode", + "name": "TestPesyMode.exe", + "modes": ["byte", "exe"] + }, + "library": { + "name": "pesy-mode.lib", + "namespace": "PesyMode", + "modes": ["byte"] + }, + "executable": { + "require": ["pesy-mode.lib"], + "main": "PesyModeApp", + "name": "PesyModeApp.exe", + "modes": ["byte", "exe"] + } + }, + "scripts": { + "pesy": "bash -c 'env PESY_MODE=update pesy'", + "test": "esy x TestPesyMode.exe" + }, + "dependencies": { + "@opam/dune": ">=1.6.0", + "@esy-ocaml/reason": "*", + "refmterr": "*", + "ocaml": "^4.4.0", + "pesy": "*" + }, + "devDependencies": { + "@opam/merlin": "*" + } +} diff --git a/e2e-tests/pesy-configure-test-projects/pesy-modes/pesy-mode.opam b/e2e-tests/pesy-configure-test-projects/pesy-modes/pesy-mode.opam new file mode 100644 index 00000000..e69de29b diff --git a/e2e-tests/pesy-configure-test-projects/pesy-modes/test/TestPesyMode.re b/e2e-tests/pesy-configure-test-projects/pesy-modes/test/TestPesyMode.re new file mode 100644 index 00000000..28bfcc43 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-modes/test/TestPesyMode.re @@ -0,0 +1,2 @@ +PesyMode.Util.foo(); +print_endline("Add Your Test Cases Here"); diff --git a/e2e-tests/pesy-configure-test-projects/pesy-preprocess/.gitignore b/e2e-tests/pesy-configure-test-projects/pesy-preprocess/.gitignore new file mode 100644 index 00000000..d20814af --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-preprocess/.gitignore @@ -0,0 +1,11 @@ +npm-debug.log +.merlin +yarn-error.log +node_modules +node_modules/ +_build +_release +_esy/ +pesy-preprocess.install +.DS_Store +*.install diff --git a/e2e-tests/pesy-configure-test-projects/pesy-preprocess/dune b/e2e-tests/pesy-configure-test-projects/pesy-preprocess/dune new file mode 100644 index 00000000..c8e261a1 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-preprocess/dune @@ -0,0 +1 @@ +(dirs (:standard \ node_modules \ _esy)) \ No newline at end of file diff --git a/e2e-tests/pesy-configure-test-projects/pesy-preprocess/dune-project b/e2e-tests/pesy-configure-test-projects/pesy-preprocess/dune-project new file mode 100644 index 00000000..82cbbf1c --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-preprocess/dune-project @@ -0,0 +1,2 @@ +(lang dune 1.6) + (name pesy-preprocess) \ No newline at end of file diff --git a/e2e-tests/pesy-configure-test-projects/pesy-preprocess/executable/PesyPreprocessApp.re b/e2e-tests/pesy-configure-test-projects/pesy-preprocess/executable/PesyPreprocessApp.re new file mode 100644 index 00000000..7054443b --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-preprocess/executable/PesyPreprocessApp.re @@ -0,0 +1,5 @@ +open Lwt; +PesyPreprocess.Util.foo(); + +let%lwt foo = Lwt.return("world"); +print_endline(foo); diff --git a/e2e-tests/pesy-configure-test-projects/pesy-preprocess/library/Util.re b/e2e-tests/pesy-configure-test-projects/pesy-preprocess/library/Util.re new file mode 100644 index 00000000..0e752684 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-preprocess/library/Util.re @@ -0,0 +1 @@ +let foo = () => print_endline("Hello"); diff --git a/e2e-tests/pesy-configure-test-projects/pesy-preprocess/package.json b/e2e-tests/pesy-configure-test-projects/pesy-preprocess/package.json new file mode 100644 index 00000000..bda2aceb --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-preprocess/package.json @@ -0,0 +1,40 @@ +{ + "name": "pesy-preprocess", + "version": "0.0.0", + "description": "My Project", + "esy": { + "build": "dune build -p #{self.name}", + "release": { "releasedBinaries": [ "PesyPreprocessApp.exe" ] } + }, + "buildDirs": { + "test": { + "require": [ "pesy-preprocess.lib" ], + "main": "TestPesyPreprocess", + "name": "TestPesyPreprocess.exe" + }, + "library": { + "name": "pesy-preprocess.lib", + "namespace": "PesyPreprocess" + }, + "executable": { + "require": [ "lwt", "lwt.unix", "pesy-preprocess.lib" ], + "main": "PesyPreprocessApp", + "name": "PesyPreprocessApp.exe", + "preprocess": [ "pps", "lwt_ppx" ] + } + }, + "scripts": { + "pesy": "bash -c 'env PESY_MODE=update pesy'", + "test": "esy x TestPesyPreprocess.exe" + }, + "dependencies": { + "@esy-ocaml/reason": "*", + "@opam/dune": ">=1.6.0", + "@opam/lwt": "4.1.0", + "@opam/lwt_ppx": "1.2.1", + "ocaml": "^4.4.0", + "pesy": "*", + "refmterr": "*" + }, + "devDependencies": { "@opam/merlin": "*" } +} diff --git a/e2e-tests/pesy-configure-test-projects/pesy-preprocess/pesy-preprocess.opam b/e2e-tests/pesy-configure-test-projects/pesy-preprocess/pesy-preprocess.opam new file mode 100644 index 00000000..e69de29b diff --git a/e2e-tests/pesy-configure-test-projects/pesy-preprocess/test/TestPesyPreprocess.re b/e2e-tests/pesy-configure-test-projects/pesy-preprocess/test/TestPesyPreprocess.re new file mode 100644 index 00000000..e09e32bb --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/pesy-preprocess/test/TestPesyPreprocess.re @@ -0,0 +1,2 @@ +PesyPreprocess.Util.foo(); +print_endline("Add Your Test Cases Here"); diff --git a/e2e-tests/pesy-configure-test-projects/raw/dune b/e2e-tests/pesy-configure-test-projects/raw/dune new file mode 100644 index 00000000..c8e261a1 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/raw/dune @@ -0,0 +1 @@ +(dirs (:standard \ node_modules \ _esy)) \ No newline at end of file diff --git a/e2e-tests/pesy-configure-test-projects/raw/dune-project b/e2e-tests/pesy-configure-test-projects/raw/dune-project new file mode 100644 index 00000000..59f619d8 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/raw/dune-project @@ -0,0 +1,2 @@ +(lang dune 1.6) + (name raw) \ No newline at end of file diff --git a/e2e-tests/pesy-configure-test-projects/raw/executable/RawApp.re b/e2e-tests/pesy-configure-test-projects/raw/executable/RawApp.re new file mode 100644 index 00000000..8a3275fa --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/raw/executable/RawApp.re @@ -0,0 +1,4 @@ +let ic = open_in(Filename.dirname(Sys.argv[0]) ++ "/../share/asset.txt"); +let line = input_line(ic); +let%lwt foo = Lwt.return(line); +print_endline(foo); diff --git a/e2e-tests/pesy-configure-test-projects/raw/library/Util.re b/e2e-tests/pesy-configure-test-projects/raw/library/Util.re new file mode 100644 index 00000000..0e752684 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/raw/library/Util.re @@ -0,0 +1 @@ +let foo = () => print_endline("Hello"); diff --git a/e2e-tests/pesy-configure-test-projects/raw/package.json b/e2e-tests/pesy-configure-test-projects/raw/package.json new file mode 100644 index 00000000..027a5d48 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/raw/package.json @@ -0,0 +1,46 @@ +{ + "name": "raw", + "version": "0.0.0", + "description": "My Project", + "esy": { + "build": "dune build -p #{self.name}", + "release": { "releasedBinaries": [ "RawApp.exe" ] } + }, + "buildDirs": { + "test": { + "require": [ "raw.lib" ], + "main": "TestRaw", + "name": "TestRaw.exe" + }, + "library": { + "name": "raw.lib", + "namespace": "Raw" + }, + "executable": { + "main": "RawApp", + "name": "RawApp.exe", + "rawBuildConfig": [ + "(libraries lwt lwt.unix raw.lib)", + "(preprocess (pps lwt_ppx))" + ] + }, + "share": { + "namespace": "RawAssets", + "name": "raw.assets", + "rawBuildConfigFooter": [ + "(install (section share_root) (files (asset.txt as asset.txt)))" + ] + } + }, + "scripts": { "test": "esy x TestRaw.exe" }, + "dependencies": { + "@esy-ocaml/reason": "*", + "@opam/dune": "*", + "@opam/lwt": "4.1.0", + "@opam/lwt_ppx": "1.2.1", + "ocaml": "^4.4.0", + "pesy": "*", + "refmterr": "*" + }, + "devDependencies": { "@opam/merlin": "*" } +} diff --git a/e2e-tests/pesy-configure-test-projects/raw/raw.opam b/e2e-tests/pesy-configure-test-projects/raw/raw.opam new file mode 100644 index 00000000..e69de29b diff --git a/e2e-tests/pesy-configure-test-projects/raw/share/asset.txt b/e2e-tests/pesy-configure-test-projects/raw/share/asset.txt new file mode 100644 index 00000000..5409a4c4 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/raw/share/asset.txt @@ -0,0 +1 @@ +Just an asset diff --git a/e2e-tests/pesy-configure-test-projects/raw/test/TestRaw.re b/e2e-tests/pesy-configure-test-projects/raw/test/TestRaw.re new file mode 100644 index 00000000..f7c3cc11 --- /dev/null +++ b/e2e-tests/pesy-configure-test-projects/raw/test/TestRaw.re @@ -0,0 +1,2 @@ +Raw.Util.foo(); +print_endline("Add Your Test Cases Here"); diff --git a/esy.lock/.gitattributes b/esy.lock/.gitattributes new file mode 100644 index 00000000..25366aee --- /dev/null +++ b/esy.lock/.gitattributes @@ -0,0 +1,3 @@ + +# Set eol to LF so files aren't converted to CRLF-eol on Windows. +* text eol=lf diff --git a/esy.lock/.gitignore b/esy.lock/.gitignore new file mode 100644 index 00000000..a221be22 --- /dev/null +++ b/esy.lock/.gitignore @@ -0,0 +1,3 @@ + +# Reset any possible .gitignore, we want all esy.lock to be un-ignored. +!* diff --git a/esy.lock/index.json b/esy.lock/index.json new file mode 100644 index 00000000..85004587 --- /dev/null +++ b/esy.lock/index.json @@ -0,0 +1,1381 @@ +{ + "checksum": "8c05b6b0482ea3c6a5bab9acd0f05224", + "root": "pesy@link-dev:./package.json", + "node": { + "refmterr@3.1.10@d41d8cd9": { + "id": "refmterr@3.1.10@d41d8cd9", + "name": "refmterr", + "version": "3.1.10", + "source": { + "type": "install", + "source": [ + "archive:https://registry.npmjs.org/refmterr/-/refmterr-3.1.10.tgz#sha1:7c3e238022acb5de4e2254ab506d70eee13c0a46" + ] + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/re@opam:1.7.3@83095efd", + "@opam/dune@opam:1.6.3@a7d7baed", "@esy-ocaml/reason@3.4.0@d41d8cd9" + ], + "devDependencies": [] + }, + "pesy@link-dev:./package.json": { + "id": "pesy@link-dev:./package.json", + "name": "pesy", + "version": "link-dev:./package.json", + "source": { + "type": "link-dev", + "path": ".", + "manifest": "package.json" + }, + "overrides": [], + "dependencies": [ + "refmterr@3.1.10@d41d8cd9", "ocaml@4.6.9@d41d8cd9", + "@opam/yojson@opam:1.4.1@975f5bbf", + "@opam/sexplib@opam:v0.11.0@bf5282c9", + "@opam/ppx_inline_test@opam:v0.11.0@b987f92a", + "@opam/ppx_expect@opam:v0.11.1@406d6035", + "@opam/fpath@opam:0.7.2@45477b93", "@opam/dune@opam:1.6.3@a7d7baed", + "@opam/bos@opam:0.2.0@df49e63f", "@esy-ocaml/reason@3.4.0@d41d8cd9" + ], + "devDependencies": [ "@opam/merlin@opam:3.2.2@829ee6dd" ] + }, + "ocaml@4.6.9@d41d8cd9": { + "id": "ocaml@4.6.9@d41d8cd9", + "name": "ocaml", + "version": "4.6.9", + "source": { + "type": "install", + "source": [ + "archive:https://registry.npmjs.org/ocaml/-/ocaml-4.6.9.tgz#sha1:4561135b32f59a5bafa8e91019a58515508d6e4c" + ] + }, + "overrides": [], + "dependencies": [], + "devDependencies": [] + }, + "@opam/yojson@opam:1.4.1@975f5bbf": { + "id": "@opam/yojson@opam:1.4.1@975f5bbf", + "name": "@opam/yojson", + "version": "opam:1.4.1", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/3e/3ea6e36422dd670e8ab880710d5f7398#md5:3ea6e36422dd670e8ab880710d5f7398", + "archive:https://github.com/mjambon/yojson/archive/v1.4.1.tar.gz#md5:3ea6e36422dd670e8ab880710d5f7398" + ], + "opam": { + "name": "yojson", + "version": "1.4.1", + "path": "esy.lock/opam/yojson.1.4.1" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/jbuilder@opam:transition@58bdfe0a", + "@opam/easy-format@opam:1.3.1@9abfd4ed", + "@opam/cppo@opam:1.6.5@bec3dbd9", "@opam/biniou@opam:1.2.0@c8516f18", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/easy-format@opam:1.3.1@9abfd4ed", + "@opam/biniou@opam:1.2.0@c8516f18" + ] + }, + "@opam/variantslib@opam:v0.11.0@141b8c3e": { + "id": "@opam/variantslib@opam:v0.11.0@141b8c3e", + "name": "@opam/variantslib", + "version": "opam:v0.11.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/30/3031317975df165cc3154578680eddfb#md5:3031317975df165cc3154578680eddfb", + "archive:https://ocaml.janestreet.com/ocaml-core/v0.11/files/variantslib-v0.11.0.tar.gz#md5:3031317975df165cc3154578680eddfb" + ], + "opam": { + "name": "variantslib", + "version": "v0.11.0", + "path": "esy.lock/opam/variantslib.v0.11.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/jbuilder@opam:transition@58bdfe0a", + "@opam/base@opam:v0.11.1@0e54024e", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/base@opam:v0.11.1@0e54024e" + ] + }, + "@opam/uchar@opam:0.0.2@c8218eea": { + "id": "@opam/uchar@opam:0.0.2@c8218eea", + "name": "@opam/uchar", + "version": "opam:0.0.2", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/c9/c9ba2c738d264c420c642f7bb1cf4a36#md5:c9ba2c738d264c420c642f7bb1cf4a36", + "archive:https://github.com/ocaml/uchar/releases/download/v0.0.2/uchar-0.0.2.tbz#md5:c9ba2c738d264c420c642f7bb1cf4a36" + ], + "opam": { + "name": "uchar", + "version": "0.0.2", + "path": "esy.lock/opam/uchar.0.0.2" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ocamlbuild@opam:0.12.0@6c616094", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ "ocaml@4.6.9@d41d8cd9" ] + }, + "@opam/topkg@opam:1.0.0@61f4ccf9": { + "id": "@opam/topkg@opam:1.0.0@61f4ccf9", + "name": "@opam/topkg", + "version": "opam:1.0.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/e3/e3d76bda06bf68cb5853caf6627da603#md5:e3d76bda06bf68cb5853caf6627da603", + "archive:http://erratique.ch/software/topkg/releases/topkg-1.0.0.tbz#md5:e3d76bda06bf68cb5853caf6627da603" + ], + "opam": { + "name": "topkg", + "version": "1.0.0", + "path": "esy.lock/opam/topkg.1.0.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/result@opam:1.3@bee8bf2e", + "@opam/ocamlfind@opam:1.8.0@96572762", + "@opam/ocamlbuild@opam:0.12.0@6c616094", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/result@opam:1.3@bee8bf2e", + "@opam/ocamlbuild@opam:0.12.0@6c616094" + ] + }, + "@opam/stdio@opam:v0.11.0@3b11cb88": { + "id": "@opam/stdio@opam:v0.11.0@3b11cb88", + "name": "@opam/stdio", + "version": "opam:v0.11.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/2d/2db42ee38c91b3ff7126c2634c407b99#md5:2db42ee38c91b3ff7126c2634c407b99", + "archive:https://ocaml.janestreet.com/ocaml-core/v0.11/files/stdio-v0.11.0.tar.gz#md5:2db42ee38c91b3ff7126c2634c407b99" + ], + "opam": { + "name": "stdio", + "version": "v0.11.0", + "path": "esy.lock/opam/stdio.v0.11.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/jbuilder@opam:transition@58bdfe0a", + "@opam/base@opam:v0.11.1@0e54024e", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/base@opam:v0.11.1@0e54024e" + ] + }, + "@opam/sexplib0@opam:v0.11.0@9df6bcd1": { + "id": "@opam/sexplib0@opam:v0.11.0@9df6bcd1", + "name": "@opam/sexplib0", + "version": "opam:v0.11.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/1c/1c14ba30b471e49f1b23fea5ff99ea6b#md5:1c14ba30b471e49f1b23fea5ff99ea6b", + "archive:https://ocaml.janestreet.com/ocaml-core/v0.11/files/sexplib0-v0.11.0.tar.gz#md5:1c14ba30b471e49f1b23fea5ff99ea6b" + ], + "opam": { + "name": "sexplib0", + "version": "v0.11.0", + "path": "esy.lock/opam/sexplib0.v0.11.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/jbuilder@opam:transition@58bdfe0a", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ "ocaml@4.6.9@d41d8cd9" ] + }, + "@opam/sexplib@opam:v0.11.0@bf5282c9": { + "id": "@opam/sexplib@opam:v0.11.0@bf5282c9", + "name": "@opam/sexplib", + "version": "opam:v0.11.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/1d/1d53d945914b6b9a380dc8923f19e9ae#md5:1d53d945914b6b9a380dc8923f19e9ae", + "archive:https://ocaml.janestreet.com/ocaml-core/v0.11/files/sexplib-v0.11.0.tar.gz#md5:1d53d945914b6b9a380dc8923f19e9ae" + ], + "opam": { + "name": "sexplib", + "version": "v0.11.0", + "path": "esy.lock/opam/sexplib.v0.11.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/sexplib0@opam:v0.11.0@9df6bcd1", + "@opam/parsexp@opam:v0.11.0@7febd99d", "@opam/num@opam:1.1@dcdca088", + "@opam/jbuilder@opam:transition@58bdfe0a", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/sexplib0@opam:v0.11.0@9df6bcd1", + "@opam/parsexp@opam:v0.11.0@7febd99d", "@opam/num@opam:1.1@dcdca088" + ] + }, + "@opam/rresult@opam:0.6.0@4b185e72": { + "id": "@opam/rresult@opam:0.6.0@4b185e72", + "name": "@opam/rresult", + "version": "opam:0.6.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/ab/aba88cffa29081714468c2c7bcdf7fb1#md5:aba88cffa29081714468c2c7bcdf7fb1", + "archive:http://erratique.ch/software/rresult/releases/rresult-0.6.0.tbz#md5:aba88cffa29081714468c2c7bcdf7fb1" + ], + "opam": { + "name": "rresult", + "version": "0.6.0", + "path": "esy.lock/opam/rresult.0.6.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/topkg@opam:1.0.0@61f4ccf9", + "@opam/result@opam:1.3@bee8bf2e", + "@opam/ocamlfind@opam:1.8.0@96572762", + "@opam/ocamlbuild@opam:0.12.0@6c616094", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/result@opam:1.3@bee8bf2e" + ] + }, + "@opam/result@opam:1.3@bee8bf2e": { + "id": "@opam/result@opam:1.3@bee8bf2e", + "name": "@opam/result", + "version": "opam:1.3", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/4b/4beebefd41f7f899b6eeba7414e7ae01#md5:4beebefd41f7f899b6eeba7414e7ae01", + "archive:https://github.com/janestreet/result/releases/download/1.3/result-1.3.tbz#md5:4beebefd41f7f899b6eeba7414e7ae01" + ], + "opam": { + "name": "result", + "version": "1.3", + "path": "esy.lock/opam/result.1.3" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/jbuilder@opam:transition@58bdfe0a", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ "ocaml@4.6.9@d41d8cd9" ] + }, + "@opam/re@opam:1.7.3@83095efd": { + "id": "@opam/re@opam:1.7.3@83095efd", + "name": "@opam/re", + "version": "opam:1.7.3", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/d2/d2a74ca77216861bce4449600a132de9#md5:d2a74ca77216861bce4449600a132de9", + "archive:https://github.com/ocaml/ocaml-re/releases/download/1.7.3/re-1.7.3.tbz#md5:d2a74ca77216861bce4449600a132de9" + ], + "opam": { + "name": "re", + "version": "1.7.3", + "path": "esy.lock/opam/re.1.7.3" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/jbuilder@opam:transition@58bdfe0a", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ "ocaml@4.6.9@d41d8cd9" ] + }, + "@opam/ppxlib@opam:0.5.0@e35e68bb": { + "id": "@opam/ppxlib@opam:0.5.0@e35e68bb", + "name": "@opam/ppxlib", + "version": "opam:0.5.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/bb/bb278ff6e819e0e4a4d8a005bb2512a4#md5:bb278ff6e819e0e4a4d8a005bb2512a4", + "archive:https://github.com/ocaml-ppx/ppxlib/releases/download/0.5.0/ppxlib-0.5.0.tbz#md5:bb278ff6e819e0e4a4d8a005bb2512a4" + ], + "opam": { + "name": "ppxlib", + "version": "0.5.0", + "path": "esy.lock/opam/ppxlib.0.5.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/stdio@opam:v0.11.0@3b11cb88", + "@opam/ppx_derivers@opam:1.0@78655ff8", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/ocaml-compiler-libs@opam:v0.11.0@7e9ced39", + "@opam/dune@opam:1.6.3@a7d7baed", "@opam/base@opam:v0.11.1@0e54024e", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/stdio@opam:v0.11.0@3b11cb88", + "@opam/ppx_derivers@opam:1.0@78655ff8", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/ocaml-compiler-libs@opam:v0.11.0@7e9ced39", + "@opam/base@opam:v0.11.1@0e54024e" + ] + }, + "@opam/ppx_variants_conv@opam:v0.11.1@32a56a8b": { + "id": "@opam/ppx_variants_conv@opam:v0.11.1@32a56a8b", + "name": "@opam/ppx_variants_conv", + "version": "opam:v0.11.1", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/14/146b49b84315b7d67c1ca758fcbf2fb2#md5:146b49b84315b7d67c1ca758fcbf2fb2", + "archive:https://github.com/janestreet/ppx_variants_conv/archive/v0.11.1.tar.gz#md5:146b49b84315b7d67c1ca758fcbf2fb2" + ], + "opam": { + "name": "ppx_variants_conv", + "version": "v0.11.1", + "path": "esy.lock/opam/ppx_variants_conv.v0.11.1" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/variantslib@opam:v0.11.0@141b8c3e", + "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/jbuilder@opam:transition@58bdfe0a", + "@opam/base@opam:v0.11.1@0e54024e", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/variantslib@opam:v0.11.0@141b8c3e", + "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/base@opam:v0.11.1@0e54024e" + ] + }, + "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527": { + "id": "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", + "name": "@opam/ppx_sexp_conv", + "version": "opam:v0.11.2", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/77/77d3b30b3d9c5810552bde2027656b8d#md5:77d3b30b3d9c5810552bde2027656b8d", + "archive:https://github.com/janestreet/ppx_sexp_conv/archive/v0.11.2.tar.gz#md5:77d3b30b3d9c5810552bde2027656b8d" + ], + "opam": { + "name": "ppx_sexp_conv", + "version": "v0.11.2", + "path": "esy.lock/opam/ppx_sexp_conv.v0.11.2" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/jbuilder@opam:transition@58bdfe0a", + "@opam/base@opam:v0.11.1@0e54024e", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/base@opam:v0.11.1@0e54024e" + ] + }, + "@opam/ppx_inline_test@opam:v0.11.0@b987f92a": { + "id": "@opam/ppx_inline_test@opam:v0.11.0@b987f92a", + "name": "@opam/ppx_inline_test", + "version": "opam:v0.11.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/1f/1f2e014332373638696d8893d87f4682#md5:1f2e014332373638696d8893d87f4682", + "archive:https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_inline_test-v0.11.0.tar.gz#md5:1f2e014332373638696d8893d87f4682" + ], + "opam": { + "name": "ppx_inline_test", + "version": "v0.11.0", + "path": "esy.lock/opam/ppx_inline_test.v0.11.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/jbuilder@opam:transition@58bdfe0a", + "@opam/base@opam:v0.11.1@0e54024e", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/base@opam:v0.11.1@0e54024e" + ] + }, + "@opam/ppx_here@opam:v0.11.0@c36c7116": { + "id": "@opam/ppx_here@opam:v0.11.0@c36c7116", + "name": "@opam/ppx_here", + "version": "opam:v0.11.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/47/479c9cd5f6ef90c2df9f01eab9d6c91d#md5:479c9cd5f6ef90c2df9f01eab9d6c91d", + "archive:https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_here-v0.11.0.tar.gz#md5:479c9cd5f6ef90c2df9f01eab9d6c91d" + ], + "opam": { + "name": "ppx_here", + "version": "v0.11.0", + "path": "esy.lock/opam/ppx_here.v0.11.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/jbuilder@opam:transition@58bdfe0a", + "@opam/base@opam:v0.11.1@0e54024e", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/base@opam:v0.11.1@0e54024e" + ] + }, + "@opam/ppx_fields_conv@opam:v0.11.0@13fd6109": { + "id": "@opam/ppx_fields_conv@opam:v0.11.0@13fd6109", + "name": "@opam/ppx_fields_conv", + "version": "opam:v0.11.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/72/72f207c23d65f7f3eaabcc92e33ccdab#md5:72f207c23d65f7f3eaabcc92e33ccdab", + "archive:https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_fields_conv-v0.11.0.tar.gz#md5:72f207c23d65f7f3eaabcc92e33ccdab" + ], + "opam": { + "name": "ppx_fields_conv", + "version": "v0.11.0", + "path": "esy.lock/opam/ppx_fields_conv.v0.11.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/jbuilder@opam:transition@58bdfe0a", + "@opam/fieldslib@opam:v0.11.0@c86ba0e6", + "@opam/base@opam:v0.11.1@0e54024e", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/fieldslib@opam:v0.11.0@c86ba0e6", + "@opam/base@opam:v0.11.1@0e54024e" + ] + }, + "@opam/ppx_expect@opam:v0.11.1@406d6035": { + "id": "@opam/ppx_expect@opam:v0.11.1@406d6035", + "name": "@opam/ppx_expect", + "version": "opam:v0.11.1", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/ee/ee5e03094674de295aadc10efe6bb7b7#md5:ee5e03094674de295aadc10efe6bb7b7", + "archive:https://github.com/janestreet/ppx_expect/releases/download/v0.11.1/ppx_expect-v0.11.1.tbz#md5:ee5e03094674de295aadc10efe6bb7b7" + ], + "opam": { + "name": "ppx_expect", + "version": "v0.11.1", + "path": "esy.lock/opam/ppx_expect.v0.11.1" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/stdio@opam:v0.11.0@3b11cb88", + "@opam/re@opam:1.7.3@83095efd", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ppx_variants_conv@opam:v0.11.1@32a56a8b", + "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", + "@opam/ppx_inline_test@opam:v0.11.0@b987f92a", + "@opam/ppx_here@opam:v0.11.0@c36c7116", + "@opam/ppx_fields_conv@opam:v0.11.0@13fd6109", + "@opam/ppx_custom_printf@opam:v0.11.0@5af4e646", + "@opam/ppx_compare@opam:v0.11.1@9ddf10ff", + "@opam/ppx_assert@opam:v0.11.0@7cb8e43d", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/jbuilder@opam:transition@58bdfe0a", + "@opam/base@opam:v0.11.1@0e54024e", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/stdio@opam:v0.11.0@3b11cb88", + "@opam/re@opam:1.7.3@83095efd", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ppx_variants_conv@opam:v0.11.1@32a56a8b", + "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", + "@opam/ppx_inline_test@opam:v0.11.0@b987f92a", + "@opam/ppx_here@opam:v0.11.0@c36c7116", + "@opam/ppx_fields_conv@opam:v0.11.0@13fd6109", + "@opam/ppx_custom_printf@opam:v0.11.0@5af4e646", + "@opam/ppx_compare@opam:v0.11.1@9ddf10ff", + "@opam/ppx_assert@opam:v0.11.0@7cb8e43d", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/base@opam:v0.11.1@0e54024e" + ] + }, + "@opam/ppx_derivers@opam:1.0@78655ff8": { + "id": "@opam/ppx_derivers@opam:1.0@78655ff8", + "name": "@opam/ppx_derivers", + "version": "opam:1.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/4d/4ddce8f43fdb9b0ef0ab6a7cbfebc3e3#md5:4ddce8f43fdb9b0ef0ab6a7cbfebc3e3", + "archive:https://github.com/ocaml-ppx/ppx_derivers/archive/1.0.tar.gz#md5:4ddce8f43fdb9b0ef0ab6a7cbfebc3e3" + ], + "opam": { + "name": "ppx_derivers", + "version": "1.0", + "path": "esy.lock/opam/ppx_derivers.1.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/jbuilder@opam:transition@58bdfe0a", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ "ocaml@4.6.9@d41d8cd9" ] + }, + "@opam/ppx_custom_printf@opam:v0.11.0@5af4e646": { + "id": "@opam/ppx_custom_printf@opam:v0.11.0@5af4e646", + "name": "@opam/ppx_custom_printf", + "version": "opam:v0.11.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/b7/b7cf49585319576dd77f6ddd6db95b21#md5:b7cf49585319576dd77f6ddd6db95b21", + "archive:https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_custom_printf-v0.11.0.tar.gz#md5:b7cf49585319576dd77f6ddd6db95b21" + ], + "opam": { + "name": "ppx_custom_printf", + "version": "v0.11.0", + "path": "esy.lock/opam/ppx_custom_printf.v0.11.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/jbuilder@opam:transition@58bdfe0a", + "@opam/base@opam:v0.11.1@0e54024e", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/base@opam:v0.11.1@0e54024e" + ] + }, + "@opam/ppx_compare@opam:v0.11.1@9ddf10ff": { + "id": "@opam/ppx_compare@opam:v0.11.1@9ddf10ff", + "name": "@opam/ppx_compare", + "version": "opam:v0.11.1", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/3d/3df1a90fc90d180b1f96cdd30e64145d#md5:3df1a90fc90d180b1f96cdd30e64145d", + "archive:https://github.com/janestreet/ppx_compare/archive/v0.11.1.tar.gz#md5:3df1a90fc90d180b1f96cdd30e64145d" + ], + "opam": { + "name": "ppx_compare", + "version": "v0.11.1", + "path": "esy.lock/opam/ppx_compare.v0.11.1" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/jbuilder@opam:transition@58bdfe0a", + "@opam/base@opam:v0.11.1@0e54024e", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/base@opam:v0.11.1@0e54024e" + ] + }, + "@opam/ppx_assert@opam:v0.11.0@7cb8e43d": { + "id": "@opam/ppx_assert@opam:v0.11.0@7cb8e43d", + "name": "@opam/ppx_assert", + "version": "opam:v0.11.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/0b/0b3aed19391e9a23217a5abf022dfe10#md5:0b3aed19391e9a23217a5abf022dfe10", + "archive:https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_assert-v0.11.0.tar.gz#md5:0b3aed19391e9a23217a5abf022dfe10" + ], + "opam": { + "name": "ppx_assert", + "version": "v0.11.0", + "path": "esy.lock/opam/ppx_assert.v0.11.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", + "@opam/ppx_here@opam:v0.11.0@c36c7116", + "@opam/ppx_compare@opam:v0.11.1@9ddf10ff", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/jbuilder@opam:transition@58bdfe0a", + "@opam/base@opam:v0.11.1@0e54024e", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", + "@opam/ppx_here@opam:v0.11.0@c36c7116", + "@opam/ppx_compare@opam:v0.11.1@9ddf10ff", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/base@opam:v0.11.1@0e54024e" + ] + }, + "@opam/parsexp@opam:v0.11.0@7febd99d": { + "id": "@opam/parsexp@opam:v0.11.0@7febd99d", + "name": "@opam/parsexp", + "version": "opam:v0.11.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/81/816fce8d14b71a379296577c803bdbca#md5:816fce8d14b71a379296577c803bdbca", + "archive:https://ocaml.janestreet.com/ocaml-core/v0.11/files/parsexp-v0.11.0.tar.gz#md5:816fce8d14b71a379296577c803bdbca" + ], + "opam": { + "name": "parsexp", + "version": "v0.11.0", + "path": "esy.lock/opam/parsexp.v0.11.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/sexplib0@opam:v0.11.0@9df6bcd1", + "@opam/jbuilder@opam:transition@58bdfe0a", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/sexplib0@opam:v0.11.0@9df6bcd1" + ] + }, + "@opam/ocamlfind@opam:1.8.0@96572762": { + "id": "@opam/ocamlfind@opam:1.8.0@96572762", + "name": "@opam/ocamlfind", + "version": "opam:1.8.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/a7/a710c559667672077a93d34eb6a42e5b#md5:a710c559667672077a93d34eb6a42e5b", + "archive:http://download2.camlcity.org/download/findlib-1.8.0.tar.gz#md5:a710c559667672077a93d34eb6a42e5b", + "archive:http://download.camlcity.org/download/findlib-1.8.0.tar.gz#md5:a710c559667672077a93d34eb6a42e5b" + ], + "opam": { + "name": "ocamlfind", + "version": "1.8.0", + "path": "esy.lock/opam/ocamlfind.1.8.0" + } + }, + "overrides": [ + { + "opamoverride": + "esy.lock/overrides/opam__s__ocamlfind_opam__c__1.8.0_opam_override" + } + ], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/conf-m4@opam:1@3279850f", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ "ocaml@4.6.9@d41d8cd9" ] + }, + "@opam/ocamlbuild@opam:0.12.0@6c616094": { + "id": "@opam/ocamlbuild@opam:0.12.0@6c616094", + "name": "@opam/ocamlbuild", + "version": "opam:0.12.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/44/442baa19470bd49150f153122e22907b#md5:442baa19470bd49150f153122e22907b", + "archive:https://github.com/ocaml/ocamlbuild/archive/0.12.0.tar.gz#md5:442baa19470bd49150f153122e22907b" + ], + "opam": { + "name": "ocamlbuild", + "version": "0.12.0", + "path": "esy.lock/opam/ocamlbuild.0.12.0" + } + }, + "overrides": [ + { + "opamoverride": + "esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.12.0_opam_override" + } + ], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ "ocaml@4.6.9@d41d8cd9" ] + }, + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3": { + "id": "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "name": "@opam/ocaml-migrate-parsetree", + "version": "opam:1.2.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/cc/cc6fb09ad6f99156c7dba47711c62c6f#md5:cc6fb09ad6f99156c7dba47711c62c6f", + "archive:https://github.com/ocaml-ppx/ocaml-migrate-parsetree/releases/download/v1.2.0/ocaml-migrate-parsetree-v1.2.0.tbz#md5:cc6fb09ad6f99156c7dba47711c62c6f" + ], + "opam": { + "name": "ocaml-migrate-parsetree", + "version": "1.2.0", + "path": "esy.lock/opam/ocaml-migrate-parsetree.1.2.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/result@opam:1.3@bee8bf2e", + "@opam/ppx_derivers@opam:1.0@78655ff8", + "@opam/dune@opam:1.6.3@a7d7baed", "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/result@opam:1.3@bee8bf2e", + "@opam/ppx_derivers@opam:1.0@78655ff8" + ] + }, + "@opam/ocaml-compiler-libs@opam:v0.11.0@7e9ced39": { + "id": "@opam/ocaml-compiler-libs@opam:v0.11.0@7e9ced39", + "name": "@opam/ocaml-compiler-libs", + "version": "opam:v0.11.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/e1/e170c16186aa55b7e8b11e461418a10a#md5:e170c16186aa55b7e8b11e461418a10a", + "archive:https://ocaml.janestreet.com/ocaml-core/v0.11/files/ocaml-compiler-libs-v0.11.0.tar.gz#md5:e170c16186aa55b7e8b11e461418a10a" + ], + "opam": { + "name": "ocaml-compiler-libs", + "version": "v0.11.0", + "path": "esy.lock/opam/ocaml-compiler-libs.v0.11.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/jbuilder@opam:transition@58bdfe0a", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ "ocaml@4.6.9@d41d8cd9" ] + }, + "@opam/num@opam:1.1@dcdca088": { + "id": "@opam/num@opam:1.1@dcdca088", + "name": "@opam/num", + "version": "opam:1.1", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/71/710cbe18b144955687a03ebab439ff2b#md5:710cbe18b144955687a03ebab439ff2b", + "archive:https://github.com/ocaml/num/archive/v1.1.tar.gz#md5:710cbe18b144955687a03ebab439ff2b" + ], + "opam": { + "name": "num", + "version": "1.1", + "path": "esy.lock/opam/num.1.1" + } + }, + "overrides": [ + { + "opamoverride": + "esy.lock/overrides/opam__s__num_opam__c__1.1_opam_override" + } + ], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ocamlfind@opam:1.8.0@96572762", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ "ocaml@4.6.9@d41d8cd9" ] + }, + "@opam/merlin-extend@opam:0.3@e1fc0d08": { + "id": "@opam/merlin-extend@opam:0.3@e1fc0d08", + "name": "@opam/merlin-extend", + "version": "opam:0.3", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/9c/9c6dfd4f53328f02f12fcc265f4e2dda#md5:9c6dfd4f53328f02f12fcc265f4e2dda", + "archive:https://github.com/let-def/merlin-extend/archive/v0.3.tar.gz#md5:9c6dfd4f53328f02f12fcc265f4e2dda" + ], + "opam": { + "name": "merlin-extend", + "version": "0.3", + "path": "esy.lock/opam/merlin-extend.0.3" + } + }, + "overrides": [ + { + "opamoverride": + "esy.lock/overrides/opam__s__merlin_extend_opam__c__0.3_opam_override" + } + ], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ocamlfind@opam:1.8.0@96572762", + "@opam/cppo@opam:1.6.5@bec3dbd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ "ocaml@4.6.9@d41d8cd9" ] + }, + "@opam/merlin@opam:3.2.2@829ee6dd": { + "id": "@opam/merlin@opam:3.2.2@829ee6dd", + "name": "@opam/merlin", + "version": "opam:3.2.2", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/ed/ede35b65f8ac9c440cfade5445662c54#md5:ede35b65f8ac9c440cfade5445662c54", + "archive:https://github.com/ocaml/merlin/releases/download/v3.2.2/merlin-v3.2.2.tbz#md5:ede35b65f8ac9c440cfade5445662c54" + ], + "opam": { + "name": "merlin", + "version": "3.2.2", + "path": "esy.lock/opam/merlin.3.2.2" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/yojson@opam:1.4.1@975f5bbf", + "@opam/ocamlfind@opam:1.8.0@96572762", + "@opam/dune@opam:1.6.3@a7d7baed", "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/yojson@opam:1.4.1@975f5bbf", + "@opam/ocamlfind@opam:1.8.0@96572762" + ] + }, + "@opam/menhir@opam:20181113@0c8257a8": { + "id": "@opam/menhir@opam:20181113@0c8257a8", + "name": "@opam/menhir", + "version": "opam:20181113", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/69/69ce441a06ea131cd43e7b44c4303f3c#md5:69ce441a06ea131cd43e7b44c4303f3c", + "archive:https://gitlab.inria.fr/fpottier/menhir/repository/20181113/archive.tar.gz#md5:69ce441a06ea131cd43e7b44c4303f3c" + ], + "opam": { + "name": "menhir", + "version": "20181113", + "path": "esy.lock/opam/menhir.20181113" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ocamlfind@opam:1.8.0@96572762", + "@opam/ocamlbuild@opam:0.12.0@6c616094", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ "ocaml@4.6.9@d41d8cd9" ] + }, + "@opam/logs@opam:0.6.2@8f7a792d": { + "id": "@opam/logs@opam:0.6.2@8f7a792d", + "name": "@opam/logs", + "version": "opam:0.6.2", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/19/19f824c02c83c6dddc3bfb6459e4743e#md5:19f824c02c83c6dddc3bfb6459e4743e", + "archive:http://erratique.ch/software/logs/releases/logs-0.6.2.tbz#md5:19f824c02c83c6dddc3bfb6459e4743e" + ], + "opam": { + "name": "logs", + "version": "0.6.2", + "path": "esy.lock/opam/logs.0.6.2" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/topkg@opam:1.0.0@61f4ccf9", + "@opam/result@opam:1.3@bee8bf2e", + "@opam/ocamlfind@opam:1.8.0@96572762", + "@opam/ocamlbuild@opam:0.12.0@6c616094", + "@opam/fmt@opam:0.8.5@01e38a4e", "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/result@opam:1.3@bee8bf2e" + ] + }, + "@opam/jbuilder@opam:transition@58bdfe0a": { + "id": "@opam/jbuilder@opam:transition@58bdfe0a", + "name": "@opam/jbuilder", + "version": "opam:transition", + "source": { + "type": "install", + "source": [ "no-source:" ], + "opam": { + "name": "jbuilder", + "version": "transition", + "path": "esy.lock/opam/jbuilder.transition" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/dune@opam:1.6.3@a7d7baed", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/dune@opam:1.6.3@a7d7baed" + ] + }, + "@opam/fpath@opam:0.7.2@45477b93": { + "id": "@opam/fpath@opam:0.7.2@45477b93", + "name": "@opam/fpath", + "version": "opam:0.7.2", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/52/52c7ecb0bf180088336f3c645875fa41#md5:52c7ecb0bf180088336f3c645875fa41", + "archive:http://erratique.ch/software/fpath/releases/fpath-0.7.2.tbz#md5:52c7ecb0bf180088336f3c645875fa41" + ], + "opam": { + "name": "fpath", + "version": "0.7.2", + "path": "esy.lock/opam/fpath.0.7.2" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/topkg@opam:1.0.0@61f4ccf9", + "@opam/result@opam:1.3@bee8bf2e", + "@opam/ocamlfind@opam:1.8.0@96572762", + "@opam/ocamlbuild@opam:0.12.0@6c616094", + "@opam/astring@opam:0.8.3@4e5e17d5", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/result@opam:1.3@bee8bf2e", + "@opam/astring@opam:0.8.3@4e5e17d5" + ] + }, + "@opam/fmt@opam:0.8.5@01e38a4e": { + "id": "@opam/fmt@opam:0.8.5@01e38a4e", + "name": "@opam/fmt", + "version": "opam:0.8.5", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/77/77b64aa6f20f09de28f2405d6195f12c#md5:77b64aa6f20f09de28f2405d6195f12c", + "archive:http://erratique.ch/software/fmt/releases/fmt-0.8.5.tbz#md5:77b64aa6f20f09de28f2405d6195f12c" + ], + "opam": { + "name": "fmt", + "version": "0.8.5", + "path": "esy.lock/opam/fmt.0.8.5" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/uchar@opam:0.0.2@c8218eea", + "@opam/topkg@opam:1.0.0@61f4ccf9", "@opam/result@opam:1.3@bee8bf2e", + "@opam/ocamlfind@opam:1.8.0@96572762", + "@opam/ocamlbuild@opam:0.12.0@6c616094", + "@opam/base-unix@opam:base@87d0b2eb", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/uchar@opam:0.0.2@c8218eea", + "@opam/result@opam:1.3@bee8bf2e" + ] + }, + "@opam/fieldslib@opam:v0.11.0@c86ba0e6": { + "id": "@opam/fieldslib@opam:v0.11.0@c86ba0e6", + "name": "@opam/fieldslib", + "version": "opam:v0.11.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/a4/a42506b460a1dc47fb65a37d875211ae#md5:a42506b460a1dc47fb65a37d875211ae", + "archive:https://ocaml.janestreet.com/ocaml-core/v0.11/files/fieldslib-v0.11.0.tar.gz#md5:a42506b460a1dc47fb65a37d875211ae" + ], + "opam": { + "name": "fieldslib", + "version": "v0.11.0", + "path": "esy.lock/opam/fieldslib.v0.11.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/jbuilder@opam:transition@58bdfe0a", + "@opam/base@opam:v0.11.1@0e54024e", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ppxlib@opam:0.5.0@e35e68bb", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/base@opam:v0.11.1@0e54024e" + ] + }, + "@opam/easy-format@opam:1.3.1@9abfd4ed": { + "id": "@opam/easy-format@opam:1.3.1@9abfd4ed", + "name": "@opam/easy-format", + "version": "opam:1.3.1", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/4e/4e163700fb88fdcd6b8976c3a216c8ea#md5:4e163700fb88fdcd6b8976c3a216c8ea", + "archive:https://github.com/mjambon/easy-format/archive/v1.3.1.tar.gz#md5:4e163700fb88fdcd6b8976c3a216c8ea" + ], + "opam": { + "name": "easy-format", + "version": "1.3.1", + "path": "esy.lock/opam/easy-format.1.3.1" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/jbuilder@opam:transition@58bdfe0a", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ "ocaml@4.6.9@d41d8cd9" ] + }, + "@opam/dune@opam:1.6.3@a7d7baed": { + "id": "@opam/dune@opam:1.6.3@a7d7baed", + "name": "@opam/dune", + "version": "opam:1.6.3", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/12/1212a36547d25269675d767c38fecf5f#md5:1212a36547d25269675d767c38fecf5f", + "archive:https://github.com/ocaml/dune/releases/download/1.6.3/dune-1.6.3.tbz#md5:1212a36547d25269675d767c38fecf5f" + ], + "opam": { + "name": "dune", + "version": "1.6.3", + "path": "esy.lock/opam/dune.1.6.3" + } + }, + "overrides": [ + { + "opamoverride": + "esy.lock/overrides/opam__s__dune_opam__c__1.6.3_opam_override" + } + ], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", + "@opam/base-threads@opam:base@36803084", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", + "@opam/base-threads@opam:base@36803084" + ] + }, + "@opam/cppo@opam:1.6.5@bec3dbd9": { + "id": "@opam/cppo@opam:1.6.5@bec3dbd9", + "name": "@opam/cppo", + "version": "opam:1.6.5", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/1c/1cd25741d31417995b0973fe0b6f6c82#md5:1cd25741d31417995b0973fe0b6f6c82", + "archive:https://github.com/mjambon/cppo/archive/v1.6.5.tar.gz#md5:1cd25741d31417995b0973fe0b6f6c82" + ], + "opam": { + "name": "cppo", + "version": "1.6.5", + "path": "esy.lock/opam/cppo.1.6.5" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/jbuilder@opam:transition@58bdfe0a", + "@opam/base-unix@opam:base@87d0b2eb", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb" + ] + }, + "@opam/conf-which@opam:1@1da7b8cf": { + "id": "@opam/conf-which@opam:1@1da7b8cf", + "name": "@opam/conf-which", + "version": "opam:1", + "source": { + "type": "install", + "source": [ "no-source:" ], + "opam": { + "name": "conf-which", + "version": "1", + "path": "esy.lock/opam/conf-which.1" + } + }, + "overrides": [], + "dependencies": [ "@esy-ocaml/substs@0.0.1@d41d8cd9" ], + "devDependencies": [] + }, + "@opam/conf-m4@opam:1@3279850f": { + "id": "@opam/conf-m4@opam:1@3279850f", + "name": "@opam/conf-m4", + "version": "opam:1", + "source": { + "type": "install", + "source": [ "no-source:" ], + "opam": { + "name": "conf-m4", + "version": "1", + "path": "esy.lock/opam/conf-m4.1" + } + }, + "overrides": [], + "dependencies": [ "@esy-ocaml/substs@0.0.1@d41d8cd9" ], + "devDependencies": [] + }, + "@opam/bos@opam:0.2.0@df49e63f": { + "id": "@opam/bos@opam:0.2.0@df49e63f", + "name": "@opam/bos", + "version": "opam:0.2.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/ae/aeae7447567db459c856ee41b5a66fd2#md5:aeae7447567db459c856ee41b5a66fd2", + "archive:http://erratique.ch/software/bos/releases/bos-0.2.0.tbz#md5:aeae7447567db459c856ee41b5a66fd2" + ], + "opam": { + "name": "bos", + "version": "0.2.0", + "path": "esy.lock/opam/bos.0.2.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/topkg@opam:1.0.0@61f4ccf9", + "@opam/rresult@opam:0.6.0@4b185e72", + "@opam/ocamlfind@opam:1.8.0@96572762", + "@opam/ocamlbuild@opam:0.12.0@6c616094", + "@opam/logs@opam:0.6.2@8f7a792d", "@opam/fpath@opam:0.7.2@45477b93", + "@opam/fmt@opam:0.8.5@01e38a4e", + "@opam/base-unix@opam:base@87d0b2eb", + "@opam/astring@opam:0.8.3@4e5e17d5", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/rresult@opam:0.6.0@4b185e72", + "@opam/logs@opam:0.6.2@8f7a792d", "@opam/fpath@opam:0.7.2@45477b93", + "@opam/fmt@opam:0.8.5@01e38a4e", + "@opam/base-unix@opam:base@87d0b2eb", + "@opam/astring@opam:0.8.3@4e5e17d5" + ] + }, + "@opam/biniou@opam:1.2.0@c8516f18": { + "id": "@opam/biniou@opam:1.2.0@c8516f18", + "name": "@opam/biniou", + "version": "opam:1.2.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/f3/f3e92358e832ed94eaf23ce622ccc2f9#md5:f3e92358e832ed94eaf23ce622ccc2f9", + "archive:https://github.com/mjambon/biniou/archive/v1.2.0.tar.gz#md5:f3e92358e832ed94eaf23ce622ccc2f9" + ], + "opam": { + "name": "biniou", + "version": "1.2.0", + "path": "esy.lock/opam/biniou.1.2.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/jbuilder@opam:transition@58bdfe0a", + "@opam/easy-format@opam:1.3.1@9abfd4ed", + "@opam/conf-which@opam:1@1da7b8cf", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/easy-format@opam:1.3.1@9abfd4ed" + ] + }, + "@opam/base-unix@opam:base@87d0b2eb": { + "id": "@opam/base-unix@opam:base@87d0b2eb", + "name": "@opam/base-unix", + "version": "opam:base", + "source": { + "type": "install", + "source": [ "no-source:" ], + "opam": { + "name": "base-unix", + "version": "base", + "path": "esy.lock/opam/base-unix.base" + } + }, + "overrides": [], + "dependencies": [ "@esy-ocaml/substs@0.0.1@d41d8cd9" ], + "devDependencies": [] + }, + "@opam/base-threads@opam:base@36803084": { + "id": "@opam/base-threads@opam:base@36803084", + "name": "@opam/base-threads", + "version": "opam:base", + "source": { + "type": "install", + "source": [ "no-source:" ], + "opam": { + "name": "base-threads", + "version": "base", + "path": "esy.lock/opam/base-threads.base" + } + }, + "overrides": [], + "dependencies": [ "@esy-ocaml/substs@0.0.1@d41d8cd9" ], + "devDependencies": [] + }, + "@opam/base-bytes@opam:base@19d0c2ff": { + "id": "@opam/base-bytes@opam:base@19d0c2ff", + "name": "@opam/base-bytes", + "version": "opam:base", + "source": { + "type": "install", + "source": [ "no-source:" ], + "opam": { + "name": "base-bytes", + "version": "base", + "path": "esy.lock/opam/base-bytes.base" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ocamlfind@opam:1.8.0@96572762", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/ocamlfind@opam:1.8.0@96572762" + ] + }, + "@opam/base@opam:v0.11.1@0e54024e": { + "id": "@opam/base@opam:v0.11.1@0e54024e", + "name": "@opam/base", + "version": "opam:v0.11.1", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/e7/e7e7dc5db3f1fea19d74a31bbd4ac621#md5:e7e7dc5db3f1fea19d74a31bbd4ac621", + "archive:https://github.com/janestreet/base/releases/download/v0.11.1/base-v0.11.1.tbz#md5:e7e7dc5db3f1fea19d74a31bbd4ac621" + ], + "opam": { + "name": "base", + "version": "v0.11.1", + "path": "esy.lock/opam/base.v0.11.1" + } + }, + "overrides": [ + { + "opamoverride": + "esy.lock/overrides/opam__s__base_opam__c__v0.11.1_opam_override" + } + ], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/sexplib0@opam:v0.11.0@9df6bcd1", + "@opam/jbuilder@opam:transition@58bdfe0a", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/sexplib0@opam:v0.11.0@9df6bcd1" + ] + }, + "@opam/astring@opam:0.8.3@4e5e17d5": { + "id": "@opam/astring@opam:0.8.3@4e5e17d5", + "name": "@opam/astring", + "version": "opam:0.8.3", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/c5/c5bf6352b9ac27fbeab342740f4fa870#md5:c5bf6352b9ac27fbeab342740f4fa870", + "archive:http://erratique.ch/software/astring/releases/astring-0.8.3.tbz#md5:c5bf6352b9ac27fbeab342740f4fa870" + ], + "opam": { + "name": "astring", + "version": "0.8.3", + "path": "esy.lock/opam/astring.0.8.3" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/topkg@opam:1.0.0@61f4ccf9", + "@opam/ocamlfind@opam:1.8.0@96572762", + "@opam/ocamlbuild@opam:0.12.0@6c616094", + "@opam/base-bytes@opam:base@19d0c2ff", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/base-bytes@opam:base@19d0c2ff" + ] + }, + "@esy-ocaml/substs@0.0.1@d41d8cd9": { + "id": "@esy-ocaml/substs@0.0.1@d41d8cd9", + "name": "@esy-ocaml/substs", + "version": "0.0.1", + "source": { + "type": "install", + "source": [ + "archive:https://registry.npmjs.org/@esy-ocaml/substs/-/substs-0.0.1.tgz#sha1:59ebdbbaedcda123fc7ed8fb2b302b7d819e9a46" + ] + }, + "overrides": [], + "dependencies": [], + "devDependencies": [] + }, + "@esy-ocaml/reason@3.4.0@d41d8cd9": { + "id": "@esy-ocaml/reason@3.4.0@d41d8cd9", + "name": "@esy-ocaml/reason", + "version": "3.4.0", + "source": { + "type": "install", + "source": [ + "archive:https://registry.npmjs.org/@esy-ocaml/reason/-/reason-3.4.0.tgz#sha1:8c84c183a95d489a3e82ff0465effe4b56ff12af" + ] + }, + "overrides": [], + "dependencies": [ + "ocaml@4.6.9@d41d8cd9", "@opam/result@opam:1.3@bee8bf2e", + "@opam/ocamlfind@opam:1.8.0@96572762", + "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", + "@opam/merlin-extend@opam:0.3@e1fc0d08", + "@opam/menhir@opam:20181113@0c8257a8", + "@opam/dune@opam:1.6.3@a7d7baed" + ], + "devDependencies": [] + } + } +} \ No newline at end of file diff --git a/esy.lock/opam/astring.0.8.3/opam b/esy.lock/opam/astring.0.8.3/opam new file mode 100644 index 00000000..578ba1fa --- /dev/null +++ b/esy.lock/opam/astring.0.8.3/opam @@ -0,0 +1,38 @@ +opam-version: "2.0" +maintainer: "Daniel Bünzli " +authors: ["Daniel Bünzli "] +homepage: "http://erratique.ch/software/astring" +doc: "http://erratique.ch/software/astring/doc" +dev-repo: "git+http://erratique.ch/repos/astring.git" +bug-reports: "https://github.com/dbuenzli/astring/issues" +tags: [ "string" "org:erratique" ] +license: "ISC" +depends: [ + "ocaml" {>= "4.01.0"} + "ocamlfind" {build} + "ocamlbuild" {build} + "topkg" {build} + "base-bytes" +] +build: [[ + "ocaml" "pkg/pkg.ml" "build" + "--pinned" "%{pinned}%" ]] +synopsis: "Alternative String module for OCaml" +description: """ +Astring exposes an alternative `String` module for OCaml. This module +tries to balance minimality and expressiveness for basic, index-free, +string processing and provides types and functions for substrings, +string sets and string maps. + +Remaining compatible with the OCaml `String` module is a non-goal. The +`String` module exposed by Astring has exception safe functions, +removes deprecated and rarely used functions, alters some signatures +and names, adds a few missing functions and fully exploits OCaml's +newfound string immutability. + +Astring depends only on the OCaml standard library. It is distributed +under the ISC license.""" +url { + src: "http://erratique.ch/software/astring/releases/astring-0.8.3.tbz" + checksum: "md5=c5bf6352b9ac27fbeab342740f4fa870" +} diff --git a/esy.lock/opam/base-bytes.base/opam b/esy.lock/opam/base-bytes.base/opam new file mode 100644 index 00000000..f1cae506 --- /dev/null +++ b/esy.lock/opam/base-bytes.base/opam @@ -0,0 +1,9 @@ +opam-version: "2.0" +maintainer: " " +authors: " " +homepage: " " +depends: [ + "ocaml" {>= "4.02.0"} + "ocamlfind" {>= "1.5.3"} +] +synopsis: "Bytes library distributed with the OCaml compiler" diff --git a/esy.lock/opam/base-threads.base/opam b/esy.lock/opam/base-threads.base/opam new file mode 100644 index 00000000..914ff50c --- /dev/null +++ b/esy.lock/opam/base-threads.base/opam @@ -0,0 +1,6 @@ +opam-version: "2.0" +maintainer: "https://github.com/ocaml/opam-repository/issues" +description: """ +Threads library distributed with the OCaml compiler +""" + diff --git a/esy.lock/opam/base-unix.base/opam b/esy.lock/opam/base-unix.base/opam new file mode 100644 index 00000000..b973540b --- /dev/null +++ b/esy.lock/opam/base-unix.base/opam @@ -0,0 +1,6 @@ +opam-version: "2.0" +maintainer: "https://github.com/ocaml/opam-repository/issues" +description: """ +Unix library distributed with the OCaml compiler +""" + diff --git a/esy.lock/opam/base.v0.11.1/opam b/esy.lock/opam/base.v0.11.1/opam new file mode 100644 index 00000000..19b6ae9e --- /dev/null +++ b/esy.lock/opam/base.v0.11.1/opam @@ -0,0 +1,37 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/base" +bug-reports: "https://github.com/janestreet/base/issues" +dev-repo: "git+https://github.com/janestreet/base.git" +license: "Apache-2.0" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +depends: [ + "ocaml" {>= "4.04.1"} + "sexplib0" {>= "v0.11" & < "v0.12"} + "jbuilder" {build & >= "1.0+beta18.1"} +] +depopts: [ + "base-native-int63" +] +synopsis: "Full standard library replacement for OCaml" +description: """ +Full standard library replacement for OCaml + +Base is a complete and portable alternative to the OCaml standard +library. It provides all standard functionalities one would expect +from a language standard library. It uses consistent conventions +across all of its module. + +Base aims to be usable in any context. As a result system dependent +features such as I/O are not offered by Base. They are instead +provided by companion libraries such as stdio: + + https://github.com/janestreet/stdio""" +url { + src: + "https://github.com/janestreet/base/releases/download/v0.11.1/base-v0.11.1.tbz" + checksum: "md5=e7e7dc5db3f1fea19d74a31bbd4ac621" +} diff --git a/esy.lock/opam/biniou.1.2.0/opam b/esy.lock/opam/biniou.1.2.0/opam new file mode 100644 index 00000000..8c205dc1 --- /dev/null +++ b/esy.lock/opam/biniou.1.2.0/opam @@ -0,0 +1,25 @@ +opam-version: "2.0" +maintainer: "martin@mjambon.com" +authors: ["Martin Jambon"] + +homepage: "https://github.com/mjambon/biniou" +bug-reports: "https://github.com/mjambon/biniou/issues" +dev-repo: "git+https://github.com/mjambon/biniou.git" +license: "BSD-3-Clause" + +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] + ["jbuilder" "runtest" "-p" name] {with-test} +] +depends: [ + "ocaml" {>= "4.02.3"} + "conf-which" {build} + "jbuilder" {build & >= "1.0+beta7"} + "easy-format" +] +synopsis: + "Binary data format designed for speed, safety, ease of use and backward compatibility as protocols evolve" +url { + src: "https://github.com/mjambon/biniou/archive/v1.2.0.tar.gz" + checksum: "md5=f3e92358e832ed94eaf23ce622ccc2f9" +} diff --git a/esy.lock/opam/bos.0.2.0/opam b/esy.lock/opam/bos.0.2.0/opam new file mode 100644 index 00000000..86e38189 --- /dev/null +++ b/esy.lock/opam/bos.0.2.0/opam @@ -0,0 +1,47 @@ +opam-version: "2.0" +maintainer: "Daniel Bünzli " +authors: ["Daniel Bünzli "] +homepage: "http://erratique.ch/software/bos" +doc: "http://erratique.ch/software/bos/doc" +dev-repo: "git+http://erratique.ch/repos/bos.git" +bug-reports: "https://github.com/dbuenzli/bos/issues" +tags: [ "os" "system" "cli" "command" "file" "path" "log" "unix" "org:erratique" ] +license: "ISC" +depends: [ + "ocaml" {>= "4.01.0"} + "ocamlfind" {build} + "ocamlbuild" {build} + "topkg" {build & >= "0.9.0"} + "base-unix" + "rresult" {>= "0.4.0"} + "astring" + "fpath" + "fmt" {>= "0.8.0"} + "logs" + "mtime" {with-test} +] +build: [[ + "ocaml" "pkg/pkg.ml" "build" + "--dev-pkg" "%{pinned}%" ]] +synopsis: "Basic OS interaction for OCaml" +description: """ +Bos provides support for basic and robust interaction with the +operating system in OCaml. It has functions to access the process +environment, parse command line arguments, interact with the file +system and run command line programs. + +Bos works equally well on POSIX and Windows operating systems. + +Bos depends on [Rresult][rresult], [Astring][astring], [Fmt][fmt], +[Fpath][fpath] and [Logs][logs] and the OCaml Unix library. It is +distributed under the ISC license. + +[rresult]: http://erratique.ch/software/rresult +[astring]: http://erratique.ch/software/astring +[fmt]: http://erratique.ch/software/fmt +[fpath]: http://erratique.ch/software/fpath +[logs]: http://erratique.ch/software/logs""" +url { + src: "http://erratique.ch/software/bos/releases/bos-0.2.0.tbz" + checksum: "md5=aeae7447567db459c856ee41b5a66fd2" +} diff --git a/esy.lock/opam/conf-m4.1/opam b/esy.lock/opam/conf-m4.1/opam new file mode 100644 index 00000000..8f2f90df --- /dev/null +++ b/esy.lock/opam/conf-m4.1/opam @@ -0,0 +1,23 @@ +opam-version: "2.0" +maintainer: "tim@gfxmonk.net" +homepage: "http://www.gnu.org/software/m4/m4.html" +bug-reports: "https://github.com/ocaml/opam-repository/issues" +authors: "GNU Project" +license: "GPL-3" +build: [["sh" "-exc" "echo | m4"]] +depexts: [ + ["m4"] {os-distribution = "debian"} + ["m4"] {os-distribution = "ubuntu"} + ["m4"] {os-distribution = "fedora"} + ["m4"] {os-distribution = "rhel"} + ["m4"] {os-distribution = "centos"} + ["m4"] {os-distribution = "alpine"} + ["m4"] {os-distribution = "nixos"} + ["m4"] {os-family = "suse"} + ["m4"] {os-distribution = "oraclelinux"} + ["m4"] {os-distribution = "archlinux"} +] +synopsis: "Virtual package relying on m4" +description: + "This package can only install if the m4 binary is installed on the system." +flags: conf diff --git a/esy.lock/opam/conf-which.1/opam b/esy.lock/opam/conf-which.1/opam new file mode 100644 index 00000000..be5f74b3 --- /dev/null +++ b/esy.lock/opam/conf-which.1/opam @@ -0,0 +1,20 @@ +opam-version: "2.0" +maintainer: "unixjunkie@sdf.org" +homepage: "http://www.gnu.org/software/which/" +authors: "Carlo Wood" +bug-reports: "https://github.com/ocaml/opam-repository/issues" +license: "GPL-2+" +build: [["which" "which"]] +depexts: [ + ["which"] {os-distribution = "centos"} + ["which"] {os-distribution = "fedora"} + ["which"] {os-family = "suse"} + ["debianutils"] {os-distribution = "debian"} + ["debianutils"] {os-distribution = "ubuntu"} + ["which"] {os-distribution = "nixos"} + ["which"] {os-distribution = "archlinux"} +] +synopsis: "Virtual package relying on which" +description: + "This package can only install if the which program is installed on the system." +flags: conf diff --git a/esy.lock/opam/cppo.1.6.5/opam b/esy.lock/opam/cppo.1.6.5/opam new file mode 100644 index 00000000..74f8e925 --- /dev/null +++ b/esy.lock/opam/cppo.1.6.5/opam @@ -0,0 +1,23 @@ +opam-version: "2.0" +maintainer: "martin@mjambon.com" +authors: ["Martin Jambon"] +homepage: "https://github.com/mjambon/cppo" +dev-repo: "git+https://github.com/mjambon/cppo.git" +bug-reports: "https://github.com/mjambon/cppo/issues" +license: "BSD-3-Clause" + +build: [ + ["jbuilder" "subst" "-p" name] {pinned} + ["jbuilder" "build" "-p" name "-j" jobs] + ["jbuilder" "runtest" "-p" name] {with-test} +] +depends: [ + "ocaml" + "jbuilder" {build & >= "1.0+beta17"} + "base-unix" +] +synopsis: "Equivalent of the C preprocessor for OCaml programs" +url { + src: "https://github.com/mjambon/cppo/archive/v1.6.5.tar.gz" + checksum: "md5=1cd25741d31417995b0973fe0b6f6c82" +} diff --git a/esy.lock/opam/dune.1.6.3/opam b/esy.lock/opam/dune.1.6.3/opam new file mode 100644 index 00000000..9bcd9e1b --- /dev/null +++ b/esy.lock/opam/dune.1.6.3/opam @@ -0,0 +1,47 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/ocaml/dune" +bug-reports: "https://github.com/ocaml/dune/issues" +dev-repo: "git+https://github.com/ocaml/dune.git" +license: "MIT" +depends: [ + "ocaml" {>= "4.02"} + "base-unix" + "base-threads" +] +build: [ + # opam 2 sets OPAM_SWITCH_PREFIX, so we don't need a hardcoded path + ["ocaml" "configure.ml" "--libdir" lib] {opam-version < "2"} + ["ocaml" "bootstrap.ml"] + ["./boot.exe" "--release" "--subst"] {pinned} + ["./boot.exe" "--release" "-j" jobs] +] +conflicts: [ + "jbuilder" {!= "transition"} + "odoc" {< "1.3.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, it has very low-overhead and support parallel builds on +all platforms. It has no system dependencies, all you need to build +dune and packages using dune is OCaml. You don't need or 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. +""" +url { + src: "https://github.com/ocaml/dune/releases/download/1.6.3/dune-1.6.3.tbz" + checksum: "md5=1212a36547d25269675d767c38fecf5f" +} diff --git a/esy.lock/opam/easy-format.1.3.1/opam b/esy.lock/opam/easy-format.1.3.1/opam new file mode 100644 index 00000000..7c36f662 --- /dev/null +++ b/esy.lock/opam/easy-format.1.3.1/opam @@ -0,0 +1,20 @@ +opam-version: "2.0" +maintainer: "martin@mjambon.com" +authors: ["Martin Jambon"] +homepage: "http://mjambon.com/easy-format.html" +bug-reports: "https://github.com/mjambon/easy-format/issues" +dev-repo: "git+https://github.com/mjambon/easy-format.git" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] + ["jbuilder" "runtest" "-p" name] {with-test} +] +depends: [ + "ocaml" {>= "4.02.3"} + "jbuilder" {build} +] +synopsis: + "High-level and functional interface to the Format module of the OCaml standard library" +url { + src: "https://github.com/mjambon/easy-format/archive/v1.3.1.tar.gz" + checksum: "md5=4e163700fb88fdcd6b8976c3a216c8ea" +} diff --git a/esy.lock/opam/fieldslib.v0.11.0/opam b/esy.lock/opam/fieldslib.v0.11.0/opam new file mode 100644 index 00000000..9c40735a --- /dev/null +++ b/esy.lock/opam/fieldslib.v0.11.0/opam @@ -0,0 +1,30 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/fieldslib" +bug-reports: "https://github.com/janestreet/fieldslib/issues" +dev-repo: "git+https://github.com/janestreet/fieldslib.git" +license: "Apache-2.0" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +conflicts: [ "jbuilder" { = "1.0+beta19" } ] +depends: [ + "ocaml" {>= "4.04.1"} + "base" {>= "v0.11" & < "v0.12"} + "jbuilder" {build & >= "1.0+beta18.1"} + "ocaml-migrate-parsetree" {>= "1.0"} + "ppxlib" {>= "0.1.0"} +] +synopsis: + "Syntax extension to define first class values representing record fields, to get and set record fields, iterate and fold over all fields of a record and create new record values" +description: """ +Part of Jane Street's Core library +The Core suite of libraries is an industrial strength alternative to +OCaml's standard library that was developed by Jane Street, the +largest industrial user of OCaml.""" +url { + src: + "https://ocaml.janestreet.com/ocaml-core/v0.11/files/fieldslib-v0.11.0.tar.gz" + checksum: "md5=a42506b460a1dc47fb65a37d875211ae" +} diff --git a/esy.lock/opam/fmt.0.8.5/opam b/esy.lock/opam/fmt.0.8.5/opam new file mode 100644 index 00000000..aa140932 --- /dev/null +++ b/esy.lock/opam/fmt.0.8.5/opam @@ -0,0 +1,43 @@ +opam-version: "2.0" +maintainer: "Daniel Bünzli " +authors: [ + "Daniel Bünzli " + "Gabriel Radanne" +] +homepage: "http://erratique.ch/software/fmt" +doc: "http://erratique.ch/software/fmt" +dev-repo: "git+http://erratique.ch/repos/fmt.git" +bug-reports: "https://github.com/dbuenzli/fmt/issues" +tags: [ "string" "format" "pretty-print" "org:erratique" ] +license: "ISC" +depends: [ + "ocaml" {>= "4.01.0"} + "ocamlfind" {build} + "ocamlbuild" {build} + "topkg" {build & >= "0.9.0"} + "result" + "uchar" +] +depopts: [ "base-unix" "cmdliner" ] +conflicts: [ "cmdliner" {< "0.9.8"} ] +build: [[ + "ocaml" "pkg/pkg.ml" "build" + "--dev-pkg" "%{pinned}%" + "--with-base-unix" "%{base-unix:installed}%" + "--with-cmdliner" "%{cmdliner:installed}%" ]] +synopsis: "OCaml Format pretty-printer combinators" +description: """ +Fmt exposes combinators to devise `Format` pretty-printing functions. + +Fmt depends only on the OCaml standard library. The optional `Fmt_tty` +library that allows to setup formatters for terminal color output +depends on the Unix library. The optional `Fmt_cli` library that +provides command line support for Fmt depends on [`Cmdliner`][cmdliner]. + +Fmt is distributed under the ISC license. + +[cmdliner]: http://erratique.ch/software/cmdliner""" +url { + src: "http://erratique.ch/software/fmt/releases/fmt-0.8.5.tbz" + checksum: "md5=77b64aa6f20f09de28f2405d6195f12c" +} diff --git a/esy.lock/opam/fpath.0.7.2/opam b/esy.lock/opam/fpath.0.7.2/opam new file mode 100644 index 00000000..2613a6ac --- /dev/null +++ b/esy.lock/opam/fpath.0.7.2/opam @@ -0,0 +1,34 @@ +opam-version: "2.0" +maintainer: "Daniel Bünzli " +authors: ["Daniel Bünzli "] +homepage: "http://erratique.ch/software/fpath" +doc: "http://erratique.ch/software/fpath/doc" +dev-repo: "git+http://erratique.ch/repos/fpath.git" +bug-reports: "https://github.com/dbuenzli/fpath/issues" +tags: [ "file" "system" "path" "org:erratique" ] +license: "ISC" +depends: [ + "ocaml" {>= "4.01.0"} + "ocamlfind" {build} + "ocamlbuild" {build} + "topkg" {build & >= "0.9.0"} + "result" + "astring" +] +build: [[ + "ocaml" "pkg/pkg.ml" "build" + "--dev-pkg" "%{pinned}%" ]] +synopsis: "File system paths for OCaml" +description: """ +Fpath is an OCaml module for handling file system paths with POSIX or +Windows conventions. Fpath processes paths without accessing the file +system and is independent from any system library. + +Fpath depends on [Astring][astring] and is distributed under the ISC +license. + +[astring]: http://erratique.ch/software/astring""" +url { + src: "http://erratique.ch/software/fpath/releases/fpath-0.7.2.tbz" + checksum: "md5=52c7ecb0bf180088336f3c645875fa41" +} diff --git a/esy.lock/opam/jbuilder.transition/opam b/esy.lock/opam/jbuilder.transition/opam new file mode 100644 index 00000000..3e3174a5 --- /dev/null +++ b/esy.lock/opam/jbuilder.transition/opam @@ -0,0 +1,15 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/ocaml/dune" +bug-reports: "https://github.com/ocaml/dune/issues" +dev-repo: "git+https://github.com/ocaml/dune.git" +license: "MIT" +depends: ["ocaml" "dune"] +post-messages: [ + "Jbuilder has been renamed and the jbuilder package is now a transition \ + package. Use the dune package instead." +] +synopsis: + "This is a transition package, jbuilder is now named dune. Use the dune" +description: "package instead." diff --git a/esy.lock/opam/logs.0.6.2/opam b/esy.lock/opam/logs.0.6.2/opam new file mode 100644 index 00000000..e51c6bd8 --- /dev/null +++ b/esy.lock/opam/logs.0.6.2/opam @@ -0,0 +1,57 @@ +opam-version: "2.0" +maintainer: "Daniel Bünzli " +authors: ["Daniel Bünzli "] +homepage: "http://erratique.ch/software/logs" +doc: "http://erratique.ch/software/logs/doc" +dev-repo: "git+http://erratique.ch/repos/logs.git" +bug-reports: "https://github.com/dbuenzli/logs/issues" +tags: [ "log" "system" "org:erratique" ] +license: "ISC" +depends: [ + "ocaml" {>= "4.01.0"} + "ocamlfind" {build} + "ocamlbuild" {build} + "topkg" {build} + "result" + "mtime" {with-test} +] +depopts: [ + "js_of_ocaml" + "fmt" + "cmdliner" + "lwt" ] +conflicts: [ "cmdliner" {< "0.9.8"} ] +build: [[ + "ocaml" "pkg/pkg.ml" "build" + "--pinned" "%{pinned}%" + "--with-js_of_ocaml" "%{js_of_ocaml:installed}%" + "--with-fmt" "%{fmt:installed}%" + "--with-cmdliner" "%{cmdliner:installed}%" + "--with-lwt" "%{lwt:installed}%" ]] +synopsis: "Logging infrastructure for OCaml" +description: """ +Logs provides a logging infrastructure for OCaml. Logging is performed +on sources whose reporting level can be set independently. Log message +report is decoupled from logging and is handled by a reporter. + +A few optional log reporters are distributed with the base library and +the API easily allows to implement your own. + +`Logs` depends only on the `result` compatibility package. The +optional `Logs_fmt` reporter on OCaml formatters depends on [Fmt][fmt]. +The optional `Logs_browser` reporter that reports to the web browser +console depends on [js_of_ocaml][jsoo]. The optional `Logs_cli` library +that provides command line support for controlling Logs depends on +[`Cmdliner`][cmdliner]. The optional `Logs_lwt` library that provides Lwt logging +functions depends on [`Lwt`][lwt] + +Logs and its reporters are distributed under the ISC license. + +[fmt]: http://erratique.ch/software/fmt +[jsoo]: http://ocsigen.org/js_of_ocaml/ +[cmdliner]: http://erratique.ch/software/cmdliner +[lwt]: http://ocsigen.org/lwt/""" +url { + src: "http://erratique.ch/software/logs/releases/logs-0.6.2.tbz" + checksum: "md5=19f824c02c83c6dddc3bfb6459e4743e" +} diff --git a/esy.lock/opam/menhir.20181113/opam b/esy.lock/opam/menhir.20181113/opam new file mode 100644 index 00000000..d207e08c --- /dev/null +++ b/esy.lock/opam/menhir.20181113/opam @@ -0,0 +1,32 @@ +opam-version: "2.0" +maintainer: "francois.pottier@inria.fr" +authors: [ + "François Pottier " + "Yann Régis-Gianas " +] +homepage: "http://gitlab.inria.fr/fpottier/menhir" +dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git" +bug-reports: "menhir@inria.fr" +build: [ + [make "-f" "Makefile" "PREFIX=%{prefix}%" "USE_OCAMLFIND=true" "docdir=%{doc}%/menhir" "libdir=%{lib}%/menhir" "mandir=%{man}%/man1"] +] +install: [ + [make "-f" "Makefile" "install" "PREFIX=%{prefix}%" "docdir=%{doc}%/menhir" "libdir=%{lib}%/menhir" "mandir=%{man}%/man1"] +] +remove: [ + [make "-f" "Makefile" "uninstall" "PREFIX=%{prefix}%" "docdir=%{doc}%/menhir" "libdir=%{lib}%/menhir" "mandir=%{man}%/man1"] +] +depends: [ + "ocaml" {>= "4.02"} + "ocamlfind" {build} + "ocamlbuild" {build} +] +synopsis: "An LR(1) parser generator" +url { + src: + "https://gitlab.inria.fr/fpottier/menhir/repository/20181113/archive.tar.gz" + checksum: [ + "md5=69ce441a06ea131cd43e7b44c4303f3c" + "sha512=4ddefcd71d305bfb933a4056da57e36c13c99ec6dfcc4695814798fbbd78b4d65828381ebcb0e58c4c0394105ac763af3d475474e05e408f7080315bc3cf6176" + ] +} diff --git a/esy.lock/opam/merlin-extend.0.3/opam b/esy.lock/opam/merlin-extend.0.3/opam new file mode 100644 index 00000000..db2b130a --- /dev/null +++ b/esy.lock/opam/merlin-extend.0.3/opam @@ -0,0 +1,24 @@ +opam-version: "2.0" +maintainer: "Frederic Bour " +authors: "Frederic Bour " +homepage: "https://github.com/let-def/merlin-extend" +bug-reports: "https://github.com/let-def/merlin-extend" +license: "MIT" +dev-repo: "git+https://github.com/let-def/merlin-extend.git" +build: [make] +install: [make "install"] +remove: ["ocamlfind" "remove" "merlin_extend"] +depends: [ + "ocaml" {>= "4.02.3"} + "ocamlfind" {build} + "cppo" {build} +] +synopsis: "A protocol to provide custom frontend to Merlin" +description: """ +This protocol allows to replace the OCaml frontend of Merlin. +It extends what used to be done with the `-pp' flag to handle a few more cases.""" +flags: light-uninstall +url { + src: "https://github.com/let-def/merlin-extend/archive/v0.3.tar.gz" + checksum: "md5=9c6dfd4f53328f02f12fcc265f4e2dda" +} diff --git a/esy.lock/opam/merlin.3.2.2/opam b/esy.lock/opam/merlin.3.2.2/opam new file mode 100644 index 00000000..63929817 --- /dev/null +++ b/esy.lock/opam/merlin.3.2.2/opam @@ -0,0 +1,74 @@ +opam-version: "2.0" +name: "merlin" +synopsis: "Installation with Opam" +description: """ +If you have a working [Opam](https://opam.ocaml.org/) installation, Merlin is only two commands away: + +```shell +opam install merlin +opam user-setup install +``` + +[opam-user-setup](https://github.com/OCamlPro/opam-user-setup) takes care of configuring Emacs and Vim to make best use of your current install. + +You can also [configure the editor](#editor-setup) yourself, if you prefer.""" +maintainer: "defree@gmail.com" +authors: "The Merlin team" +homepage: "https://github.com/ocaml/merlin" +bug-reports: "https://github.com/ocaml/merlin/issues" +depends: [ + "ocaml" {>= "4.02.1" & < "4.08"} + "dune" {build} + "ocamlfind" {>= "1.5.2"} + "yojson" + "craml" {with-test} +] +build: [ + ["dune" "subst"] {pinned} + ["dune" "build" "-p" name "-j" jobs] +] +post-messages: + """ +merlin installed. + +Quick setup for VIM +------------------- +Append this to your .vimrc to add merlin to vim's runtime-path: + let g:opamshare = substitute(system('opam config var share'),'\\n$','','''') + execute "set rtp+=" . g:opamshare . "/merlin/vim" + +Also run the following line in vim to index the documentation: + :execute "helptags " . g:opamshare . "/merlin/vim/doc" + +Quick setup for EMACS +------------------- +Add opam emacs directory to your load-path by appending this to your .emacs: + (let ((opam-share (ignore-errors (car (process-lines "opam" "config" "var" "share"))))) + (when (and opam-share (file-directory-p opam-share)) + ;; Register Merlin + (add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share)) + (autoload 'merlin-mode "merlin" nil t nil) + ;; Automatically start it in OCaml buffers + (add-hook 'tuareg-mode-hook 'merlin-mode t) + (add-hook 'caml-mode-hook 'merlin-mode t) + ;; Use opam switch to lookup ocamlmerlin binary + (setq merlin-command 'opam))) + +Take a look at https://github.com/ocaml/merlin for more information + +Quick setup with opam-user-setup +-------------------------------- + +Opam-user-setup support Merlin. + + $ opam user-setup install + +should take care of basic setup. +See https://github.com/OCamlPro/opam-user-setup""" + {success & !user-setup:installed} +dev-repo: "git+https://github.com/ocaml/merlin.git" +url { + src: + "https://github.com/ocaml/merlin/releases/download/v3.2.2/merlin-v3.2.2.tbz" + checksum: "md5=ede35b65f8ac9c440cfade5445662c54" +} diff --git a/esy.lock/opam/num.1.1/files/findlib-install.patch b/esy.lock/opam/num.1.1/files/findlib-install.patch new file mode 100644 index 00000000..d2837ff2 --- /dev/null +++ b/esy.lock/opam/num.1.1/files/findlib-install.patch @@ -0,0 +1,129 @@ +From 7688bb4fea24463c92e9c4870acc08495a4c77cb Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Wed, 10 Jan 2018 15:20:46 +0000 +Subject: [PATCH] Provide findlib-install target + +Allows installing the entire library using ocamlfind. +--- + Makefile | 10 +++++++++- + src/META | 17 ----------------- + src/META.in | 19 +++++++++++++++++++ + src/Makefile | 17 +++++++++++++++-- + 4 files changed, 43 insertions(+), 20 deletions(-) + delete mode 100644 src/META + create mode 100644 src/META.in + +diff --git a/Makefile b/Makefile +index 6a5d08f..b40e588 100644 +--- a/Makefile ++++ b/Makefile +@@ -14,8 +14,16 @@ install: + $(MAKE) -C src install + $(MAKE) -C toplevel install + ++findlib-install: ++ $(MAKE) -C src findlib-install ++ $(MAKE) -C toplevel install ++ + uninstall: + $(MAKE) -C src uninstall + $(MAKE) -C toplevel uninstall + +-.PHONY: all test clean install uninstall ++findlib-uninstall: ++ $(MAKE) -C src findlib-uninstall ++ $(MAKE) -C toplevel uninstall ++ ++.PHONY: all test clean install uninstall findlib-install findlib-uninstall +diff --git a/src/META b/src/META +deleted file mode 100644 +index 66ac170..0000000 +--- a/src/META ++++ /dev/null +@@ -1,17 +0,0 @@ +-# This META is the one provided by findlib when the "num" library was +-# part of the core OCaml distribution. For backward compatibility, +-# it installs into OCaml's standard library directory, not in a subdirectory +- +-requires = "num.core" +-requires(toploop) = "num.core,num-top" +-version = "1.0" +-description = "Arbitrary-precision rational arithmetic" +-package "core" ( +- directory = "^" +- version = "1.0" +- browse_interfaces = "" +- archive(byte) = "nums.cma" +- archive(native) = "nums.cmxa" +- plugin(byte) = "nums.cma" +- plugin(native) = "nums.cmxs" +-) +diff --git a/src/META.in b/src/META.in +new file mode 100644 +index 0000000..b5678b7 +--- /dev/null ++++ b/src/META.in +@@ -0,0 +1,19 @@ ++# This META is the one provided by findlib when the "num" library was ++# part of the core OCaml distribution. For backward compatibility, ++# it is installed into OCaml's standard library directory. If the ++# directory line below is removed, then it's installed in a ++# subdirectory, as normal for a findlib package. ++ ++requires = "num.core" ++requires(toploop) = "num.core,num-top" ++version = "1.0" ++description = "Arbitrary-precision rational arithmetic" ++package "core" ( ++ directory = "^" ++ version = "1.0" ++ browse_interfaces = "" ++ archive(byte) = "nums.cma" ++ archive(native) = "nums.cmxa" ++ plugin(byte) = "nums.cma" ++ plugin(native) = "nums.cmxs" ++) +diff --git a/src/Makefile b/src/Makefile +index 97dc074..ff271fe 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -80,21 +80,34 @@ endif + ifeq "$(NATDYNLINK)" "true" + TOINSTALL+=nums.cmxs + endif ++ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" + TOINSTALL_STUBS=dllnums.$(SO) ++else ++TOINSTALL_STUBS= ++endif + + install: ++ cp META.in META + $(OCAMLFIND) install num META ++ rm -f META + $(INSTALL_DATA) $(TOINSTALL) $(STDLIBDIR) + ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" + $(INSTALL_DLL) $(TOINSTALL_STUBS) $(STDLIBDIR)/stublibs + endif + +-uninstall: ++findlib-install: ++ grep -Fv '^' META.in > META ++ $(OCAMLFIND) install num META $(TOINSTALL) $(TOINSTALL_STUBS) ++ rm -f META ++ ++findlib-uninstall: ++ $(OCAMLFIND) remove num ++ ++uninstall: findlib-uninstall + cd $(STDLIBDIR) && rm -f $(TOINSTALL) + ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" + cd $(STDLIBDIR)/stublibs && rm -f $(TOINSTALL_STUBS) + endif +- $(OCAMLFIND) remove num + + clean: + rm -f *.cm[ioxta] *.cmx[as] *.cmti *.$(O) *.$(A) *.$(SO) +-- +2.14.1 + diff --git a/esy.lock/opam/num.1.1/files/installation-warning.patch b/esy.lock/opam/num.1.1/files/installation-warning.patch new file mode 100644 index 00000000..88ef9b6c --- /dev/null +++ b/esy.lock/opam/num.1.1/files/installation-warning.patch @@ -0,0 +1,59 @@ +From db8d748b2cad0adc2698e9fcf28727083a711bae Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Wed, 24 Jan 2018 16:01:56 +0000 +Subject: [PATCH] Warn about installations broken by previous faulty package + +--- + Makefile | 33 +++++++++++++++++++++++++++++++++ + 1 file changed, 33 insertions(+) + +diff --git a/Makefile b/Makefile +index b40e588..d4dcd70 100644 +--- a/Makefile ++++ b/Makefile +@@ -14,9 +14,42 @@ install: + $(MAKE) -C src install + $(MAKE) -C toplevel install + ++OCAMLFIND_DIR:=$(dir $(shell command -v ocamlfind 2>/dev/null)) ++OCAMLC_DIR:=$(dir $(shell command -v ocamlc 2>/dev/null)) ++NUM_INSTALLED:=$(shell ocamlfind query num 2>/dev/null) ++ ++ifeq ($(NUM_INSTALLED),) ++# The num findlib package is not already present - wohoo! ++OUR_FAULT=no ++else ++ifeq ($(OCAMLFIND_DIR),$(OCAMLC_DIR)) ++# The num findlib package is present, but ocamlc and ocamlfind are in the ++# same place, which means that either we're looking at a system-installed ++# ocamlfind (which isn't supported), or the user has done something else ++# nefarious and doesn't deserve our sympathy (or, at least, our potentially ++# unhelpful advice) ++OUR_FAULT=no ++else ++# The num findlib package package is present, and ocamlc and ocamlfind reside ++# in different directories, which means that we're almost certainly looking at ++# a system switch which has been damaged by a previous num package installation ++# on an OS which didn't protect the system lib directory. ++OUR_FAULT=probably ++endif ++endif ++ + findlib-install: ++ifeq ($(OUR_FAULT),no) + $(MAKE) -C src findlib-install + $(MAKE) -C toplevel install ++else ++ @echo "\033[0;31m[ERROR]\033[m It appears that the num library was previously installed to your system" ++ @echo " compiler's lib directory, probably by a faulty opam package." ++ @echo " You will need to remove arith_flags.*, arith_status.*, big_int.*," ++ @echo " int_misc.*, nat.*, num.*, ratio.*, nums.*, libnums.* and" ++ @echo " stublibs/dllnums.* from $(shell ocamlc -where)." ++ @false ++endif + + uninstall: + $(MAKE) -C src uninstall +-- +2.14.1 + diff --git a/esy.lock/opam/num.1.1/opam b/esy.lock/opam/num.1.1/opam new file mode 100644 index 00000000..c711ab38 --- /dev/null +++ b/esy.lock/opam/num.1.1/opam @@ -0,0 +1,43 @@ +opam-version: "2.0" +name: "num" +version: "1.1" +maintainer: "Xavier Leroy " +authors: [ + "Valérie Ménissier-Morain" + "Pierre Weis" + "Xavier Leroy" +] +license: "LGPL 2.1 with OCaml linking exception" + +homepage: "https://github.com/ocaml/num/" +bug-reports: "https://github.com/ocaml/num/issues" +dev-repo: "git+https://github.com/ocaml/num.git" +build: [ + [make] +] +install: [ + make + "install" {!ocaml:preinstalled} + "findlib-install" {ocaml:preinstalled} +] +remove: [ + make + "uninstall" {!ocaml:preinstalled} + "findlib-uninstall" {ocaml:preinstalled} +] +depends: [ + "ocaml" {>= "4.06.0"} + "ocamlfind" {build & >= "1.7.3"} +] +conflicts: [ "base-num" ] +patches: [ "findlib-install.patch" "installation-warning.patch" ] +synopsis: + "The legacy Num library for arbitrary-precision integer and rational arithmetic" +extra-files: [ + ["installation-warning.patch" "md5=93c92bf6da6bae09d068da42b1bbaaac"] + ["findlib-install.patch" "md5=3163a4c3f8dd084653eeb64d95311a2a"] +] +url { + src: "https://github.com/ocaml/num/archive/v1.1.tar.gz" + checksum: "md5=710cbe18b144955687a03ebab439ff2b" +} diff --git a/esy.lock/opam/ocaml-compiler-libs.v0.11.0/opam b/esy.lock/opam/ocaml-compiler-libs.v0.11.0/opam new file mode 100644 index 00000000..901b5dc0 --- /dev/null +++ b/esy.lock/opam/ocaml-compiler-libs.v0.11.0/opam @@ -0,0 +1,23 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/ocaml-compiler-libs" +bug-reports: "https://github.com/janestreet/ocaml-compiler-libs/issues" +dev-repo: "git+https://github.com/janestreet/ocaml-compiler-libs.git" +license: "Apache-2.0" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +depends: [ + "ocaml" {>= "4.04.1"} + "jbuilder" {build & >= "1.0+beta12"} +] +synopsis: "OCaml compiler libraries repackaged" +description: """ +This packages exposes the OCaml compiler libraries repackages under +the toplevel names Ocaml_common, Ocaml_bytecomp, ...""" +url { + src: + "https://ocaml.janestreet.com/ocaml-core/v0.11/files/ocaml-compiler-libs-v0.11.0.tar.gz" + checksum: "md5=e170c16186aa55b7e8b11e461418a10a" +} diff --git a/esy.lock/opam/ocaml-migrate-parsetree.1.2.0/opam b/esy.lock/opam/ocaml-migrate-parsetree.1.2.0/opam new file mode 100644 index 00000000..17739192 --- /dev/null +++ b/esy.lock/opam/ocaml-migrate-parsetree.1.2.0/opam @@ -0,0 +1,34 @@ +opam-version: "2.0" +maintainer: "frederic.bour@lakaban.net" +authors: [ + "Frédéric Bour " + "Jérémie Dimino " +] +license: "LGPL-2.1" +homepage: "https://github.com/ocaml-ppx/ocaml-migrate-parsetree" +bug-reports: "https://github.com/ocaml-ppx/ocaml-migrate-parsetree/issues" +dev-repo: "git+https://github.com/ocaml-ppx/ocaml-migrate-parsetree.git" +doc: "https://ocaml-ppx.github.io/ocaml-migrate-parsetree/" +tags: [ "syntax" "org:ocamllabs" ] +build: [ + ["dune" "build" "-p" name "-j" jobs] +] +depends: [ + "result" + "ppx_derivers" + "dune" {build & >= "1.6.0"} + "ocaml" {>= "4.02.3"} +] +synopsis: "Convert OCaml parsetrees between different versions" +description: """ +Convert OCaml parsetrees between different versions + +This library converts parsetrees, outcometree and ast mappers between +different OCaml versions. High-level functions help making PPX +rewriters independent of a compiler version. +""" +url { + src: + "https://github.com/ocaml-ppx/ocaml-migrate-parsetree/releases/download/v1.2.0/ocaml-migrate-parsetree-v1.2.0.tbz" + checksum: "md5=cc6fb09ad6f99156c7dba47711c62c6f" +} diff --git a/esy.lock/opam/ocamlbuild.0.12.0/opam b/esy.lock/opam/ocamlbuild.0.12.0/opam new file mode 100644 index 00000000..6c17f372 --- /dev/null +++ b/esy.lock/opam/ocamlbuild.0.12.0/opam @@ -0,0 +1,36 @@ +opam-version: "2.0" +maintainer: "Gabriel Scherer " +authors: ["Nicolas Pouillard" "Berke Durak"] +homepage: "https://github.com/ocaml/ocamlbuild/" +bug-reports: "https://github.com/ocaml/ocamlbuild/issues" +license: "LGPL-2 with OCaml linking exception" +doc: "https://github.com/ocaml/ocamlbuild/blob/master/manual/manual.adoc" +dev-repo: "git+https://github.com/ocaml/ocamlbuild.git" +build: [ + [ + make + "-f" + "configure.make" + "all" + "OCAMLBUILD_PREFIX=%{prefix}%" + "OCAMLBUILD_BINDIR=%{bin}%" + "OCAMLBUILD_LIBDIR=%{lib}%" + "OCAMLBUILD_MANDIR=%{man}%" + "OCAML_NATIVE=%{ocaml:native}%" + "OCAML_NATIVE_TOOLS=%{ocaml:native}%" + ] + [make "check-if-preinstalled" "all" "opam-install"] +] +conflicts: [ + "base-ocamlbuild" + "ocamlfind" {< "1.6.2"} +] +synopsis: + "OCamlbuild is a build system with builtin rules to easily build most OCaml projects." +depends: [ + "ocaml" {>= "4.03" & < "4.08.0"} +] +url { + src: "https://github.com/ocaml/ocamlbuild/archive/0.12.0.tar.gz" + checksum: "md5=442baa19470bd49150f153122e22907b" +} diff --git a/esy.lock/opam/ocamlfind.1.8.0/files/ocaml-stub b/esy.lock/opam/ocamlfind.1.8.0/files/ocaml-stub new file mode 100644 index 00000000..e5ad9907 --- /dev/null +++ b/esy.lock/opam/ocamlfind.1.8.0/files/ocaml-stub @@ -0,0 +1,4 @@ +#!/bin/sh + +BINDIR=$(dirname "$(command -v ocamlc)") +"$BINDIR/ocaml" -I "$OCAML_TOPLEVEL_PATH" "$@" diff --git a/esy.lock/opam/ocamlfind.1.8.0/files/ocamlfind.install b/esy.lock/opam/ocamlfind.1.8.0/files/ocamlfind.install new file mode 100644 index 00000000..295c6254 --- /dev/null +++ b/esy.lock/opam/ocamlfind.1.8.0/files/ocamlfind.install @@ -0,0 +1,6 @@ +bin: [ + "src/findlib/ocamlfind" {"ocamlfind"} + "?src/findlib/ocamlfind_opt" {"ocamlfind"} + "?tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/esy.lock/opam/ocamlfind.1.8.0/opam b/esy.lock/opam/ocamlfind.1.8.0/opam new file mode 100644 index 00000000..b6b0b262 --- /dev/null +++ b/esy.lock/opam/ocamlfind.1.8.0/opam @@ -0,0 +1,64 @@ +opam-version: "2.0" +maintainer: "Thomas Gazagnaire " +homepage: "http://projects.camlcity.org/projects/findlib.html" +bug-reports: "https://gitlab.camlcity.org/gerd/lib-findlib/issues" +dev-repo: "git+https://gitlab.camlcity.org/gerd/lib-findlib.git" +build: [ + [ + "./configure" + "-bindir" + bin + "-sitelib" + lib + "-mandir" + man + "-config" + "%{lib}%/findlib.conf" + "-no-custom" + "-no-topfind" {ocaml:preinstalled} + ] + [make "all"] + [make "opt"] {ocaml:native} +] +install: [ + [make "install"] + ["install" "-m" "0755" "ocaml-stub" "%{bin}%/ocaml"] {ocaml:preinstalled} +] +remove: [ + ["ocamlfind" "remove" "bytes"] + [ + "./configure" + "-bindir" + bin + "-sitelib" + lib + "-mandir" + man + "-config" + "%{lib}%/findlib.conf" + "-no-topfind" {ocaml:preinstalled} + ] + [make "uninstall"] + ["rm" "-f" "%{bin}%/ocaml"] {ocaml:preinstalled} +] +depends: [ + "ocaml" {>= "4.00.0"} + "conf-m4" {build} +] +synopsis: "A library manager for OCaml" +description: """ +Findlib is a library manager for OCaml. It provides a convention how +to store libraries, and a file format ("META") to describe the +properties of libraries. There is also a tool (ocamlfind) for +interpreting the META files, so that it is very easy to use libraries +in programs and scripts.""" +authors: "Gerd Stolpmann " +extra-files: [ + ["ocamlfind.install" "md5=06f2c282ab52d93aa6adeeadd82a2543"] + ["ocaml-stub" "md5=181f259c9e0bad9ef523e7d4abfdf87a"] +] +url { + src: "http://download.camlcity.org/download/findlib-1.8.0.tar.gz" + checksum: "md5=a710c559667672077a93d34eb6a42e5b" + mirrors: "http://download2.camlcity.org/download/findlib-1.8.0.tar.gz" +} diff --git a/esy.lock/opam/parsexp.v0.11.0/opam b/esy.lock/opam/parsexp.v0.11.0/opam new file mode 100644 index 00000000..bce5c3c3 --- /dev/null +++ b/esy.lock/opam/parsexp.v0.11.0/opam @@ -0,0 +1,41 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/parsexp" +bug-reports: "https://github.com/janestreet/parsexp/issues" +dev-repo: "git+https://github.com/janestreet/parsexp.git" +license: "Apache-2.0" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +depends: [ + "ocaml" {>= "4.04.1"} + "sexplib0" {>= "v0.11" & < "v0.12"} + "jbuilder" {build & >= "1.0+beta18.1"} +] +synopsis: "S-expression parsing library" +description: """ +This library provides generic parsers for parsing S-expressions from +strings or other medium. + +The library is focused on performances but still provide full generic +parsers that can be used with strings, bigstrings, lexing buffers, +character streams or any other sources effortlessly. + +It provides three different class of parsers: +- the normal parsers, producing [Sexp.t] or [Sexp.t list] values +- the parsers with positions, building compact position sequences so + that one can recover original positions in order to report properly + located errors at little cost +- the Concrete Syntax Tree parsers, produce values of type + [Parsexp.Cst.t] which record the concrete layout of the s-expression + syntax, including comments + +This library is portable and doesn't provide IO functions. To read +s-expressions from files or other external sources, you should use +parsexp_io.""" +url { + src: + "https://ocaml.janestreet.com/ocaml-core/v0.11/files/parsexp-v0.11.0.tar.gz" + checksum: "md5=816fce8d14b71a379296577c803bdbca" +} diff --git a/esy.lock/opam/ppx_assert.v0.11.0/opam b/esy.lock/opam/ppx_assert.v0.11.0/opam new file mode 100644 index 00000000..2ef7950c --- /dev/null +++ b/esy.lock/opam/ppx_assert.v0.11.0/opam @@ -0,0 +1,28 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/ppx_assert" +bug-reports: "https://github.com/janestreet/ppx_assert/issues" +dev-repo: "git+https://github.com/janestreet/ppx_assert.git" +license: "Apache-2.0" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +conflicts: [ "jbuilder" { = "1.0+beta19" } ] +depends: [ + "ocaml" {>= "4.04.1"} + "base" {>= "v0.11" & < "v0.12"} + "ppx_compare" {>= "v0.11" & < "v0.12"} + "ppx_here" {>= "v0.11" & < "v0.12"} + "ppx_sexp_conv" {>= "v0.11" & < "v0.12"} + "jbuilder" {build & >= "1.0+beta18.1"} + "ocaml-migrate-parsetree" {>= "1.0"} + "ppxlib" {>= "0.1.0"} +] +synopsis: "Assert-like extension nodes that raise useful errors on failure" +description: "Part of the Jane Street's PPX rewriters collection." +url { + src: + "https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_assert-v0.11.0.tar.gz" + checksum: "md5=0b3aed19391e9a23217a5abf022dfe10" +} diff --git a/esy.lock/opam/ppx_compare.v0.11.1/opam b/esy.lock/opam/ppx_compare.v0.11.1/opam new file mode 100644 index 00000000..b5410265 --- /dev/null +++ b/esy.lock/opam/ppx_compare.v0.11.1/opam @@ -0,0 +1,24 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/ppx_compare" +bug-reports: "https://github.com/janestreet/ppx_compare/issues" +dev-repo: "git+https://github.com/janestreet/ppx_compare.git" +license: "Apache-2.0" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +conflicts: [ "jbuilder" { = "1.0+beta19" } ] +depends: [ + "ocaml" {>= "4.04.1"} + "base" {>= "v0.11" & < "v0.12"} + "jbuilder" {build & >= "1.0+beta18.1"} + "ocaml-migrate-parsetree" {>= "1.0"} + "ppxlib" {>= "0.3.0"} +] +synopsis: "Generation of comparison functions from types" +description: "Part of the Jane Street's PPX rewriters collection." +url { + src: "https://github.com/janestreet/ppx_compare/archive/v0.11.1.tar.gz" + checksum: "md5=3df1a90fc90d180b1f96cdd30e64145d" +} diff --git a/esy.lock/opam/ppx_custom_printf.v0.11.0/opam b/esy.lock/opam/ppx_custom_printf.v0.11.0/opam new file mode 100644 index 00000000..81e1a328 --- /dev/null +++ b/esy.lock/opam/ppx_custom_printf.v0.11.0/opam @@ -0,0 +1,25 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/ppx_custom_printf" +bug-reports: "https://github.com/janestreet/ppx_custom_printf/issues" +dev-repo: "git+https://github.com/janestreet/ppx_custom_printf.git" +license: "Apache-2.0" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +depends: [ + "ocaml" {>= "4.04.1"} + "base" {>= "v0.11" & < "v0.12"} + "ppx_sexp_conv" {>= "v0.11" & < "v0.12"} + "jbuilder" {build & >= "1.0+beta18.1"} + "ocaml-migrate-parsetree" {>= "1.0"} + "ppxlib" {>= "0.1.0"} +] +synopsis: "Printf-style format-strings for user-defined string conversion" +description: "Part of the Jane Street's PPX rewriters collection." +url { + src: + "https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_custom_printf-v0.11.0.tar.gz" + checksum: "md5=b7cf49585319576dd77f6ddd6db95b21" +} diff --git a/esy.lock/opam/ppx_derivers.1.0/opam b/esy.lock/opam/ppx_derivers.1.0/opam new file mode 100644 index 00000000..ac3aad97 --- /dev/null +++ b/esy.lock/opam/ppx_derivers.1.0/opam @@ -0,0 +1,23 @@ +opam-version: "2.0" +maintainer: "jeremie@dimino.org" +authors: ["Jérémie Dimino"] +license: "BSD3" +homepage: "https://github.com/ocaml-ppx/ppx_derivers" +bug-reports: "https://github.com/ocaml-ppx/ppx_derivers/issues" +dev-repo: "git://github.com/ocaml-ppx/ppx_derivers.git" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +depends: [ + "ocaml" + "jbuilder" {build & >= "1.0+beta7"} +] +synopsis: "Shared [@@deriving] plugin registry" +description: """ +Ppx_derivers is a tiny package whose sole purpose is to allow +ppx_deriving and ppx_type_conv to inter-operate gracefully when linked +as part of the same ocaml-migrate-parsetree driver.""" +url { + src: "https://github.com/ocaml-ppx/ppx_derivers/archive/1.0.tar.gz" + checksum: "md5=4ddce8f43fdb9b0ef0ab6a7cbfebc3e3" +} diff --git a/esy.lock/opam/ppx_expect.v0.11.1/opam b/esy.lock/opam/ppx_expect.v0.11.1/opam new file mode 100644 index 00000000..27dc783e --- /dev/null +++ b/esy.lock/opam/ppx_expect.v0.11.1/opam @@ -0,0 +1,35 @@ +opam-version: "2.0" +version: "v0.11.1" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/ppx_expect" +bug-reports: "https://github.com/janestreet/ppx_expect/issues" +dev-repo: "git+https://github.com/janestreet/ppx_expect.git" +license: "MIT" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +depends: [ + "base" {>= "v0.11" & < "v0.12"} + "ppx_assert" {>= "v0.11" & < "v0.12"} + "ppx_compare" {>= "v0.11" & < "v0.12"} + "ppx_custom_printf" {>= "v0.11" & < "v0.12"} + "ppx_fields_conv" {>= "v0.11" & < "v0.12"} + "ppx_here" {>= "v0.11" & < "v0.12"} + "ppx_inline_test" {>= "v0.11" & < "v0.12"} + "ppx_sexp_conv" {>= "v0.11" & < "v0.12"} + "ppx_variants_conv" {>= "v0.11" & < "v0.12"} + "stdio" {>= "v0.11" & < "v0.12"} + "jbuilder" {build & >= "1.0+beta18.1"} + "ocaml-migrate-parsetree" {>= "1.0"} + "ppxlib" {>= "0.1.0"} + "re" {>= "1.5.0"} + "ocaml" {>= "4.04.1"} +] +synopsis: "Cram like framework for OCaml" +description: "Part of the Jane Street's PPX rewriters collection." +url { + src: + "https://github.com/janestreet/ppx_expect/releases/download/v0.11.1/ppx_expect-v0.11.1.tbz" + checksum: "md5=ee5e03094674de295aadc10efe6bb7b7" +} diff --git a/esy.lock/opam/ppx_fields_conv.v0.11.0/opam b/esy.lock/opam/ppx_fields_conv.v0.11.0/opam new file mode 100644 index 00000000..23efa81c --- /dev/null +++ b/esy.lock/opam/ppx_fields_conv.v0.11.0/opam @@ -0,0 +1,25 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/ppx_fields_conv" +bug-reports: "https://github.com/janestreet/ppx_fields_conv/issues" +dev-repo: "git+https://github.com/janestreet/ppx_fields_conv.git" +license: "Apache-2.0" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +depends: [ + "ocaml" {>= "4.04.1"} + "base" {>= "v0.11" & < "v0.12"} + "fieldslib" {>= "v0.11" & < "v0.12"} + "jbuilder" {build & >= "1.0+beta18.1"} + "ocaml-migrate-parsetree" {>= "1.0"} + "ppxlib" {>= "0.1.0"} +] +synopsis: "Generation of accessor and iteration functions for ocaml records" +description: "Part of the Jane Street's PPX rewriters collection." +url { + src: + "https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_fields_conv-v0.11.0.tar.gz" + checksum: "md5=72f207c23d65f7f3eaabcc92e33ccdab" +} diff --git a/esy.lock/opam/ppx_here.v0.11.0/opam b/esy.lock/opam/ppx_here.v0.11.0/opam new file mode 100644 index 00000000..ef4ead39 --- /dev/null +++ b/esy.lock/opam/ppx_here.v0.11.0/opam @@ -0,0 +1,25 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/ppx_here" +bug-reports: "https://github.com/janestreet/ppx_here/issues" +dev-repo: "git+https://github.com/janestreet/ppx_here.git" +license: "Apache-2.0" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +conflicts: [ "jbuilder" { = "1.0+beta19" } ] +depends: [ + "ocaml" {>= "4.04.1"} + "base" {>= "v0.11" & < "v0.12"} + "jbuilder" {build & >= "1.0+beta18.1"} + "ocaml-migrate-parsetree" {>= "1.0"} + "ppxlib" {>= "0.1.0"} +] +synopsis: "Expands [%here] into its location" +description: "Part of the Jane Street's PPX rewriters collection." +url { + src: + "https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_here-v0.11.0.tar.gz" + checksum: "md5=479c9cd5f6ef90c2df9f01eab9d6c91d" +} diff --git a/esy.lock/opam/ppx_inline_test.v0.11.0/opam b/esy.lock/opam/ppx_inline_test.v0.11.0/opam new file mode 100644 index 00000000..6a493bc4 --- /dev/null +++ b/esy.lock/opam/ppx_inline_test.v0.11.0/opam @@ -0,0 +1,24 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/ppx_inline_test" +bug-reports: "https://github.com/janestreet/ppx_inline_test/issues" +dev-repo: "git+https://github.com/janestreet/ppx_inline_test.git" +license: "Apache-2.0" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +depends: [ + "ocaml" {>= "4.04.1"} + "base" {>= "v0.11" & < "v0.12"} + "jbuilder" {build & >= "1.0+beta18.1"} + "ocaml-migrate-parsetree" {>= "1.0"} + "ppxlib" {>= "0.1.0"} +] +synopsis: "Syntax extension for writing in-line tests in ocaml code" +description: "Part of the Jane Street's PPX rewriters collection." +url { + src: + "https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_inline_test-v0.11.0.tar.gz" + checksum: "md5=1f2e014332373638696d8893d87f4682" +} diff --git a/esy.lock/opam/ppx_sexp_conv.v0.11.2/opam b/esy.lock/opam/ppx_sexp_conv.v0.11.2/opam new file mode 100644 index 00000000..cb4493fa --- /dev/null +++ b/esy.lock/opam/ppx_sexp_conv.v0.11.2/opam @@ -0,0 +1,25 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/ppx_sexp_conv" +bug-reports: "https://github.com/janestreet/ppx_sexp_conv/issues" +dev-repo: "git+https://github.com/janestreet/ppx_sexp_conv.git" +license: "Apache-2.0" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +conflicts: [ "jbuilder" { = "1.0+beta19" } ] +depends: [ + "ocaml" {>= "4.04.1"} + "base" {>= "v0.11" & < "v0.12"} + "jbuilder" {build & >= "1.0+beta18.1"} + "ocaml-migrate-parsetree" {>= "1.0"} + "ppxlib" {>= "0.3.0"} +] +synopsis: + "Generation of S-expression conversion functions from type definitions" +description: "Part of the Jane Street's PPX rewriters collection." +url { + src: "https://github.com/janestreet/ppx_sexp_conv/archive/v0.11.2.tar.gz" + checksum: "md5=77d3b30b3d9c5810552bde2027656b8d" +} diff --git a/esy.lock/opam/ppx_variants_conv.v0.11.1/opam b/esy.lock/opam/ppx_variants_conv.v0.11.1/opam new file mode 100644 index 00000000..6faace6f --- /dev/null +++ b/esy.lock/opam/ppx_variants_conv.v0.11.1/opam @@ -0,0 +1,26 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/ppx_variants_conv" +bug-reports: "https://github.com/janestreet/ppx_variants_conv/issues" +dev-repo: "git+https://github.com/janestreet/ppx_variants_conv.git" +license: "Apache-2.0" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +depends: [ + "ocaml" {>= "4.04.1"} + "base" {>= "v0.11" & < "v0.12"} + "variantslib" {>= "v0.11" & < "v0.12"} + "jbuilder" {build & >= "1.0+beta18.1"} + "ocaml-migrate-parsetree" {>= "1.0"} + "ppxlib" {>= "0.3.0"} +] +synopsis: + "Generation of accessor and iteration functions for ocaml variant types" +description: "Part of the Jane Street's PPX rewriters collection." +url { + src: + "https://github.com/janestreet/ppx_variants_conv/archive/v0.11.1.tar.gz" + checksum: "md5=146b49b84315b7d67c1ca758fcbf2fb2" +} diff --git a/esy.lock/opam/ppxlib.0.5.0/opam b/esy.lock/opam/ppxlib.0.5.0/opam new file mode 100644 index 00000000..1c7df02f --- /dev/null +++ b/esy.lock/opam/ppxlib.0.5.0/opam @@ -0,0 +1,42 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/ocaml-ppx/ppxlib" +bug-reports: "https://github.com/ocaml-ppx/ppxlib/issues" +dev-repo: "git+https://github.com/ocaml-ppx/ppxlib.git" +doc: "https://ocaml-ppx.github.io/ppxlib/" +license: "MIT" +build: [ + ["dune" "subst"] {pinned} + ["dune" "build" "-p" name "-j" jobs] +] +run-test: [ + ["dune" "runtest" "-p" name "-j" jobs] { ocaml >= "4.06" } +] +depends: [ + "ocaml" {>= "4.04.1"} + "base" {>= "v0.11.0"} + "dune" {build} + "ocaml-compiler-libs" {>= "v0.11.0"} + "ocaml-migrate-parsetree" {>= "1.0.9"} + "ppx_derivers" {>= "1.0"} + "stdio" {>= "v0.11.0"} + "ocamlfind" {with-test} +] +synopsis: "Base library and tools for ppx rewriters" +description: """ +A comprehensive toolbox for ppx development. It features: +- a OCaml AST / parser / pretty-printer snapshot,to create a full + frontend independent of the version of OCaml; +- a library for library for ppx rewriters in general, and type-driven + code generators in particular; +- a feature-full driver for OCaml AST transformers; +- a quotation mechanism allowing to write values representing the + OCaml AST in the OCaml syntax; +- a generator of open recursion classes from type definitions. +""" +url { + src: + "https://github.com/ocaml-ppx/ppxlib/releases/download/0.5.0/ppxlib-0.5.0.tbz" + checksum: "md5=bb278ff6e819e0e4a4d8a005bb2512a4" +} diff --git a/esy.lock/opam/re.1.7.3/opam b/esy.lock/opam/re.1.7.3/opam new file mode 100644 index 00000000..c4d5c052 --- /dev/null +++ b/esy.lock/opam/re.1.7.3/opam @@ -0,0 +1,36 @@ +opam-version: "2.0" +maintainer: "rudi.grinberg@gmail.com" +authors: [ + "Jerome Vouillon" + "Thomas Gazagnaire" + "Anil Madhavapeddy" + "Rudi Grinberg" + "Gabriel Radanne" +] +license: "LGPL-2.0 with OCaml linking exception" +homepage: "https://github.com/ocaml/ocaml-re" +bug-reports: "https://github.com/ocaml/ocaml-re/issues" +dev-repo: "git+https://github.com/ocaml/ocaml-re.git" +build: [ + ["jbuilder" "subst" "-p" name] {pinned} + ["jbuilder" "build" "-p" name "-j" jobs] + ["jbuilder" "runtest" "-p" name "-j" jobs] {with-test} +] +depends: [ + "ocaml" {>= "4.02.3"} + "jbuilder" {build & >= "1.0+beta10"} + "ounit" {with-test} +] +synopsis: "RE is a regular expression library for OCaml" +description: """ +Pure OCaml regular expressions with: +* Perl-style regular expressions (module Re.Perl) +* Posix extended regular expressions (module Re.Posix) +* Emacs-style regular expressions (module Re.Emacs) +* Shell-style file globbing (module Re.Glob) +* Compatibility layer for OCaml's built-in Str module (module Re.Str)""" +url { + src: + "https://github.com/ocaml/ocaml-re/releases/download/1.7.3/re-1.7.3.tbz" + checksum: "md5=d2a74ca77216861bce4449600a132de9" +} diff --git a/esy.lock/opam/result.1.3/opam b/esy.lock/opam/result.1.3/opam new file mode 100644 index 00000000..8b156d61 --- /dev/null +++ b/esy.lock/opam/result.1.3/opam @@ -0,0 +1,22 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/result" +dev-repo: "git+https://github.com/janestreet/result.git" +bug-reports: "https://github.com/janestreet/result/issues" +license: "BSD3" +build: [["jbuilder" "build" "-p" name "-j" jobs]] +depends: [ + "ocaml" + "jbuilder" {build & >= "1.0+beta11"} +] +synopsis: "Compatibility Result module" +description: """ +Projects that want to use the new result type defined in OCaml >= 4.03 +while staying compatible with older version of OCaml should use the +Result module defined in this library.""" +url { + src: + "https://github.com/janestreet/result/releases/download/1.3/result-1.3.tbz" + checksum: "md5=4beebefd41f7f899b6eeba7414e7ae01" +} diff --git a/esy.lock/opam/rresult.0.6.0/opam b/esy.lock/opam/rresult.0.6.0/opam new file mode 100644 index 00000000..961ddcda --- /dev/null +++ b/esy.lock/opam/rresult.0.6.0/opam @@ -0,0 +1,35 @@ +opam-version: "2.0" +maintainer: "Daniel Bünzli " +authors: ["Daniel Bünzli "] +homepage: "http://erratique.ch/software/rresult" +doc: "http://erratique.ch/software/rresult" +dev-repo: "git+http://erratique.ch/repos/rresult.git" +bug-reports: "https://github.com/dbuenzli/rresult/issues" +tags: [ "result" "error" "declarative" "org:erratique" ] +license: "ISC" +depends: [ + "ocaml" {>= "4.01.0"} + "ocamlfind" {build} + "ocamlbuild" {build} + "topkg" {build} + "result" +] +build:[[ + "ocaml" "pkg/pkg.ml" "build" + "--pinned" "%{pinned}%" ]] + +synopsis: """Result value combinators for OCaml""" +description: """\ + +Rresult is an OCaml module for handling computation results and errors +in an explicit and declarative manner, without resorting to +exceptions. It defines combinators to operate on the `result` type +available from OCaml 4.03 in the standard library. + +Rresult depends on the compatibility `result` package and is +distributed under the ISC license. +""" +url { +archive: "http://erratique.ch/software/rresult/releases/rresult-0.6.0.tbz" +checksum: "aba88cffa29081714468c2c7bcdf7fb1" +} diff --git a/esy.lock/opam/sexplib.v0.11.0/opam b/esy.lock/opam/sexplib.v0.11.0/opam new file mode 100644 index 00000000..ecd45606 --- /dev/null +++ b/esy.lock/opam/sexplib.v0.11.0/opam @@ -0,0 +1,28 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/sexplib" +bug-reports: "https://github.com/janestreet/sexplib/issues" +dev-repo: "git+https://github.com/janestreet/sexplib.git" +license: "Apache-2.0" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +depends: [ + "ocaml" {>= "4.04.1"} + "parsexp" {>= "v0.11" & < "v0.12"} + "sexplib0" {>= "v0.11" & < "v0.12"} + "jbuilder" {build & >= "1.0+beta18.1"} + "num" +] +synopsis: "Library for serializing OCaml values to and from S-expressions" +description: """ +Part of Jane Street's Core library +The Core suite of libraries is an industrial strength alternative to +OCaml's standard library that was developed by Jane Street, the +largest industrial user of OCaml.""" +url { + src: + "https://ocaml.janestreet.com/ocaml-core/v0.11/files/sexplib-v0.11.0.tar.gz" + checksum: "md5=1d53d945914b6b9a380dc8923f19e9ae" +} diff --git a/esy.lock/opam/sexplib0.v0.11.0/opam b/esy.lock/opam/sexplib0.v0.11.0/opam new file mode 100644 index 00000000..97d0da21 --- /dev/null +++ b/esy.lock/opam/sexplib0.v0.11.0/opam @@ -0,0 +1,29 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/sexplib0" +bug-reports: "https://github.com/janestreet/sexplib0/issues" +dev-repo: "git+https://github.com/janestreet/sexplib0.git" +license: "Apache-2.0" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +depends: [ + "ocaml" {>= "4.04.1"} + "jbuilder" {build & >= "1.0+beta18.1"} +] +conflicts: [ + "sexplib" { < "v0.11"} +] +synopsis: + "Library containing the definition of S-expressions and some base converters" +description: """ +Part of Jane Street's Core library +The Core suite of libraries is an industrial strength alternative to +OCaml's standard library that was developed by Jane Street, the +largest industrial user of OCaml.""" +url { + src: + "https://ocaml.janestreet.com/ocaml-core/v0.11/files/sexplib0-v0.11.0.tar.gz" + checksum: "md5=1c14ba30b471e49f1b23fea5ff99ea6b" +} diff --git a/esy.lock/opam/stdio.v0.11.0/opam b/esy.lock/opam/stdio.v0.11.0/opam new file mode 100644 index 00000000..c26f3ba2 --- /dev/null +++ b/esy.lock/opam/stdio.v0.11.0/opam @@ -0,0 +1,26 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/stdio" +bug-reports: "https://github.com/janestreet/stdio/issues" +dev-repo: "git+https://github.com/janestreet/stdio.git" +license: "Apache-2.0" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +depends: [ + "ocaml" {>= "4.04.1"} + "base" {>= "v0.11" & < "v0.12"} + "jbuilder" {build & >= "1.0+beta18.1"} +] +synopsis: "Standard IO library for OCaml" +description: """ +Stdio implements simple input/output functionalities for OCaml. + +It re-exports the input/output functions of the OCaml standard +libraries using a more consistent API.""" +url { + src: + "https://ocaml.janestreet.com/ocaml-core/v0.11/files/stdio-v0.11.0.tar.gz" + checksum: "md5=2db42ee38c91b3ff7126c2634c407b99" +} diff --git a/esy.lock/opam/topkg.1.0.0/opam b/esy.lock/opam/topkg.1.0.0/opam new file mode 100644 index 00000000..2276edb3 --- /dev/null +++ b/esy.lock/opam/topkg.1.0.0/opam @@ -0,0 +1,49 @@ +opam-version: "2.0" +maintainer: "Daniel Bünzli " +authors: ["Daniel Bünzli "] +homepage: "http://erratique.ch/software/topkg" +doc: "http://erratique.ch/software/topkg/doc" +license: "ISC" +dev-repo: "git+http://erratique.ch/repos/topkg.git" +bug-reports: "https://github.com/dbuenzli/topkg/issues" +tags: ["packaging" "ocamlbuild" "org:erratique"] +depends: [ + "ocaml" {>= "4.01.0"} + "ocamlfind" {build & >= "1.6.1"} + "ocamlbuild" + "result" ] +build: [[ + "ocaml" "pkg/pkg.ml" "build" + "--pkg-name" name + "--dev-pkg" "%{pinned}%" ]] +synopsis: """The transitory OCaml software packager""" +description: """\ + +Topkg is a packager for distributing OCaml software. It provides an +API to describe the files a package installs in a given build +configuration and to specify information about the package's +distribution, creation and publication procedures. + +The optional topkg-care package provides the `topkg` command line tool +which helps with various aspects of a package's life cycle: creating +and linting a distribution, releasing it on the WWW, publish its +documentation, add it to the OCaml opam repository, etc. + +Topkg is distributed under the ISC license and has **no** +dependencies. This is what your packages will need as a *build* +dependency. + +Topkg-care is distributed under the ISC license it depends on +[fmt][fmt], [logs][logs], [bos][bos], [cmdliner][cmdliner], +[webbrowser][webbrowser] and `opam-format`. + +[fmt]: http://erratique.ch/software/fmt +[logs]: http://erratique.ch/software/logs +[bos]: http://erratique.ch/software/bos +[cmdliner]: http://erratique.ch/software/cmdliner +[webbrowser]: http://erratique.ch/software/webbrowser +""" +url { +src: "http://erratique.ch/software/topkg/releases/topkg-1.0.0.tbz" +checksum: "md5=e3d76bda06bf68cb5853caf6627da603" +} diff --git a/esy.lock/opam/uchar.0.0.2/opam b/esy.lock/opam/uchar.0.0.2/opam new file mode 100644 index 00000000..428d7aa6 --- /dev/null +++ b/esy.lock/opam/uchar.0.0.2/opam @@ -0,0 +1,36 @@ +opam-version: "2.0" +maintainer: "Daniel Bünzli " +authors: ["Daniel Bünzli "] +homepage: "http://ocaml.org" +doc: "https://ocaml.github.io/uchar/" +dev-repo: "git+https://github.com/ocaml/uchar.git" +bug-reports: "https://github.com/ocaml/uchar/issues" +tags: [ "text" "character" "unicode" "compatibility" "org:ocaml.org" ] +license: "typeof OCaml system" +depends: [ + "ocaml" {>= "3.12.0"} + "ocamlbuild" {build} +] +build: [ + ["ocaml" "pkg/git.ml"] + [ + "ocaml" + "pkg/build.ml" + "native=%{ocaml:native}%" + "native-dynlink=%{ocaml:native-dynlink}%" + ] +] +synopsis: "Compatibility library for OCaml's Uchar module" +description: """ +The `uchar` package provides a compatibility library for the +[`Uchar`][1] module introduced in OCaml 4.03. + +The `uchar` package is distributed under the license of the OCaml +compiler. See [LICENSE](LICENSE) for details. + +[1]: http://caml.inria.fr/pub/docs/manual-ocaml/libref/Uchar.html""" +url { + src: + "https://github.com/ocaml/uchar/releases/download/v0.0.2/uchar-0.0.2.tbz" + checksum: "md5=c9ba2c738d264c420c642f7bb1cf4a36" +} diff --git a/esy.lock/opam/variantslib.v0.11.0/opam b/esy.lock/opam/variantslib.v0.11.0/opam new file mode 100644 index 00000000..a85fcc96 --- /dev/null +++ b/esy.lock/opam/variantslib.v0.11.0/opam @@ -0,0 +1,28 @@ +opam-version: "2.0" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/janestreet/variantslib" +bug-reports: "https://github.com/janestreet/variantslib/issues" +dev-repo: "git+https://github.com/janestreet/variantslib.git" +license: "Apache-2.0" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +conflicts: [ "jbuilder" { = "1.0+beta19" } ] +depends: [ + "ocaml" {>= "4.04.1"} + "base" {>= "v0.11" & < "v0.12"} + "jbuilder" {build & >= "1.0+beta18.1"} + "ocaml-migrate-parsetree" {>= "1.0"} + "ppxlib" {>= "0.1.0"} +] +synopsis: "Part of Jane Street's Core library" +description: """ +The Core suite of libraries is an industrial strength alternative to +OCaml's standard library that was developed by Jane Street, the +largest industrial user of OCaml.""" +url { + src: + "https://ocaml.janestreet.com/ocaml-core/v0.11/files/variantslib-v0.11.0.tar.gz" + checksum: "md5=3031317975df165cc3154578680eddfb" +} diff --git a/esy.lock/opam/yojson.1.4.1/opam b/esy.lock/opam/yojson.1.4.1/opam new file mode 100644 index 00000000..8603b800 --- /dev/null +++ b/esy.lock/opam/yojson.1.4.1/opam @@ -0,0 +1,32 @@ +opam-version: "2.0" +maintainer: "martin@mjambon.com" +authors: ["Martin Jambon"] +homepage: "http://mjambon.com/yojson.html" +bug-reports: "https://github.com/mjambon/yojson/issues" +dev-repo: "git+https://github.com/mjambon/yojson.git" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] + ["jbuilder" "runtest" "-p" name] {with-test} +] +depends: [ + "ocaml" {>= "4.02.3"} + "jbuilder" {build} + "cppo" {build} + "easy-format" + "biniou" {>= "1.2.0"} +] +synopsis: + "Yojson is an optimized parsing and printing library for the JSON format" +description: """ +It addresses a few shortcomings of json-wheel including 2x speedup, +polymorphic variants and optional syntax for tuples and variants. + +ydump is a pretty-printing command-line program provided with the +yojson package. + +The program atdgen can be used to derive OCaml-JSON serializers and +deserializers from type definitions.""" +url { + src: "https://github.com/mjambon/yojson/archive/v1.4.1.tar.gz" + checksum: "md5=3ea6e36422dd670e8ab880710d5f7398" +} diff --git a/esy.lock/overrides/opam__s__base_opam__c__v0.11.1_opam_override/files/base-v0.11.1.patch b/esy.lock/overrides/opam__s__base_opam__c__v0.11.1_opam_override/files/base-v0.11.1.patch new file mode 100644 index 00000000..b7c71a38 --- /dev/null +++ b/esy.lock/overrides/opam__s__base_opam__c__v0.11.1_opam_override/files/base-v0.11.1.patch @@ -0,0 +1,56 @@ +--- ./src/exn_stubs.c ++++ ./src/exn_stubs.c +@@ -1,8 +1,13 @@ + #include + + extern int caml_backtrace_pos; ++#ifndef _MSC_VER ++#define UNUSED __attribute__((unused)) ++#else ++#define UNUSED ++#endif + +-CAMLprim value Base_clear_caml_backtrace_pos (value __attribute__((unused)) unit) { ++CAMLprim value Base_clear_caml_backtrace_pos (value UNUSED unit) { + caml_backtrace_pos = 0; + return Val_unit; + } +--- ./src/int_math_stubs.c ++++ ./src/int_math_stubs.c +@@ -5,6 +5,25 @@ + #include + #include + ++#if defined(_MSC_VER) ++#include ++#ifdef ARCH_SIXTYFOUR ++#define __builtin_popcountll(x) __popcnt64((uint64_t)(x)) ++static __inline uint32_t __builtin_clzll(uint64_t value) { ++ uint32_t leading_zero = 0; ++ _BitScanReverse64(&leading_zero, value); ++ return (63 - leading_zero); ++} ++#else ++#define __builtin_popcount(x) __popcnt((unsigned int)(x)) ++static __inline uint32_t __builtin_clz(uint32_t value) { ++ uint32_t leading_zero = 0; ++ _BitScanReverse(&leading_zero, value); ++ return (31 - leading_zero); ++} ++#endif /* ARCH_SIXTYFOUR */ ++#endif /* defined(_MSC_VER) */ ++ + static int64_t int_pow(int64_t base, int64_t exponent) { + int64_t ret = 1; + int64_t mul[4]; +--- ./src/jbuild ++++ ./src/jbuild +@@ -65,7 +65,7 @@ + (progn + (with-stdout-to popcnt_test.c + (echo "int main(int argc, char ** argv) { return __builtin_popcount(argc); }")) +- (system "${CC} -mpopcnt -c popcnt_test.c 2> ${null} && \ ++ (bash "${CC} -mpopcnt -c popcnt_test.c 2> ${null} && \ + echo '(-mpopcnt)' > ${@} || echo '()' > ${@}")))))) + + (ocamllex (hex_lexer)) diff --git a/esy.lock/overrides/opam__s__base_opam__c__v0.11.1_opam_override/package.json b/esy.lock/overrides/opam__s__base_opam__c__v0.11.1_opam_override/package.json new file mode 100644 index 00000000..44fd2691 --- /dev/null +++ b/esy.lock/overrides/opam__s__base_opam__c__v0.11.1_opam_override/package.json @@ -0,0 +1,17 @@ +{ + "build": [ + [ + "bash", + "-c", + "#{os == 'windows' ? 'patch -p1 < base-v0.11.1.patch' : 'true'}" + ], + [ + "jbuilder", + "build", + "-p", + "base", + "-j", + "4" + ] + ] +} diff --git a/esy.lock/overrides/opam__s__dune_opam__c__1.6.3_opam_override/package.json b/esy.lock/overrides/opam__s__dune_opam__c__1.6.3_opam_override/package.json new file mode 100644 index 00000000..064c7e39 --- /dev/null +++ b/esy.lock/overrides/opam__s__dune_opam__c__1.6.3_opam_override/package.json @@ -0,0 +1,14 @@ +{ + "build": [ + [ + "ocaml", + "bootstrap.ml" + ], + [ + "./boot.exe", + "--release", + "-j", + "4" + ] + ] +} diff --git a/esy.lock/overrides/opam__s__merlin_extend_opam__c__0.3_opam_override/files/merlin-extend-winfix.patch b/esy.lock/overrides/opam__s__merlin_extend_opam__c__0.3_opam_override/files/merlin-extend-winfix.patch new file mode 100644 index 00000000..40c46b15 --- /dev/null +++ b/esy.lock/overrides/opam__s__merlin_extend_opam__c__0.3_opam_override/files/merlin-extend-winfix.patch @@ -0,0 +1,34 @@ +--- ./extend_helper.ml ++++ ./extend_helper.ml +@@ -1,13 +1,6 @@ +-(*pp cppo -V OCAML:`ocamlc -version` *) + open Parsetree + open Extend_protocol + +-#if OCAML_VERSION < (4, 3, 0) +-# define CONST_STRING Asttypes.Const_string +-#else +-# define CONST_STRING Parsetree.Pconst_string +-#endif +- + (** Default implementation for [Reader_def.print_outcome] using + [Oprint] from compiler-libs *) + let print_outcome_using_oprint ppf = function +@@ -28,7 +21,7 @@ + pstr_loc = Location.none; + pstr_desc = Pstr_eval ({ + pexp_loc = Location.none; +- pexp_desc = Pexp_constant (CONST_STRING (msg, None)); ++ pexp_desc = Pexp_constant (Parsetree.Pconst_string (msg, None)); + pexp_attributes = []; + }, []); + }] +@@ -112,7 +105,7 @@ + let msg = match payload with + | PStr [{ + pstr_desc = Pstr_eval ({ +- pexp_desc = Pexp_constant (CONST_STRING (msg, _)); ++ pexp_desc = Pexp_constant (Parsetree.Pconst_string (msg, _)); + }, _); + }] -> msg + | _ -> "Warning: extension produced an incorrect syntax-error node" diff --git a/esy.lock/overrides/opam__s__merlin_extend_opam__c__0.3_opam_override/package.json b/esy.lock/overrides/opam__s__merlin_extend_opam__c__0.3_opam_override/package.json new file mode 100644 index 00000000..1675df21 --- /dev/null +++ b/esy.lock/overrides/opam__s__merlin_extend_opam__c__0.3_opam_override/package.json @@ -0,0 +1,12 @@ +{ + "build": [ + [ + "bash", + "-c", + "#{os == 'windows' ? 'patch -p1 < merlin-extend-winfix.patch' : 'true'}" + ], + [ + "make" + ] + ] +} diff --git a/esy.lock/overrides/opam__s__num_opam__c__1.1_opam_override/files/num-1.1.patch b/esy.lock/overrides/opam__s__num_opam__c__1.1_opam_override/files/num-1.1.patch new file mode 100644 index 00000000..490d076c --- /dev/null +++ b/esy.lock/overrides/opam__s__num_opam__c__1.1_opam_override/files/num-1.1.patch @@ -0,0 +1,20 @@ +--- ./src/Makefile ++++ ./src/Makefile +@@ -80,7 +80,7 @@ + ifeq "$(NATDYNLINK)" "true" + TOINSTALL+=nums.cmxs + endif + ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" +-TOINSTALL_STUBS=dllnums.$(SO) ++TOINSTALL_STUBS=dllnums$(EXT_DLL) + else + TOINSTALL_STUBS= +@@ -112,7 +112,7 @@ + endif + + clean: +- rm -f *.cm[ioxta] *.cmx[as] *.cmti *.$(O) *.$(A) *.$(SO) ++ rm -f *.cm[ioxta] *.cmx[as] *.cmti *.$(O) *.$(A) *$(EXE_DLL) + + depend: + $(OCAMLDEP) -slash *.mli *.ml > .depend diff --git a/esy.lock/overrides/opam__s__num_opam__c__1.1_opam_override/package.json b/esy.lock/overrides/opam__s__num_opam__c__1.1_opam_override/package.json new file mode 100644 index 00000000..2d281bf5 --- /dev/null +++ b/esy.lock/overrides/opam__s__num_opam__c__1.1_opam_override/package.json @@ -0,0 +1,24 @@ +{ + "build": [ + [ + "bash", + "-c", + "#{os == 'windows' ? 'patch -p1 < num-1.1.patch' : 'true'}" + ], + [ + "make" + ] + ], + "install": [ + [ + "make", + "findlib-install" + ] + ], + "exportedEnv": { + "CAML_LD_LIBRARY_PATH": { + "val": "#{self.install / 'lib' / 'num' : $CAML_LD_LIBRARY_PATH}", + "scope": "global" + } + } +} diff --git a/esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.12.0_opam_override/files/ocamlbuild-0.12.0.patch b/esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.12.0_opam_override/files/ocamlbuild-0.12.0.patch new file mode 100644 index 00000000..4d5bea0e --- /dev/null +++ b/esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.12.0_opam_override/files/ocamlbuild-0.12.0.patch @@ -0,0 +1,463 @@ +--- ./Makefile ++++ ./Makefile +@@ -213,7 +213,7 @@ + rm -f man/ocamlbuild.1 + + man/options_man.byte: src/ocamlbuild_pack.cmo +- $(OCAMLC) $^ -I src man/options_man.ml -o man/options_man.byte ++ $(OCAMLC) -I +unix unix.cma $^ -I src man/options_man.ml -o man/options_man.byte + + clean:: + rm -f man/options_man.cm* +--- ./src/command.ml ++++ ./src/command.ml +@@ -148,9 +148,10 @@ + let self = string_of_command_spec_with_calls call_with_tags call_with_target resolve_virtuals in + let b = Buffer.create 256 in + (* The best way to prevent bash from switching to its windows-style +- * quote-handling is to prepend an empty string before the command name. *) ++ * quote-handling is to prepend an empty string before the command name. ++ * space seems to work, too - and the ouput is nicer *) + if Sys.os_type = "Win32" then +- Buffer.add_string b "''"; ++ Buffer.add_char b ' '; + let first = ref true in + let put_space () = + if !first then +@@ -260,7 +261,7 @@ + + let execute_many ?(quiet=false) ?(pretend=false) cmds = + add_parallel_stat (List.length cmds); +- let degraded = !*My_unix.is_degraded || Sys.os_type = "Win32" in ++ let degraded = !*My_unix.is_degraded in + let jobs = !jobs in + if jobs < 0 then invalid_arg "jobs < 0"; + let max_jobs = if jobs = 0 then None else Some jobs in +--- ./src/findlib.ml ++++ ./src/findlib.ml +@@ -66,9 +66,6 @@ + (fun command -> lexer & Lexing.from_string & run_and_read command) + command + +-let run_and_read command = +- Printf.ksprintf run_and_read command +- + let rec query name = + try + Hashtbl.find packages name +@@ -135,7 +132,8 @@ + with Not_found -> s + + let list () = +- List.map before_space (split_nl & run_and_read "%s list" ocamlfind) ++ let cmd = Shell.quote_filename_if_needed ocamlfind ^ " list" in ++ List.map before_space (split_nl & run_and_read cmd) + + (* The closure algorithm is easy because the dependencies are already closed + and sorted for each package. We only have to make the union. We could also +--- ./src/main.ml ++++ ./src/main.ml +@@ -162,6 +162,9 @@ + Tags.mem "traverse" tags + || List.exists (Pathname.is_prefix path_name) !Options.include_dirs + || List.exists (Pathname.is_prefix path_name) target_dirs) ++ && ((* beware: !Options.build_dir is an absolute directory *) ++ Pathname.normalize !Options.build_dir ++ <> Pathname.normalize (Pathname.pwd/path_name)) + end + end + end +--- ./src/my_std.ml ++++ ./src/my_std.ml +@@ -271,13 +271,107 @@ + try Array.iter (fun x -> if x = basename then raise Exit) a; false + with Exit -> true + ++let command_plain = function ++| [| |] -> 0 ++| margv -> ++ let rec waitpid a b = ++ match Unix.waitpid a b with ++ | exception (Unix.Unix_error(Unix.EINTR,_,_)) -> waitpid a b ++ | x -> x ++ in ++ let pid = Unix.(create_process margv.(0) margv stdin stdout stderr) in ++ let pid', process_status = waitpid [] pid in ++ assert (pid = pid'); ++ match process_status with ++ | Unix.WEXITED n -> n ++ | Unix.WSIGNALED _ -> 2 (* like OCaml's uncaught exceptions *) ++ | Unix.WSTOPPED _ -> 127 ++ ++(* can't use Lexers because of circular dependency *) ++let split_path_win str = ++ let rec aux pos = ++ try ++ let i = String.index_from str pos ';' in ++ let len = i - pos in ++ if len = 0 then ++ aux (succ i) ++ else ++ String.sub str pos (i - pos) :: aux (succ i) ++ with Not_found | Invalid_argument _ -> ++ let len = String.length str - pos in ++ if len = 0 then [] else [String.sub str pos len] ++ in ++ aux 0 ++ ++let windows_shell = lazy begin ++ let rec iter = function ++ | [] -> [| "bash.exe" ; "--norc" ; "--noprofile" |] ++ | hd::tl -> ++ let dash = Filename.concat hd "dash.exe" in ++ if Sys.file_exists dash then [|dash|] else ++ let bash = Filename.concat hd "bash.exe" in ++ if Sys.file_exists bash = false then iter tl else ++ (* if sh.exe and bash.exe exist in the same dir, choose sh.exe *) ++ let sh = Filename.concat hd "sh.exe" in ++ if Sys.file_exists sh then [|sh|] else [|bash ; "--norc" ; "--noprofile"|] ++ in ++ split_path_win (try Sys.getenv "PATH" with Not_found -> "") |> iter ++end ++ ++let prep_windows_cmd cmd = ++ (* workaround known ocaml bug, remove later *) ++ if String.contains cmd '\t' && String.contains cmd ' ' = false then ++ " " ^ cmd ++ else ++ cmd ++ ++let run_with_shell = function ++| "" -> 0 ++| cmd -> ++ let cmd = prep_windows_cmd cmd in ++ let shell = Lazy.force windows_shell in ++ let qlen = Filename.quote cmd |> String.length in ++ (* old versions of dash had problems with bs *) ++ try ++ if qlen < 7_900 then ++ command_plain (Array.append shell [| "-ec" ; cmd |]) ++ else begin ++ (* it can still work, if the called command is a cygwin tool *) ++ let ch_closed = ref false in ++ let file_deleted = ref false in ++ let fln,ch = ++ Filename.open_temp_file ++ ~mode:[Open_binary] ++ "ocamlbuildtmp" ++ ".sh" ++ in ++ try ++ let f_slash = String.map ( fun x -> if x = '\\' then '/' else x ) fln in ++ output_string ch cmd; ++ ch_closed:= true; ++ close_out ch; ++ let ret = command_plain (Array.append shell [| "-e" ; f_slash |]) in ++ file_deleted:= true; ++ Sys.remove fln; ++ ret ++ with ++ | x -> ++ if !ch_closed = false then ++ close_out_noerr ch; ++ if !file_deleted = false then ++ (try Sys.remove fln with _ -> ()); ++ raise x ++ end ++ with ++ | (Unix.Unix_error _) as x -> ++ (* Sys.command doesn't raise an exception, so run_with_shell also won't ++ raise *) ++ Printexc.to_string x ^ ":" ^ cmd |> prerr_endline; ++ 1 ++ + let sys_command = +- match Sys.os_type with +- | "Win32" -> fun cmd -> +- if cmd = "" then 0 else +- let cmd = "bash --norc -c " ^ Filename.quote cmd in +- Sys.command cmd +- | _ -> fun cmd -> if cmd = "" then 0 else Sys.command cmd ++ if Sys.win32 then run_with_shell ++ else fun cmd -> if cmd = "" then 0 else Sys.command cmd + + (* FIXME warning fix and use Filename.concat *) + let filename_concat x y = +--- ./src/my_std.mli ++++ ./src/my_std.mli +@@ -69,3 +69,6 @@ + + val split_ocaml_version : (int * int * int * string) option + (** (major, minor, patchlevel, rest) *) ++ ++val windows_shell : string array Lazy.t ++val prep_windows_cmd : string -> string +--- ./src/ocamlbuild_executor.ml ++++ ./src/ocamlbuild_executor.ml +@@ -34,6 +34,8 @@ + job_stdin : out_channel; + job_stderr : in_channel; + job_buffer : Buffer.t; ++ job_pid : int; ++ job_tmp_file: string option; + mutable job_dying : bool; + };; + +@@ -76,6 +78,61 @@ + in + loop 0 + ;; ++ ++let open_process_full_win cmd env = ++ let (in_read, in_write) = Unix.pipe () in ++ let (out_read, out_write) = Unix.pipe () in ++ let (err_read, err_write) = Unix.pipe () in ++ Unix.set_close_on_exec in_read; ++ Unix.set_close_on_exec out_write; ++ Unix.set_close_on_exec err_read; ++ let inchan = Unix.in_channel_of_descr in_read in ++ let outchan = Unix.out_channel_of_descr out_write in ++ let errchan = Unix.in_channel_of_descr err_read in ++ let shell = Lazy.force Ocamlbuild_pack.My_std.windows_shell in ++ let test_cmd = ++ String.concat " " (List.map Filename.quote (Array.to_list shell)) ^ ++ "-ec " ^ ++ Filename.quote (Ocamlbuild_pack.My_std.prep_windows_cmd cmd) in ++ let argv,tmp_file = ++ if String.length test_cmd < 7_900 then ++ Array.append ++ shell ++ [| "-ec" ; Ocamlbuild_pack.My_std.prep_windows_cmd cmd |],None ++ else ++ let fln,ch = Filename.open_temp_file ~mode:[Open_binary] "ocamlbuild" ".sh" in ++ output_string ch (Ocamlbuild_pack.My_std.prep_windows_cmd cmd); ++ close_out ch; ++ let fln' = String.map (function '\\' -> '/' | c -> c) fln in ++ Array.append ++ shell ++ [| "-c" ; fln' |], Some fln in ++ let pid = ++ Unix.create_process_env argv.(0) argv env out_read in_write err_write in ++ Unix.close out_read; ++ Unix.close in_write; ++ Unix.close err_write; ++ (pid, inchan, outchan, errchan,tmp_file) ++ ++let close_process_full_win (pid,inchan, outchan, errchan, tmp_file) = ++ let delete tmp_file = ++ match tmp_file with ++ | None -> () ++ | Some x -> try Sys.remove x with Sys_error _ -> () in ++ let tmp_file_deleted = ref false in ++ try ++ close_in inchan; ++ close_out outchan; ++ close_in errchan; ++ let res = snd(Unix.waitpid [] pid) in ++ tmp_file_deleted := true; ++ delete tmp_file; ++ res ++ with ++ | x when tmp_file <> None && !tmp_file_deleted = false -> ++ delete tmp_file; ++ raise x ++ + (* ***) + (*** execute *) + (* XXX: Add test for non reentrancy *) +@@ -130,10 +187,16 @@ + (*** add_job *) + let add_job cmd rest result id = + (*display begin fun oc -> fp oc "Job %a is %s\n%!" print_job_id id cmd; end;*) +- let (stdout', stdin', stderr') = open_process_full cmd env in ++ let (pid,stdout', stdin', stderr', tmp_file) = ++ if Sys.win32 then open_process_full_win cmd env else ++ let a,b,c = open_process_full cmd env in ++ -1,a,b,c,None ++ in + incr jobs_active; +- set_nonblock (doi stdout'); +- set_nonblock (doi stderr'); ++ if not Sys.win32 then ( ++ set_nonblock (doi stdout'); ++ set_nonblock (doi stderr'); ++ ); + let job = + { job_id = id; + job_command = cmd; +@@ -143,7 +206,9 @@ + job_stdin = stdin'; + job_stderr = stderr'; + job_buffer = Buffer.create 1024; +- job_dying = false } ++ job_dying = false; ++ job_tmp_file = tmp_file; ++ job_pid = pid } + in + outputs := FDM.add (doi stdout') job (FDM.add (doi stderr') job !outputs); + jobs := JS.add job !jobs; +@@ -199,6 +264,7 @@ + try + read fd u 0 (Bytes.length u) + with ++ | Unix.Unix_error(Unix.EPIPE,_,_) when Sys.win32 -> 0 + | Unix.Unix_error(e,_,_) -> + let msg = error_message e in + display (fun oc -> fp oc +@@ -241,14 +307,19 @@ + decr jobs_active; + + (* PR#5371: we would get EAGAIN below otherwise *) +- clear_nonblock (doi job.job_stdout); +- clear_nonblock (doi job.job_stderr); +- ++ if not Sys.win32 then ( ++ clear_nonblock (doi job.job_stdout); ++ clear_nonblock (doi job.job_stderr); ++ ); + do_read ~loop:true (doi job.job_stdout) job; + do_read ~loop:true (doi job.job_stderr) job; + outputs := FDM.remove (doi job.job_stdout) (FDM.remove (doi job.job_stderr) !outputs); + jobs := JS.remove job !jobs; +- let status = close_process_full (job.job_stdout, job.job_stdin, job.job_stderr) in ++ let status = ++ if Sys.win32 then ++ close_process_full_win (job.job_pid, job.job_stdout, job.job_stdin, job.job_stderr, job.job_tmp_file) ++ else ++ close_process_full (job.job_stdout, job.job_stdin, job.job_stderr) in + + let shown = ref false in + +--- ./src/ocamlbuild_unix_plugin.ml ++++ ./src/ocamlbuild_unix_plugin.ml +@@ -48,12 +48,22 @@ + end + + let run_and_open s kont = ++ let s_orig = s in ++ let s = ++ (* Be consistent! My_unix.run_and_open uses My_std.sys_command and ++ sys_command uses bash. *) ++ if Sys.win32 = false then s else ++ let l = match Lazy.force My_std.windows_shell |> Array.to_list with ++ | hd::tl -> (Filename.quote hd)::tl ++ | _ -> assert false in ++ "\"" ^ (String.concat " " l) ^ " -ec " ^ Filename.quote (" " ^ s) ^ "\"" ++ in + let ic = Unix.open_process_in s in + let close () = + match Unix.close_process_in ic with + | Unix.WEXITED 0 -> () + | Unix.WEXITED _ | Unix.WSIGNALED _ | Unix.WSTOPPED _ -> +- failwith (Printf.sprintf "Error while running: %s" s) in ++ failwith (Printf.sprintf "Error while running: %s" s_orig) in + let res = try + kont ic + with e -> (close (); raise e) +--- ./src/options.ml ++++ ./src/options.ml +@@ -174,11 +174,24 @@ + build_dir := Filename.concat (Sys.getcwd ()) s + else + build_dir := s ++ ++let slashify = ++ if Sys.win32 then fun p -> String.map (function '\\' -> '/' | x -> x) p ++ else fun p ->p ++ ++let sb () = ++ match Sys.os_type with ++ | "Win32" -> ++ (try set_binary_mode_out stdout true with _ -> ()); ++ | _ -> () ++ ++ + let spec = ref ( + let print_version () = ++ sb (); + Printf.printf "ocamlbuild %s\n%!" Ocamlbuild_config.version; raise Exit_OK + in +- let print_vnum () = print_endline Ocamlbuild_config.version; raise Exit_OK in ++ let print_vnum () = sb (); print_endline Ocamlbuild_config.version; raise Exit_OK in + Arg.align + [ + "-version", Unit print_version , " Display the version"; +@@ -257,8 +270,8 @@ + "-build-dir", String set_build_dir, " Set build directory (implies no-links)"; + "-install-lib-dir", Set_string Ocamlbuild_where.libdir, " Set the install library directory"; + "-install-bin-dir", Set_string Ocamlbuild_where.bindir, " Set the install binary directory"; +- "-where", Unit (fun () -> print_endline !Ocamlbuild_where.libdir; raise Exit_OK), " Display the install library directory"; +- "-which", String (fun cmd -> print_endline (find_tool cmd); raise Exit_OK), " Display path to the tool command"; ++ "-where", Unit (fun () -> sb (); print_endline (slashify !Ocamlbuild_where.libdir); raise Exit_OK), " Display the install library directory"; ++ "-which", String (fun cmd -> sb (); print_endline (slashify (find_tool cmd)); raise Exit_OK), " Display path to the tool command"; + "-ocamlc", set_cmd ocamlc, " Set the OCaml bytecode compiler"; + "-plugin-ocamlc", set_cmd plugin_ocamlc, " Set the OCaml bytecode compiler \ + used when building myocamlbuild.ml (only)"; +--- ./src/pathname.ml ++++ ./src/pathname.ml +@@ -84,6 +84,26 @@ + | x :: xs -> x :: normalize_list xs + + let normalize x = ++ let x = ++ if Sys.win32 = false then ++ x ++ else ++ let len = String.length x in ++ let b = Bytes.create len in ++ for i = 0 to pred len do ++ match x.[i] with ++ | '\\' -> Bytes.set b i '/' ++ | c -> Bytes.set b i c ++ done; ++ if len > 1 then ( ++ let c1 = Bytes.get b 0 in ++ let c2 = Bytes.get b 1 in ++ if c2 = ':' && c1 >= 'a' && c1 <= 'z' && ++ ( len = 2 || Bytes.get b 2 = '/') then ++ Bytes.set b 0 (Char.uppercase_ascii c1) ++ ); ++ Bytes.unsafe_to_string b ++ in + if Glob.eval not_normal_form_re x then + let root, paths = split x in + join root (normalize_list paths) +--- ./src/shell.ml ++++ ./src/shell.ml +@@ -24,12 +24,26 @@ + | 'a'..'z' | 'A'..'Z' | '0'..'9' | '.' | '-' | '/' | '_' | ':' | '@' | '+' | ',' -> loop (pos + 1) + | _ -> false in + loop 0 ++ ++let generic_quote quotequote s = ++ let l = String.length s in ++ let b = Buffer.create (l + 20) in ++ Buffer.add_char b '\''; ++ for i = 0 to l - 1 do ++ if s.[i] = '\'' ++ then Buffer.add_string b quotequote ++ else Buffer.add_char b s.[i] ++ done; ++ Buffer.add_char b '\''; ++ Buffer.contents b ++let unix_quote = generic_quote "'\\''" ++ + let quote_filename_if_needed s = + if is_simple_filename s then s + (* We should probably be using [Filename.unix_quote] except that function + * isn't exported. Users on Windows will have to live with not being able to + * install OCaml into c:\o'caml. Too bad. *) +- else if Sys.os_type = "Win32" then Printf.sprintf "'%s'" s ++ else if Sys.os_type = "Win32" then unix_quote s + else Filename.quote s + let chdir dir = + reset_filesys_cache (); +@@ -37,7 +51,7 @@ + let run args target = + reset_readdir_cache (); + let cmd = String.concat " " (List.map quote_filename_if_needed args) in +- if !*My_unix.is_degraded || Sys.os_type = "Win32" then ++ if !*My_unix.is_degraded then + begin + Log.event cmd target Tags.empty; + let st = sys_command cmd in diff --git a/esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.12.0_opam_override/package.json b/esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.12.0_opam_override/package.json new file mode 100644 index 00000000..2b017f8b --- /dev/null +++ b/esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.12.0_opam_override/package.json @@ -0,0 +1,27 @@ +{ + "build": [ + [ + "bash", + "-c", + "#{os == 'windows' ? 'patch -p1 < ocamlbuild-0.12.0.patch' : 'true'}" + ], + [ + "make", + "-f", + "configure.make", + "all", + "OCAMLBUILD_PREFIX=#{self.install}", + "OCAMLBUILD_BINDIR=#{self.bin}", + "OCAMLBUILD_LIBDIR=#{self.lib}", + "OCAMLBUILD_MANDIR=#{self.man}", + "OCAMLBUILD_NATIVE=true", + "OCAMLBUILD_NATIVE_TOOLS=true" + ], + [ + "make", + "check-if-preinstalled", + "all", + "#{os == 'windows' ? 'install' : 'opam-install'}" + ] + ] +} diff --git a/esy.lock/overrides/opam__s__ocamlfind_opam__c__1.8.0_opam_override/files/findlib-1.8.0.patch b/esy.lock/overrides/opam__s__ocamlfind_opam__c__1.8.0_opam_override/files/findlib-1.8.0.patch new file mode 100644 index 00000000..5d3d1895 --- /dev/null +++ b/esy.lock/overrides/opam__s__ocamlfind_opam__c__1.8.0_opam_override/files/findlib-1.8.0.patch @@ -0,0 +1,489 @@ +--- ./Makefile ++++ ./Makefile +@@ -57,16 +57,16 @@ + cat findlib.conf.in | \ + $(SH) tools/patch '@SITELIB@' '$(OCAML_SITELIB)' >findlib.conf + if ./tools/cmd_from_same_dir ocamlc; then \ +- echo 'ocamlc="ocamlc.opt"' >>findlib.conf; \ ++ echo 'ocamlc="ocamlc.opt$(EXEC_SUFFIX)"' >>findlib.conf; \ + fi + if ./tools/cmd_from_same_dir ocamlopt; then \ +- echo 'ocamlopt="ocamlopt.opt"' >>findlib.conf; \ ++ echo 'ocamlopt="ocamlopt.opt$(EXEC_SUFFIX)"' >>findlib.conf; \ + fi + if ./tools/cmd_from_same_dir ocamldep; then \ +- echo 'ocamldep="ocamldep.opt"' >>findlib.conf; \ ++ echo 'ocamldep="ocamldep.opt$(EXEC_SUFFIX)"' >>findlib.conf; \ + fi + if ./tools/cmd_from_same_dir ocamldoc; then \ +- echo 'ocamldoc="ocamldoc.opt"' >>findlib.conf; \ ++ echo 'ocamldoc="ocamldoc.opt$(EXEC_SUFFIX)"' >>findlib.conf; \ + fi + + .PHONY: install-doc +--- ./src/findlib/findlib_config.mlp ++++ ./src/findlib/findlib_config.mlp +@@ -24,3 +24,5 @@ + | "MacOS" -> "" (* don't know *) + | _ -> failwith "Unknown Sys.os_type" + ;; ++ ++let exec_suffix = "@EXEC_SUFFIX@";; +--- ./src/findlib/findlib.ml ++++ ./src/findlib/findlib.ml +@@ -28,15 +28,20 @@ + let conf_ldconf = ref "";; + let conf_ignore_dups_in = ref ([] : string list);; + +-let ocamlc_default = "ocamlc";; +-let ocamlopt_default = "ocamlopt";; +-let ocamlcp_default = "ocamlcp";; +-let ocamloptp_default = "ocamloptp";; +-let ocamlmklib_default = "ocamlmklib";; +-let ocamlmktop_default = "ocamlmktop";; +-let ocamldep_default = "ocamldep";; +-let ocamlbrowser_default = "ocamlbrowser";; +-let ocamldoc_default = "ocamldoc";; ++let add_exec str = ++ match Findlib_config.exec_suffix with ++ | "" -> str ++ | a -> str ^ a ;; ++let ocamlc_default = add_exec "ocamlc";; ++let ocamlopt_default = add_exec "ocamlopt";; ++let ocamlcp_default = add_exec "ocamlcp";; ++let ocamloptp_default = add_exec "ocamloptp";; ++let ocamlmklib_default = add_exec "ocamlmklib";; ++let ocamlmktop_default = add_exec "ocamlmktop";; ++let ocamldep_default = add_exec "ocamldep";; ++let ocamlbrowser_default = add_exec "ocamlbrowser";; ++let ocamldoc_default = add_exec "ocamldoc";; ++ + + + let init_manually +--- ./src/findlib/fl_package_base.ml ++++ ./src/findlib/fl_package_base.ml +@@ -133,7 +133,15 @@ + List.find (fun def -> def.def_var = "exists_if") p.package_defs in + let files = Fl_split.in_words def.def_value in + List.exists +- (fun file -> Sys.file_exists (Filename.concat d' file)) ++ (fun file -> ++ let fln = Filename.concat d' file in ++ let e = Sys.file_exists fln in ++ (* necessary for ppx executables *) ++ if e || Sys.os_type <> "Win32" || Filename.check_suffix fln ".exe" then ++ e ++ else ++ Sys.file_exists (fln ^ ".exe") ++ ) + files + with Not_found -> true in + +--- ./src/findlib/fl_split.ml ++++ ./src/findlib/fl_split.ml +@@ -126,10 +126,17 @@ + | '/' | '\\' -> true + | _ -> false in + let norm_dir_win() = +- if l >= 1 && s.[0] = '/' then +- Buffer.add_char b '\\' else Buffer.add_char b s.[0]; +- if l >= 2 && s.[1] = '/' then +- Buffer.add_char b '\\' else Buffer.add_char b s.[1]; ++ if l >= 1 then ( ++ if s.[0] = '/' then ++ Buffer.add_char b '\\' ++ else ++ Buffer.add_char b s.[0] ; ++ if l >= 2 then ++ if s.[1] = '/' then ++ Buffer.add_char b '\\' ++ else ++ Buffer.add_char b s.[1]; ++ ); + for k = 2 to l - 1 do + let c = s.[k] in + if is_slash c then ( +--- ./src/findlib/frontend.ml ++++ ./src/findlib/frontend.ml +@@ -31,10 +31,18 @@ + else + Sys_error (arg ^ ": " ^ Unix.error_message code) + ++let is_win = Sys.os_type = "Win32" ++ ++let () = ++ match Findlib_config.system with ++ | "win32" | "win64" | "mingw" | "cygwin" | "mingw64" | "cygwin64" -> ++ (try set_binary_mode_out stdout true with _ -> ()); ++ (try set_binary_mode_out stderr true with _ -> ()); ++ | _ -> () + + let slashify s = + match Findlib_config.system with +- | "mingw" | "mingw64" | "cygwin" -> ++ | "win32" | "win64" | "mingw" | "cygwin" | "mingw64" | "cygwin64" -> + let b = Buffer.create 80 in + String.iter + (function +@@ -49,7 +57,7 @@ + + let out_path ?(prefix="") s = + match Findlib_config.system with +- | "mingw" | "mingw64" | "cygwin" -> ++ | "win32" | "win64" | "mingw" | "mingw64" | "cygwin" -> + let u = slashify s in + prefix ^ + (if String.contains u ' ' then +@@ -273,11 +281,9 @@ + + + let identify_dir d = +- match Sys.os_type with +- | "Win32" -> +- failwith "identify_dir" (* not available *) +- | _ -> +- let s = Unix.stat d in ++ if is_win then ++ failwith "identify_dir"; (* not available *) ++ let s = Unix.stat d in + (s.Unix.st_dev, s.Unix.st_ino) + ;; + +@@ -459,6 +465,96 @@ + ) + packages + ++let rewrite_cmd s = ++ if s = "" || not is_win then ++ s ++ else ++ let s = ++ let l = String.length s in ++ let b = Buffer.create l in ++ for i = 0 to pred l do ++ match s.[i] with ++ | '/' -> Buffer.add_char b '\\' ++ | x -> Buffer.add_char b x ++ done; ++ Buffer.contents b ++ in ++ if (Filename.is_implicit s && String.contains s '\\' = false) || ++ Filename.check_suffix (String.lowercase s) ".exe" then ++ s ++ else ++ let s' = s ^ ".exe" in ++ if Sys.file_exists s' then ++ s' ++ else ++ s ++ ++let rewrite_cmd s = ++ if s = "" || not is_win then s else ++ let s = ++ let l = String.length s in ++ let b = Buffer.create l in ++ for i = 0 to pred l do ++ match s.[i] with ++ | '/' -> Buffer.add_char b '\\' ++ | x -> Buffer.add_char b x ++ done; ++ Buffer.contents b ++ in ++ if (Filename.is_implicit s && String.contains s '\\' = false) || ++ Filename.check_suffix (String.lowercase s) ".exe" then ++ s ++ else ++ let s' = s ^ ".exe" in ++ if Sys.file_exists s' then ++ s' ++ else ++ s ++ ++let rewrite_pp cmd = ++ if not is_win then cmd else ++ let module T = struct exception Keep end in ++ let is_whitespace = function ++ | ' ' | '\011' | '\012' | '\n' | '\r' | '\t' -> true ++ | _ -> false in ++ (* characters that triggers special behaviour (cmd.exe, not unix shell) *) ++ let is_unsafe_char = function ++ | '(' | ')' | '%' | '!' | '^' | '<' | '>' | '&' -> true ++ | _ -> false in ++ let len = String.length cmd in ++ let buf = Buffer.create (len + 4) in ++ let buf_cmd = Buffer.create len in ++ let rec iter_ws i = ++ if i >= len then () else ++ let cur = cmd.[i] in ++ if is_whitespace cur then ( ++ Buffer.add_char buf cur; ++ iter_ws (succ i) ++ ) ++ else ++ iter_cmd i ++ and iter_cmd i = ++ if i >= len then add_buf_cmd () else ++ let cur = cmd.[i] in ++ if is_unsafe_char cur || cur = '"' || cur = '\'' then ++ raise T.Keep; ++ if is_whitespace cur then ( ++ add_buf_cmd (); ++ Buffer.add_substring buf cmd i (len - i) ++ ) ++ else ( ++ Buffer.add_char buf_cmd cur; ++ iter_cmd (succ i) ++ ) ++ and add_buf_cmd () = ++ if Buffer.length buf_cmd > 0 then ++ Buffer.add_string buf (rewrite_cmd (Buffer.contents buf_cmd)) ++ in ++ try ++ iter_ws 0; ++ Buffer.contents buf ++ with ++ | T.Keep -> cmd + + let process_pp_spec syntax_preds packages pp_opts = + (* Returns: pp_command *) +@@ -549,7 +645,7 @@ + None -> [] + | Some cmd -> + ["-pp"; +- cmd ^ " " ^ ++ (rewrite_cmd cmd) ^ " " ^ + String.concat " " (List.map Filename.quote pp_i_options) ^ " " ^ + String.concat " " (List.map Filename.quote pp_archives) ^ " " ^ + String.concat " " (List.map Filename.quote pp_opts)] +@@ -625,9 +721,11 @@ + in + try + let preprocessor = ++ rewrite_cmd ( + resolve_path + ~base ~explicit:true +- (package_property predicates pname "ppx") in ++ (package_property predicates pname "ppx") ) ++ in + ["-ppx"; String.concat " " (preprocessor :: options)] + with Not_found -> [] + ) +@@ -895,6 +993,14 @@ + switch (e.g. -L instead of -L ) + *) + ++(* We may need to remove files on which we do not have complete control. ++ On Windows, removing a read-only file fails so try to change the ++ mode of the file first. *) ++let remove_file fname = ++ try Sys.remove fname ++ with Sys_error _ when is_win -> ++ (try Unix.chmod fname 0o666 with Unix.Unix_error _ -> ()); ++ Sys.remove fname + + let ocamlc which () = + +@@ -1022,9 +1128,12 @@ + + "-intf", + Arg.String (fun s -> pass_files := !pass_files @ [ Intf(slashify s) ]); +- ++ + "-pp", +- Arg.String (fun s -> pp_specified := true; add_spec_fn "-pp" s); ++ Arg.String (fun s -> pp_specified := true; add_spec_fn "-pp" (rewrite_pp s)); ++ ++ "-ppx", ++ Arg.String (fun s -> add_spec_fn "-ppx" (rewrite_pp s)); + + "-thread", + Arg.Unit (fun _ -> threads := threads_default); +@@ -1237,7 +1346,7 @@ + with + any -> + close_out initl; +- Sys.remove initl_file_name; ++ remove_file initl_file_name; + raise any + end; + +@@ -1245,9 +1354,9 @@ + at_exit + (fun () -> + let tr f x = try f x with _ -> () in +- tr Sys.remove initl_file_name; +- tr Sys.remove (Filename.chop_extension initl_file_name ^ ".cmi"); +- tr Sys.remove (Filename.chop_extension initl_file_name ^ ".cmo"); ++ tr remove_file initl_file_name; ++ tr remove_file (Filename.chop_extension initl_file_name ^ ".cmi"); ++ tr remove_file (Filename.chop_extension initl_file_name ^ ".cmo"); + ); + + let exclude_list = [ stdlibdir; threads_dir; vmthreads_dir ] in +@@ -1493,7 +1602,9 @@ + [ "-v", Arg.Unit (fun () -> verbose := Verbose); + "-pp", Arg.String (fun s -> + pp_specified := true; +- options := !options @ ["-pp"; s]); ++ options := !options @ ["-pp"; rewrite_pp s]); ++ "-ppx", Arg.String (fun s -> ++ options := !options @ ["-ppx"; rewrite_pp s]); + ] + ) + ) +@@ -1672,7 +1783,9 @@ + Arg.String (fun s -> add_spec_fn "-I" (slashify (resolve_path s))); + + "-pp", Arg.String (fun s -> pp_specified := true; +- add_spec_fn "-pp" s); ++ add_spec_fn "-pp" (rewrite_pp s)); ++ "-ppx", Arg.String (fun s -> add_spec_fn "-ppx" (rewrite_pp s)); ++ + ] + ) + ) +@@ -1830,7 +1943,10 @@ + output_string ch_out append; + close_out ch_out; + close_in ch_in; +- Unix.utimes outpath s.Unix.st_mtime s.Unix.st_mtime; ++ (try Unix.utimes outpath s.Unix.st_mtime s.Unix.st_mtime ++ with Unix.Unix_error(e,_,_) -> ++ prerr_endline("Warning: setting utimes for " ^ outpath ++ ^ ": " ^ Unix.error_message e)); + + prerr_endline("Installed " ^ outpath); + with +@@ -1882,6 +1998,8 @@ + Unix.openfile (Filename.concat dir owner_file) [Unix.O_RDONLY] 0 in + let f = + Unix.in_channel_of_descr fd in ++ if is_win then ++ set_binary_mode_in f false; + try + let line = input_line f in + let is_my_file = (line = pkg) in +@@ -2208,7 +2326,7 @@ + let lines = read_ldconf !ldconf in + let dlldir_norm = Fl_split.norm_dir dlldir in + let dlldir_norm_lc = string_lowercase_ascii dlldir_norm in +- let ci_filesys = (Sys.os_type = "Win32") in ++ let ci_filesys = is_win in + let check_dir d = + let d' = Fl_split.norm_dir d in + (d' = dlldir_norm) || +@@ -2356,7 +2474,7 @@ + List.iter + (fun file -> + let absfile = Filename.concat dlldir file in +- Sys.remove absfile; ++ remove_file absfile; + prerr_endline ("Removed " ^ absfile) + ) + dll_files +@@ -2365,7 +2483,7 @@ + (* Remove the files from the package directory: *) + if Sys.file_exists pkgdir then begin + let files = Sys.readdir pkgdir in +- Array.iter (fun f -> Sys.remove (Filename.concat pkgdir f)) files; ++ Array.iter (fun f -> remove_file (Filename.concat pkgdir f)) files; + Unix.rmdir pkgdir; + prerr_endline ("Removed " ^ pkgdir) + end +@@ -2415,7 +2533,9 @@ + + + let print_configuration() = ++ let sl = slashify in + let dir s = ++ let s = sl s in + if Sys.file_exists s then + s + else +@@ -2453,27 +2573,27 @@ + if md = "" then "the corresponding package directories" else dir md + ); + Printf.printf "The standard library is assumed to reside in:\n %s\n" +- (Findlib.ocaml_stdlib()); ++ (sl (Findlib.ocaml_stdlib())); + Printf.printf "The ld.conf file can be found here:\n %s\n" +- (Findlib.ocaml_ldconf()); ++ (sl (Findlib.ocaml_ldconf())); + flush stdout + | Some "conf" -> +- print_endline Findlib_config.config_file ++ print_endline (sl Findlib_config.config_file) + | Some "path" -> +- List.iter print_endline (Findlib.search_path()) ++ List.iter ( fun x -> print_endline (sl x)) (Findlib.search_path()) + | Some "destdir" -> +- print_endline (Findlib.default_location()) ++ print_endline ( sl (Findlib.default_location())) + | Some "metadir" -> +- print_endline (Findlib.meta_directory()) ++ print_endline ( sl (Findlib.meta_directory())) + | Some "metapath" -> + let mdir = Findlib.meta_directory() in + let ddir = Findlib.default_location() in +- print_endline +- (if mdir <> "" then mdir ^ "/META.%s" else ddir ^ "/%s/META") ++ print_endline ( sl ++ (if mdir <> "" then mdir ^ "/META.%s" else ddir ^ "/%s/META")) + | Some "stdlib" -> +- print_endline (Findlib.ocaml_stdlib()) ++ print_endline ( sl (Findlib.ocaml_stdlib())) + | Some "ldconf" -> +- print_endline (Findlib.ocaml_ldconf()) ++ print_endline ( sl (Findlib.ocaml_ldconf())) + | _ -> + assert false + ;; +@@ -2481,7 +2601,7 @@ + + let ocamlcall pkg cmd = + let dir = package_directory pkg in +- let path = Filename.concat dir cmd in ++ let path = rewrite_cmd (Filename.concat dir cmd) in + begin + try Unix.access path [ Unix.X_OK ] + with +@@ -2647,6 +2767,10 @@ + | Sys_error f -> + prerr_endline ("ocamlfind: " ^ f); + exit 2 ++ | Unix.Unix_error (e, fn, f) -> ++ prerr_endline ("ocamlfind: " ^ fn ^ " " ^ f ++ ^ ": " ^ Unix.error_message e); ++ exit 2 + | Findlib.No_such_package(pkg,info) -> + prerr_endline ("ocamlfind: Package `" ^ pkg ^ "' not found" ^ + (if info <> "" then " - " ^ info else "")); +--- ./src/findlib/Makefile ++++ ./src/findlib/Makefile +@@ -90,6 +90,7 @@ + cat findlib_config.mlp | \ + $(SH) $(TOP)/tools/patch '@CONFIGFILE@' '$(OCAMLFIND_CONF)' | \ + $(SH) $(TOP)/tools/patch '@STDLIB@' '$(OCAML_CORE_STDLIB)' | \ ++ $(SH) $(TOP)/tools/patch '@EXEC_SUFFIX@' '$(EXEC_SUFFIX)' | \ + sed -e 's;@AUTOLINK@;$(OCAML_AUTOLINK);g' \ + -e 's;@SYSTEM@;$(SYSTEM);g' \ + >findlib_config.ml +@@ -113,7 +114,7 @@ + $(OCAMLC) -a -o num_top.cma $(NUMTOP_OBJECTS) + + clean: +- rm -f *.cmi *.cmo *.cma *.cmx *.a *.o *.cmxa \ ++ rm -f *.cmi *.cmo *.cma *.cmx *.lib *.a *.o *.cmxa \ + fl_meta.ml findlib_config.ml findlib.mml topfind.ml topfind \ + ocamlfind$(EXEC_SUFFIX) ocamlfind_opt$(EXEC_SUFFIX) + +@@ -121,7 +122,7 @@ + mkdir -p "$(prefix)$(OCAML_SITELIB)/$(NAME)" + mkdir -p "$(prefix)$(OCAMLFIND_BIN)" + test $(INSTALL_TOPFIND) -eq 0 || cp topfind "$(prefix)$(OCAML_CORE_STDLIB)" +- files=`$(SH) $(TOP)/tools/collect_files $(TOP)/Makefile.config findlib.cmi findlib.mli findlib.cma findlib.cmxa findlib.a findlib.cmxs topfind.cmi topfind.mli fl_package_base.mli fl_package_base.cmi fl_metascanner.mli fl_metascanner.cmi fl_metatoken.cmi findlib_top.cma findlib_top.cmxa findlib_top.a findlib_top.cmxs findlib_dynload.cma findlib_dynload.cmxa findlib_dynload.a findlib_dynload.cmxs fl_dynload.mli fl_dynload.cmi META` && \ ++ files=`$(SH) $(TOP)/tools/collect_files $(TOP)/Makefile.config findlib.cmi findlib.mli findlib.cma findlib.cmxa findlib$(LIB_SUFFIX) findlib.cmxs topfind.cmi topfind.mli fl_package_base.mli fl_package_base.cmi fl_metascanner.mli fl_metascanner.cmi fl_metatoken.cmi findlib_top.cma findlib_top.cmxa findlib_top$(LIB_SUFFIX) findlib_top.cmxs findlib_dynload.cma findlib_dynload.cmxa findlib_dynload$(LIB_SUFFIX) findlib_dynload.cmxs fl_dynload.mli fl_dynload.cmi META` && \ + cp $$files "$(prefix)$(OCAML_SITELIB)/$(NAME)" + f="ocamlfind$(EXEC_SUFFIX)"; { test -f ocamlfind_opt$(EXEC_SUFFIX) && f="ocamlfind_opt$(EXEC_SUFFIX)"; }; \ + cp $$f "$(prefix)$(OCAMLFIND_BIN)/ocamlfind$(EXEC_SUFFIX)" diff --git a/esy.lock/overrides/opam__s__ocamlfind_opam__c__1.8.0_opam_override/package.json b/esy.lock/overrides/opam__s__ocamlfind_opam__c__1.8.0_opam_override/package.json new file mode 100644 index 00000000..136b66c5 --- /dev/null +++ b/esy.lock/overrides/opam__s__ocamlfind_opam__c__1.8.0_opam_override/package.json @@ -0,0 +1,61 @@ +{ + "build": [ + [ + "bash", + "-c", + "#{os == 'windows' ? 'patch -p1 < findlib-1.8.0.patch' : 'true'}" + ], + [ + "./configure", + "-bindir", + "#{self.bin}", + "-sitelib", + "#{self.lib}", + "-mandir", + "#{self.man}", + "-config", + "#{self.lib}/findlib.conf", + "-no-custom", + "-no-topfind" + ], + [ + "make", + "all" + ], + [ + "make", + "opt" + ] + ], + "install": [ + [ + "make", + "install" + ], + [ + "install", + "-m", + "0755", + "ocaml-stub", + "#{self.bin}/ocaml" + ], + [ + "mkdir", + "-p", + "#{self.toplevel}" + ], + [ + "install", + "-m", + "0644", + "src/findlib/topfind", + "#{self.toplevel}/topfind" + ] + ], + "exportedEnv": { + "OCAML_TOPLEVEL_PATH": { + "val": "#{self.toplevel}", + "scope": "global" + } + } +} diff --git a/images/screenshot.png b/images/screenshot.png new file mode 100644 index 00000000..a5d1d665 Binary files /dev/null and b/images/screenshot.png differ diff --git a/library/Common.re b/library/Common.re new file mode 100644 index 00000000..fe87f8bf --- /dev/null +++ b/library/Common.re @@ -0,0 +1,168 @@ +exception InvalidSubDirs(string); +type include_subdirs = + | No + | Unqualified; + +type t = { + path: string, + name: string, + require: list(string), + flags: option(list(string)), /* TODO: Use a variant instead since flags only accept a set of values and not any list of strings */ + ocamlcFlags: option(list(string)), + ocamloptFlags: option(list(string)), + jsooFlags: option(list(string)), + preprocess: option(list(string)), + includeSubdirs: option(include_subdirs), + rawBuildConfig: option(list(string)), + rawBuildConfigFooter: option(list(string)), +}; +let create = + ( + name, + path, + require, + flags, + ocamlcFlags, + ocamloptFlags, + jsooFlags, + preprocess, + includeSubdirs, + rawBuildConfig, + rawBuildConfigFooter, + ) => { + let includeSubDirsSafe = + switch (includeSubdirs) { + | Some(x) => + switch (x) { + | "no" => Some(No) + | "unqualified" => Some(Unqualified) + | _ => raise(InvalidSubDirs(x)) + } + | None => None + }; + { + name, + path, + require, + flags, + ocamlcFlags, + ocamloptFlags, + jsooFlags, + preprocess, + includeSubdirs: includeSubDirsSafe, + rawBuildConfig, + rawBuildConfigFooter, + }; +}; +let toDuneStanzas = c => { + let { + name, + require, + flags, + ocamlcFlags, + ocamloptFlags, + jsooFlags, + preprocess, + includeSubdirs, + rawBuildConfig, + rawBuildConfigFooter, + _, + } = c; + ( + /* public_name: */ Stanza.create("public_name", Stanza.createAtom(name)), + /* libraries: */ + switch (require) { + | [] => None + | libs => + Some( + Stanza.createExpression([ + Stanza.createAtom("libraries"), + ...List.map(r => Stanza.createAtom(r), libs), + ]), + ) + }, + /* flags: */ + switch (flags) { + | None => None + | Some(l) => + Some( + Stanza.createExpression([ + Stanza.createAtom("flags"), + ...List.map(f => Stanza.createAtom(f), l), + ]), + ) + }, + /* ocamlcFlags */ + switch (ocamlcFlags) { + | None => None + | Some(l) => + Some( + Stanza.createExpression([ + Stanza.createAtom("ocamlc_flags"), + ...List.map(f => Stanza.createAtom(f), l), + ]), + ) + }, + /* ocamloptFlags */ + switch (ocamloptFlags) { + | None => None + | Some(l) => + Some( + Stanza.createExpression([ + Stanza.createAtom("ocamlopt_flags"), + ...List.map(f => Stanza.createAtom(f), l), + ]), + ) + }, + /* jsooFlags */ + switch (jsooFlags) { + | None => None + | Some(l) => + Some( + Stanza.createExpression([ + Stanza.createAtom("js_of_ocaml"), + ...List.map(f => Stanza.createAtom(f), l), + ]), + ) + }, + /* preprocess */ + switch (preprocess) { + | None => None + | Some(l) => + Some( + Stanza.createExpression([ + Stanza.createAtom("preprocess"), + Stanza.createExpression(List.map(f => Stanza.createAtom(f), l)), + ]), + ) + }, + /* includeSubdirs */ + switch (includeSubdirs) { + | None => None + | Some(v) => + Some( + Stanza.createExpression([ + Stanza.createAtom("include_subdirs"), + Stanza.createAtom( + switch (v) { + | No => "no" + | Unqualified => "unqualified" + }, + ), + ]), + ) + }, + /* rawBuildConfig */ + switch (rawBuildConfig) { + | None => None + | Some(l) => Some(l |> List.map(Stanza.ofString)) + }, + /* rawBuildConfig */ + switch (rawBuildConfigFooter) { + | None => None + | Some(l) => Some(l |> List.map(Stanza.ofString)) + }, + ); +}; + +let getPath = c => c.path; diff --git a/library/Common.rei b/library/Common.rei new file mode 100644 index 00000000..98930b07 --- /dev/null +++ b/library/Common.rei @@ -0,0 +1,32 @@ +type include_subdirs; +type t; +let toDuneStanzas: + t => + ( + Stanza.t, + option(Stanza.t), + option(Stanza.t), + option(Stanza.t), + option(Stanza.t), + option(Stanza.t), + option(Stanza.t), + option(Stanza.t), + option(list(Stanza.t)), + option(list(Stanza.t)), + ); +let getPath: t => string; +let create: + ( + /* name */ string, + /* path */ string, + /* require */ list(string), + /* flags */ option(list(string)), + /* Ocamlc flags */ option(list(string)), + /* Ocamlopt flags */ option(list(string)), + /* jsoo flags */ option(list(string)), + /* preprocess */ option(list(string)), + /* include subdirs */ option(string), + /* raw config */ option(list(string)), + /* raw config footer */ option(list(string)) + ) => + t; diff --git a/library/DuneFile.re b/library/DuneFile.re new file mode 100644 index 00000000..f93b6494 --- /dev/null +++ b/library/DuneFile.re @@ -0,0 +1,7 @@ +open Sexplib.Sexp; +let toString = (stanzas: list(Stanza.t)) => + List.fold_right( + (s, acc) => to_string_hum(~indent=4, Stanza.toSexp(s)) ++ " " ++ acc, + stanzas, + "", + ); diff --git a/library/DuneFile.rei b/library/DuneFile.rei new file mode 100644 index 00000000..65a8a0f7 --- /dev/null +++ b/library/DuneFile.rei @@ -0,0 +1 @@ +let toString: list(Stanza.t) => string; diff --git a/library/Mode.re b/library/Mode.re new file mode 100644 index 00000000..fcbe8819 --- /dev/null +++ b/library/Mode.re @@ -0,0 +1,5 @@ +module EsyEnv = { + type t' = + | UPDATE; + /* | BUILD; */ +}; diff --git a/library/PesyConf.re b/library/PesyConf.re new file mode 100644 index 00000000..fac3e4a4 --- /dev/null +++ b/library/PesyConf.re @@ -0,0 +1,1153 @@ +open Printf; +open PesyUtils; +open PesyUtils.NoLwt; + +exception NullJSONValue(unit); + +module Library: { + module Mode: { + exception InvalidLibraryMode(unit); + type t; + let ofString: string => t; + let toString: t => string; + }; + type t; + let create: + ( + string, + option(list(Mode.t)), + option(list(string)), + option(list(string)), + option(list(string)), + option(bool) + ) => + t; + let toDuneStanza: (Common.t, t) => (string, string); +} = { + module Mode = { + exception InvalidLibraryMode(unit); + type t = + | Native + | Byte + | Best; + let ofString = + fun + | "best" => Best + | "native" => Native + | "byte" => Byte + | _ => raise(InvalidLibraryMode()); + let toString = + fun + | Best => "best" + | Native => "native" + | Byte => "byte"; + }; + type t = { + namespace: string, + modes: option(list(Mode.t)), + cNames: option(list(string)), + virtualModules: option(list(string)), + implements: option(list(string)), + wrapped: option(bool), + }; + let create = (namespace, modes, cNames, virtualModules, implements, wrapped) => { + namespace, + modes, + cNames, + virtualModules, + implements, + wrapped, + }; + let toDuneStanza = (common, lib) => { + /* let {name: pkgName, require, path} = common */ + let { + namespace, + modes: modesP, + cNames: cNamesP, + virtualModules: virtualModulesP, + implements: implementsP, + wrapped: wrappedP, + } = lib; + let ( + public_name, + libraries, + flags, + ocamlcFlags, + ocamloptFlags, + jsooFlags, + preprocess, + includeSubdirs, + rawBuildConfig, + rawBuildConfigFooter, + ) = + Common.toDuneStanzas(common); + let path = Common.getPath(common); + let name = Stanza.create("name", Stanza.createAtom(namespace)); + + let modesD = + switch (modesP) { + | None => None + | Some(l) => + Some( + Stanza.createExpression([ + Stanza.createAtom("modes"), + ...List.map(m => m |> Mode.toString |> Stanza.createAtom, l), + ]), + ) + }; + + let cNamesD = + switch (cNamesP) { + | None => None + | Some(l) => + Some( + Stanza.createExpression([ + Stanza.createAtom("c_names"), + ...List.map(Stanza.createAtom, l), + ]), + ) + }; + + let virtualModulesD = + switch (virtualModulesP) { + | None => None + | Some(l) => + Some( + Stanza.createExpression([ + Stanza.createAtom("virtual_modules"), + ...List.map(Stanza.createAtom, l), + ]), + ) + }; + + let implementsD = + switch (implementsP) { + | None => None + | Some(l) => + Some( + Stanza.createExpression([ + Stanza.createAtom("implements"), + ...List.map(Stanza.createAtom, l), + ]), + ) + }; + + let wrappedD = + switch (wrappedP) { + | None => None + | Some(w) => + Some( + Stanza.createExpression([ + Stanza.createAtom("wrapped"), + Stanza.createAtom(string_of_bool(w)), + ]), + ) + }; + + let mandatoryExpressions = [name, public_name]; + let optionalExpressions = [ + libraries, + modesD, + cNamesD, + virtualModulesD, + implementsD, + wrappedD, + flags, + ocamlcFlags, + ocamloptFlags, + jsooFlags, + preprocess, + includeSubdirs, + ]; + + let rawBuildConfig = + switch (rawBuildConfig) { + | Some(l) => l + | None => [] + }; + + let rawBuildConfigFooter = + switch (rawBuildConfigFooter) { + | Some(l) => l + | None => [] + }; + + let library = + Stanza.createExpression([ + Stanza.createAtom("library"), + ...mandatoryExpressions + @ filterNone(optionalExpressions) + @ rawBuildConfig, + ]); + + (path, DuneFile.toString([library, ...rawBuildConfigFooter])); + }; +}; + +module Executable: { + type t; + module Mode: { + type t; + let ofList: list(string) => t; + let toList: t => list(string); + }; + let create: (string, option(Mode.t)) => t; + let toDuneStanza: (Common.t, t) => (string, string); +} = { + module Mode = { + exception InvalidCompilationMode(unit); + exception InvalidBinaryKind(unit); + module Compilation: { + type t; + let toString: t => string; + let ofString: string => t; + } = { + type t = + | Byte + | Native + | Best; + + let toString = + fun + | Byte => "byte" + | Native => "native" + | Best => "best"; + + let ofString = + fun + | "byte" => Byte + | "native" => Native + | "best" => Best + | _ => raise(InvalidCompilationMode()); + }; + + module BinaryKind: { + type t; + let toString: t => string; + let ofString: string => t; + } = { + type t = + | C + | Exe + | Object + | Shared_object; + + let toString = + fun + | C => "c" + | Exe => "exe" + | Object => "object" + | Shared_object => "shared_object"; + + let ofString = + fun + | "c" => C + | "exe" => Exe + | "object" => Object + | "shared_object" => Shared_object + | _ => raise(InvalidBinaryKind()); + }; + + type t = (Compilation.t, BinaryKind.t); + exception InvalidExecutableMode(string); + let ofList = parts => + switch (parts) { + | [c, b] => (Compilation.ofString(c), BinaryKind.ofString(b)) + | _ => + raise( + InvalidExecutableMode( + sprintf( + "Invalid executable mode: expected of the form (, ). Got %s", + List.fold_left((a, e) => sprintf("%s %s", a, e), "", parts), + ), + ), + ) + }; + let toList = m => { + let (c, b) = m; + [Compilation.toString(c), BinaryKind.toString(b)]; + }; + }; + type t = { + main: string, + modes: option(Mode.t), + }; + let create = (main, modes) => {main, modes}; + let toDuneStanza = (common: Common.t, e) => { + /* let {name: pkgName, require, path} = common; */ + let {main, modes: modesP} = e; + let ( + public_name, + libraries, + flags, + ocamlcFlags, + ocamloptFlags, + jsooFlags, + preprocess, + includeSubdirs, + rawBuildConfig, + rawBuildConfigFooter, + ) = + Common.toDuneStanzas(common); + let path = Common.getPath(common); + let name = Stanza.create("name", Stanza.createAtom(main)); + /* let public_name = */ + /* Stanza.create("public_name", Stanza.createAtom(pkgName)); */ + + /* let libraries = */ + /* switch (require) { */ + /* | [] => None */ + /* | libs => */ + /* Some( */ + /* Stanza.createExpression([ */ + /* Stanza.createAtom("libraries"), */ + /* ...List.map(r => Stanza.createAtom(r), libs), */ + /* ]), */ + /* ) */ + /* }; */ + + let modesD = + switch (modesP) { + | None => None + | Some(m) => + Some( + Stanza.createExpression([ + Stanza.createAtom("modes"), + Stanza.createExpression( + m |> Mode.toList |> List.map(Stanza.createAtom), + ), + ]), + ) + }; + + let mandatoryExpressions = [name, public_name]; + let optionalExpressions = [ + libraries, + modesD, + flags, + ocamlcFlags, + ocamloptFlags, + jsooFlags, + preprocess, + includeSubdirs, + ]; + + let rawBuildConfig = + switch (rawBuildConfig) { + | Some(l) => l + | None => [] + }; + + let rawBuildConfigFooter = + switch (rawBuildConfigFooter) { + | Some(l) => l + | None => [] + }; + + let executable = + Stanza.createExpression([ + Stanza.createAtom("executable"), + ...mandatoryExpressions + @ filterNone(optionalExpressions) + @ rawBuildConfig, + ]); + + (path, DuneFile.toString([executable, ...rawBuildConfigFooter])); + }; +}; + +type pkgType = + | ExecutablePackage(Executable.t) + | LibraryPackage(Library.t); + +type package = { + common: Common.t, + pkgType, +}; + +exception GenericException(string); + +let getSuffix = name => { + let parts = Str.split(Str.regexp("\\."), name); + switch (List.rev(parts)) { + | [_] + | [] => + raise( + GenericException( + "`name` property of the package must either be .exe (for executables) or . for libraries, where of course suffix is not exe for libraries", + ), + ) + | [suffix, ...r] => suffix + }; +}; + +/* */ +/* Inline ppx is supported too. */ +/* let%test "getSuffix(): must return suffix" = getSuffix("foo.lib") == "lib"; */ +/* */ + +let%expect_test _ = { + print_endline(getSuffix("foo.lib")); + %expect + {| + lib + |}; +}; + +let%expect_test _ = { + print_endline(getSuffix("foo.bar.lib")); + %expect + {| + lib + |}; +}; + +let%expect_test _ = { + print_endline( + try (getSuffix("foo")) { + | GenericException(_) => "Must throw GenericException" + | _ => "Did not throw GenericException" + }, + ); + %expect + {| + Must throw GenericException + |}; +}; + +module FieldTypes = { + type t = + | Bool(bool) + | String(string) + | List(list(t)); + exception ConversionException(string); + let toBool = + fun + | Bool(b) => b + | String(s) => + raise( + ConversionException( + sprintf("Expected string. Actual string (%s)", s), + ), + ) + | List(l) => raise(ConversionException("Expected string. Actual list")); + let toString = + fun + | String(s) => s + | Bool(b) => + raise( + ConversionException( + sprintf("Expected string. Actual bool (%s)", string_of_bool(b)), + ), + ) + | List(_) => raise(ConversionException("Expected string. Actual list")); + let toList = + fun + | List(l) => l + | Bool(b) => + raise( + ConversionException( + sprintf("Expected list. Actual bool (%s)", string_of_bool(b)), + ), + ) + | String(_) => + raise(ConversionException("Expected list. Actual string")); +}; + +/* TODO: Making parsing more lenient? Eg. allow string where single element list is valid */ +module JSON: { + type t; + let ofString: string => t; + let fromFile: string => t; + let member: (t, string) => t; + let toKeyValuePairs: t => list((string, t)); + let toValue: t => FieldTypes.t; + let debug: t => string; +} = { + open Yojson.Basic; + type t = json; + exception InvalidJSONValue(string); + exception MissingJSONMember(string); + let ofString = jstr => from_string(jstr); + let fromFile = path => from_file(path); + let member = (j, m) => + try (Util.member(m, j)) { + | _ => + raise( + MissingJSONMember(Printf.sprintf("%s was missing in the json", m)), + ) + }; + let toKeyValuePairs = (json: json) => + switch (json) { + | `Assoc(jsonKeyValuePairs) => jsonKeyValuePairs + | _ => raise(InvalidJSONValue("Expected key value pairs")) + }; + let rec toValue = (json: json) => + switch (json) { + | `Bool(b) => FieldTypes.Bool(b) + | `String(s) => FieldTypes.String(s) + | `List(jl) => FieldTypes.List(List.map(j => toValue(j), jl)) + | `Null => raise(NullJSONValue()) + | _ => + raise( + InvalidJSONValue( + sprintf( + "Value must be either string, bool or list of string. Found %s", + to_string(json), + ), + ), + ) + }; + let debug = t => to_string(t); +}; + +type t = list(package); +let toPesyConf = (projectPath: string, json: JSON.t): t => { + let pkgs = JSON.toKeyValuePairs(JSON.member(json, "buildDirs")); + List.map( + pkg => { + let (dir, conf) = pkg; + let name = + JSON.member(conf, "name") |> JSON.toValue |> FieldTypes.toString; + let require = + try ( + JSON.member(conf, "require") + |> JSON.toValue + |> FieldTypes.toList + |> List.map(FieldTypes.toString) + ) { + | _ => [] + }; + + let flags = + try ( + Some( + JSON.member(conf, "flags") + |> JSON.toValue + |> FieldTypes.toList + |> List.map(FieldTypes.toString), + ) + ) { + | _ => None + }; + + let ocamlcFlags = + try ( + Some( + JSON.member(conf, "ocamlcFlags") + |> JSON.toValue + |> FieldTypes.toList + |> List.map(FieldTypes.toString), + ) + ) { + | _ => None + }; + + let ocamloptFlags = + try ( + Some( + JSON.member(conf, "ocamloptFlags") + |> JSON.toValue + |> FieldTypes.toList + |> List.map(FieldTypes.toString), + ) + ) { + | _ => None + }; + + let jsooFlags = + try ( + Some( + JSON.member(conf, "jsooFlags") + |> JSON.toValue + |> FieldTypes.toList + |> List.map(FieldTypes.toString), + ) + ) { + | _ => None + }; + + let preprocess = + try ( + Some( + JSON.member(conf, "preprocess") + |> JSON.toValue + |> FieldTypes.toList + |> List.map(FieldTypes.toString), + ) + ) { + | _ => None + }; + + let includeSubdirs = + try ( + Some( + JSON.member(conf, "includeSubdirs") + |> JSON.toValue + |> FieldTypes.toString, + ) + ) { + | NullJSONValue(_) => None + | e => raise(e) + }; + + let rawBuildConfig = + try ( + Some( + JSON.member(conf, "rawBuildConfig") + |> JSON.toValue + |> FieldTypes.toList + |> List.map(FieldTypes.toString), + ) + ) { + | _ => None + }; + + let rawBuildConfigFooter = + try ( + Some( + JSON.member(conf, "rawBuildConfigFooter") + |> JSON.toValue + |> FieldTypes.toList + |> List.map(FieldTypes.toString), + ) + ) { + | _ => None + }; + + let suffix = getSuffix(name); + + switch (suffix) { + | "exe" => + let main = + JSON.member(conf, "main") |> JSON.toValue |> FieldTypes.toString; + let modes = + try ( + Some( + Executable.Mode.ofList( + JSON.member(conf, "modes") + |> JSON.toValue + |> FieldTypes.toList + |> List.map(a => a |> FieldTypes.toString), + ), + ) + ) { + | NullJSONValue () => None + | e => raise(e) + }; + { + common: + Common.create( + name, + Path.(projectPath / dir), + require, + flags, + ocamlcFlags, + ocamloptFlags, + jsooFlags, + preprocess, + includeSubdirs, + rawBuildConfig, + rawBuildConfigFooter, + ), + pkgType: ExecutablePackage(Executable.create(main, modes)), + }; + | _ => + let namespace = + JSON.member(conf, "namespace") + |> JSON.toValue + |> FieldTypes.toString; + let libraryModes = + try ( + Some( + JSON.member(conf, "modes") + |> JSON.toValue + |> FieldTypes.toList + |> List.map(FieldTypes.toString) + |> List.map(Library.Mode.ofString), + ) + ) { + | NullJSONValue () => None + | e => raise(e) + }; + let cStubs = + try ( + Some( + JSON.member(conf, "cNames") + |> JSON.toValue + |> FieldTypes.toList + |> List.map(FieldTypes.toString), + ) + ) { + | NullJSONValue () => None + | e => raise(e) + }; + let virtualModules = + try ( + Some( + JSON.member(conf, "virtualModules") + |> JSON.toValue + |> FieldTypes.toList + |> List.map(FieldTypes.toString), + ) + ) { + | NullJSONValue () => None + | e => raise(e) + }; + let implements = + try ( + Some( + JSON.member(conf, "implements") + |> JSON.toValue + |> FieldTypes.toList + |> List.map(FieldTypes.toString), + ) + ) { + | NullJSONValue () => None + | e => raise(e) + }; + let wrapped = + try ( + Some( + JSON.member(conf, "wrapped") + |> JSON.toValue + |> FieldTypes.toBool, + ) + ) { + | NullJSONValue () => None + | e => raise(e) + }; + { + common: + Common.create( + name, + Path.(projectPath / dir), + require, + flags, + ocamlcFlags, + ocamloptFlags, + jsooFlags, + preprocess, + includeSubdirs, + rawBuildConfig, + rawBuildConfigFooter, + ), + pkgType: + LibraryPackage( + Library.create( + namespace, + libraryModes, + cStubs, + virtualModules, + implements, + wrapped, + ), + ), + }; + }; + }, + pkgs, + ); +}; + +let toPackages = (_prjPath, pkgs) => + List.map( + pkg => + switch (pkg.pkgType) { + | LibraryPackage(l) => Library.toDuneStanza(pkg.common, l) + | ExecutablePackage(e) => Executable.toDuneStanza(pkg.common, e) + }, + pkgs, + ); + +let gen = (prjPath, pkgPath) => { + let json = JSON.fromFile(pkgPath); + let pesyPackages = toPesyConf(prjPath, json); + let dunePackages = toPackages(prjPath, pesyPackages); /* TODO: Could return added, updated, deleted files i.e. packages updated so that the main exe could log nicely */ + List.iter( + dpkg => { + let (path, duneFile) = dpkg; + mkdirp(path); + write(Path.(path / "dune"), duneFile); + }, + dunePackages, + ); +}; + +/* TODO: Figure better test setup */ +let testToPackages = jsonStr => { + let json = JSON.ofString(jsonStr); + let pesyPackages = toPesyConf("", json); + let dunePackages = toPackages("", pesyPackages); + List.map( + p => { + let (_, d) = p; + d; + }, + dunePackages, + ); +}; + +let%expect_test _ = { + let duneFiles = + testToPackages( + {| + { + "buildDirs": { + "test": { + "require": ["foo"], + "main": "Bar", + "name": "Bar.exe" + } + } + } + |}, + ); + List.iter(print_endline, duneFiles); + %expect + {| + (executable (name Bar) (public_name Bar.exe) (libraries foo)) + |}; +}; + +let%expect_test _ = { + let duneFiles = + testToPackages( + {| + { + "buildDirs": { + "testlib": { + "require": ["foo"], + "namespace": "Foo", + "name": "bar.lib", + "modes": ["best"] + } + } + } + |}, + ); + List.iter(print_endline, duneFiles); + %expect + {| + (library (name Foo) (public_name bar.lib) (libraries foo) (modes best)) + |}; +}; + +let%expect_test _ = { + let duneFiles = + testToPackages( + {| + { + "buildDirs": { + "testlib": { + "require": ["foo"], + "namespace": "Foo", + "name": "bar.lib", + "cNames": ["stubs"] + } + } + } + |}, + ); + List.iter(print_endline, duneFiles); + %expect + {| + (library (name Foo) (public_name bar.lib) (libraries foo) (c_names stubs)) + |}; +}; + +let%expect_test _ = { + let duneFiles = + testToPackages( + {| + { + "buildDirs": { + "testlib": { + "namespace": "Foo", + "name": "bar.lib", + "virtualModules": ["foo"] + } + } + } + |}, + ); + List.iter(print_endline, duneFiles); + %expect + {| + (library (name Foo) (public_name bar.lib) (virtual_modules foo)) + |}; +}; + +let%expect_test _ = { + let duneFiles = + testToPackages( + {| + { + "buildDirs": { + "testlib": { + "namespace": "Foo", + "name": "bar.lib", + "implements": ["foo"] + } + } + } + |}, + ); + List.iter(print_endline, duneFiles); + %expect + {| + (library (name Foo) (public_name bar.lib) (implements foo)) + |}; +}; + +let%expect_test _ = { + let duneFiles = + testToPackages( + {| + { + "buildDirs": { + "testlib": { + "namespace": "Foo", + "name": "bar.lib", + "wrapped": false + } + } + } + |}, + ); + List.iter(print_endline, duneFiles); + %expect + {| + (library (name Foo) (public_name bar.lib) (wrapped false)) + |}; +}; + +let%expect_test _ = { + let duneFiles = + testToPackages( + {| + { + "buildDirs": { + "testlib": { + "main": "Foo", + "name": "bar.exe", + "modes": ["best", "c"] + } + } + } + |}, + ); + List.iter(print_endline, duneFiles); + %expect + {| + (executable (name Foo) (public_name bar.exe) (modes (best c))) + |}; +}; + +let%expect_test _ = { + let duneFiles = + testToPackages( + {| + { + "buildDirs": { + "testlib": { + "require": ["foo"], + "namespace": "Foo", + "name": "bar.lib", + "flags": ["-w", "-33+9"] + } + } + } + |}, + ); + List.iter(print_endline, duneFiles); + %expect + {| + (library (name Foo) (public_name bar.lib) (libraries foo) (flags -w -33+9)) + |}; +}; + +let%expect_test _ = { + let duneFiles = + testToPackages( + {| + { + "buildDirs": { + "testlib": { + "namespace": "Foo", + "name": "bar.lib", + "ocamlcFlags": ["-annot", "-c"] + } + } + } + |}, + ); + List.iter(print_endline, duneFiles); + %expect + {| + (library (name Foo) (public_name bar.lib) (ocamlc_flags -annot -c)) + |}; +}; + +let%expect_test _ = { + let duneFiles = + testToPackages( + {| + { + "buildDirs": { + "testlib": { + "namespace": "Foo", + "name": "bar.lib", + "ocamloptFlags": ["-rectypes", "-nostdlib"] + } + } + } + |}, + ); + List.iter(print_endline, duneFiles); + %expect + {| + (library (name Foo) (public_name bar.lib) + (ocamlopt_flags -rectypes -nostdlib)) + |}; +}; + +let%expect_test _ = { + let duneFiles = + testToPackages( + {| + { + "buildDirs": { + "testlib": { + "namespace": "Foo", + "name": "bar.lib", + "jsooFlags": ["-pretty", "-no-inline"] + } + } + } + |}, + ); + List.iter(print_endline, duneFiles); + %expect + {| + (library (name Foo) (public_name bar.lib) (js_of_ocaml -pretty -no-inline)) + |}; +}; + +let%expect_test _ = { + let duneFiles = + testToPackages( + {| + { + "buildDirs": { + "testlib": { + "namespace": "Foo", + "name": "bar.lib", + "preprocess": [ "pps", "lwt_ppx" ] + } + } + } + |}, + ); + List.iter(print_endline, duneFiles); + %expect + {| + (library (name Foo) (public_name bar.lib) (preprocess (pps lwt_ppx))) + |}; +}; + +let%expect_test _ = { + let duneFiles = + testToPackages( + {| + { + "buildDirs": { + "testlib": { + "namespace": "Foo", + "name": "bar.lib", + "includeSubdirs": "unqualified" + } + } + } + |}, + ); + List.iter(print_endline, duneFiles); + %expect + {| + (library (name Foo) (public_name bar.lib) (include_subdirs unqualified)) + |}; +}; + +let%expect_test _ = { + let duneFiles = + testToPackages( + {| + { + "buildDirs": { + "testlib": { + "namespace": "Foo", + "name": "bar.lib", + "rawBuildConfig": [ + "(libraries lwt lwt.unix raw.lib)", + "(preprocess (pps lwt_ppx))" + ] + } + } + } + |}, + ); + List.iter(print_endline, duneFiles); + %expect + {| + (library (name Foo) (public_name bar.lib) (libraries lwt lwt.unix raw.lib) + (preprocess (pps lwt_ppx))) + |}; +}; + +let%expect_test _ = { + let duneFiles = + testToPackages( + {| + { + "buildDirs": { + "testlib": { + "namespace": "Foo", + "name": "bar.lib", + "rawBuildConfigFooter": [ + "(install (section share_root) (files (asset.txt as asset.txt)))" + ] + } + } + } + |}, + ); + List.iter(print_endline, duneFiles); + %expect + {| + (library (name Foo) (public_name bar.lib)) (install (section share_root) (files (asset.txt as asset.txt))) + |}; +}; + +let%expect_test _ = { + let duneFiles = + testToPackages( + {| + { + "buildDirs": { + "testexe": { + "main": "Foo", + "name": "Foo.exe", + "rawBuildConfigFooter": [ + "(install (section share_root) (files (asset.txt as asset.txt)))" + ] + } + } + } + |}, + ); + List.iter(print_endline, duneFiles); + %expect + {| + (executable (name Foo) (public_name Foo.exe)) (install (section share_root) (files (asset.txt as asset.txt))) + |}; +}; diff --git a/library/PesyConf.rei b/library/PesyConf.rei new file mode 100644 index 00000000..e5769ec0 --- /dev/null +++ b/library/PesyConf.rei @@ -0,0 +1 @@ +let gen: (string, string) => unit; diff --git a/library/PesyLib.re b/library/PesyLib.re new file mode 100644 index 00000000..5a3b41f1 --- /dev/null +++ b/library/PesyLib.re @@ -0,0 +1,163 @@ +open PesyUtils; +open Utils; +open NoLwt; +open Printf; +module Mode = Mode; +module PesyConf = PesyConf; + +let bootstrapIfNecessary = projectPath => + if (!isEsyInstalled()) { + fprintf( + stderr, + "ERROR: You haven't installed esy globally. First install esy then try again", + ); + } else { + let packageNameKebab = kebab(Filename.basename(projectPath)); + let packageNameKebabSansScope = removeScope(packageNameKebab); + let packageNameUpperCamelCase = + upperCamelCasify(packageNameKebabSansScope); + let version = "0.0.0"; + let packageJSONTemplate = loadTemplate("pesy-package.template.json"); + let appReTemplate = loadTemplate("pesy-App.template.re"); + let testReTemplate = loadTemplate("pesy-Test.template.re"); + let utilRe = loadTemplate("pesy-Util.template.re"); + let readMeTemplate = loadTemplate("pesy-README.template.md"); + let gitignoreTemplate = loadTemplate("pesy-gitignore.template"); + let esyBuildStepsTemplate = + loadTemplate( + Path.( + "azure-pipeline-templates" / "pesy-esy-build-steps.template.yml" + ), + ); + let packageLibName = packageNameKebabSansScope ++ ".lib"; + + if (!exists("package.json")) { + let packageJSON = + packageJSONTemplate + |> Str.global_replace(r(""), packageNameKebab) + |> Str.global_replace(r(""), version) + |> Str.global_replace(r(""), packageLibName) + |> Str.global_replace( + r(""), + packageNameUpperCamelCase, + ); + write("package.json", packageJSON); + }; + + let appReDir = Path.(projectPath / "executable"); + let appRePath = Path.(appReDir / packageNameUpperCamelCase ++ "App.re"); + + if (!exists(appRePath)) { + let appRe = + Str.global_replace( + r(""), + packageNameUpperCamelCase, + appReTemplate, + ); + let _ = mkdirp(appReDir); + write(appRePath, appRe); + }; + + let utilReDir = Path.(projectPath / "library"); + let utilRePath = Path.(utilReDir / "Util.re"); + + if (!exists(utilRePath)) { + mkdirp(utilReDir); + write(utilRePath, utilRe); + }; + + let testReDir = Path.(projectPath / "test"); + let testRePath = + Path.(testReDir / "Test" ++ packageNameUpperCamelCase ++ ".re"); + + if (!exists(testRePath)) { + let testRe = + Str.global_replace( + r(""), + packageNameUpperCamelCase, + testReTemplate, + ); + let _ = mkdirp(testReDir); + write(testRePath, testRe); + }; + + let readMePath = Path.(projectPath / "README.md"); + + if (!exists(readMePath)) { + let readMe = + readMeTemplate + |> Str.global_replace(r(""), packageNameKebab) + |> Str.global_replace(r(""), packageNameKebab) + |> Str.global_replace(r(""), packageLibName) + |> Str.global_replace( + r(""), + packageNameUpperCamelCase, + ); + write(readMePath, readMe); + }; + + let gitignorePath = Path.(projectPath / ".gitignore"); + + if (!exists(gitignorePath)) { + let gitignore = + gitignoreTemplate + |> Str.global_replace(r(""), packageNameKebab) + |> Str.global_replace(r(""), packageLibName) + |> Str.global_replace( + r(""), + packageNameUpperCamelCase, + ); + write(".gitignore", gitignore); + }; + + let azurePipelinesPath = Path.(projectPath / "azure-pipelines.yml"); + + if (!exists(azurePipelinesPath)) { + let esyBuildSteps = + esyBuildStepsTemplate + |> Str.global_replace( + r(""), + packageNameUpperCamelCase, + ); + copyTemplate( + Path.("azure-pipeline-templates" / "pesy-azure-pipelines.yml"), + Path.(projectPath / "azure-pipelines.yml"), + ); + mkdirp(".ci"); + let ciFilesPath = Path.(projectPath / ".ci"); + write(Path.(ciFilesPath / "esy-build-steps.yml"), esyBuildSteps); + copyTemplate( + Path.("azure-pipeline-templates" / "pesy-publish-build-cache.yml"), + Path.(ciFilesPath / "publish-build-cache.yml"), + ); + copyTemplate( + Path.("azure-pipeline-templates" / "pesy-restore-build-cache.yml"), + Path.(ciFilesPath / "restore-build-cache.yml"), + ); + }; + + let libKebab = packageNameKebabSansScope; + let duneProjectFile = Path.(projectPath / "dune-project"); + if (!exists(duneProjectFile)) { + write(duneProjectFile, spf({|(lang dune 1.2) +(name %s) +|}, libKebab)); + }; + + let opamFileName = libKebab ++ ".opam"; + let opamFile = Path.(projectPath / opamFileName); + if (!exists(opamFile)) { + write(opamFile, ""); + }; + + let rootDuneFile = Path.(projectPath / "dune"); + + if (!exists(rootDuneFile)) { + write(rootDuneFile, "(ignored_subdirs (node_modules))"); + }; + }; + +let generateBuildFiles = projectRoot => { + let packageJSONPath = Path.(projectRoot / "package.json"); + PesyConf.gen(projectRoot, packageJSONPath); +}; diff --git a/library/Stanza.re b/library/Stanza.re new file mode 100644 index 00000000..e3686d80 --- /dev/null +++ b/library/Stanza.re @@ -0,0 +1,9 @@ +open Sexplib.Sexp; +type t = Sexplib.Sexp.t; +let createAtom = a => Atom(a); +let create = (stanza: string, expression) => + List([Atom(stanza), expression]); +let createExpression = atoms => List(atoms); +let ofString = s => + Sexplib.Parser.sexp(Sexplib.Lexer.main, Lexing.from_string(s)); +let toSexp = x => x; diff --git a/library/Stanza.rei b/library/Stanza.rei new file mode 100644 index 00000000..a9c4ce8e --- /dev/null +++ b/library/Stanza.rei @@ -0,0 +1,6 @@ +type t; +let create: (string, t) => t; +let createAtom: string => t; +let createExpression: list(t) => t; +let toSexp: t => Sexplib.Sexp.t; +let ofString: string => t; diff --git a/library/Utils.re b/library/Utils.re new file mode 100644 index 00000000..d9ad1998 --- /dev/null +++ b/library/Utils.re @@ -0,0 +1 @@ +let isEsyInstalled = () => true; diff --git a/library/dune b/library/dune new file mode 100644 index 00000000..62b577be --- /dev/null +++ b/library/dune @@ -0,0 +1,7 @@ +(library +(name PesyLib) +(public_name pesy.lib) +(inline_tests (flags -verbose)) +(libraries str pesy.utils sexplib yojson ppx_inline_test.runtime-lib) +(preprocess (pps ppx_expect ppx_inline_test)) +(flags -w -33+9)) ;; TODO: needs attention. Was necessary for inline testing diff --git a/notes/benchmarking.md b/notes/benchmarking.md new file mode 100644 index 00000000..868cbac7 --- /dev/null +++ b/notes/benchmarking.md @@ -0,0 +1,514 @@ +The results of benchmarking a sample "generateEverything.sh" script: + + +DELTAms 5 +DELTAms 11 - detect shell +DELTAms 6 - setup variables +DELTAms 10 - define functions +DELTAms 11 - define build variables +DELTAms 8 - print directories +DELTAms 9 - check lib dir +DELTAms 30 - create lib build file +DELTAms 12 - verify lib build existing contents +DELTAms 12 - setup bin vars +DELTAms 8 - check bin main mod name +DELTAms 10 - check bin main module exists +DELTAms 28 - read existing dune bin contents +DELTAms 23 - create bin dune contents +DELTAms 5 - check bin against required bin +DELTAms 8 - check root dune exists +DELTAms 4 - check opam file exists +DELTAms -989 - check root dune-project file exists +DELTAms 82 - perform actual build + + Build Succeeded! To test a binary: + + esy x ChalkConsole.exe + + +DELTAms 5 - check build failure +DELTAms 8 - end +DELTAms 5 - end + + + +For the following manually instrumented profiling of that script file (requires +gdate be installed). I've since improved the detect shell step (avoided using +grep subprocess). + +All that really matters is the time it takes to run the genEverything script. +It doesn't matter how long it takes to generate the genEverything script. The +biggest impacts for optimization of running genEverything would be: +1. Omitting fields in the generated dune files that aren't present in the + package.json config. + +Note that each measurement has an additional 5ms overhead apparently (so +subtract about 5ms for each measurement to get the real time). + +Some smaller improvements: +- md5 takes about 7ms to execute which blocks running of genEverything.sh, but + just checking for if md5 program exists is time consuming. + If we have a previous build hash, we don't need to check + +Run it in a project by doing `esy b ./_build/genEverything.sh` + + +```sh + +#!/bin/bash + +set -e +set -u + +BOLD=`tput bold` || BOLD='' # Select bold mode +BLACK=`tput setaf 0` || BLACK='' +RED=`tput setaf 1` || RED='' +GREEN=`tput setaf 2` || GREEN='' +YELLOW=`tput setaf 3` || YELLOW='' +RESET=`tput sgr0` || RESET='' + +PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + + + + +# Some operation: +NOW="1$(/opt/homebrew/bin/gdate +%N)" +DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) +echo "DELTAms ${DELTA_MS}" +PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" +MODE="update" +[[ $SHELL =~ "noprofile" ]] && MODE="build" + +# Some operation: +NOW="1$(/opt/homebrew/bin/gdate +%N)" +DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) +echo "DELTAms ${DELTA_MS} - detect shell" +PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + + +LAST_EXE_NAME="" +NOTIFIED_USER="false" +BUILD_STALE_PROBLEM="false" + +DEFAULT_MAIN_MODULE_NAME="Index" + +NOW="1$(/opt/homebrew/bin/gdate +%N)" +DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) +echo "DELTAms ${DELTA_MS} - setup variables" +PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + + + +function notifyUser() { + if [ "${NOTIFIED_USER}" == "false" ]; then + echo "" + if [ "${MODE}" == "build" ]; then + printf " %sAlmost there!%s %sWe just need to prepare a couple of files:%s\\n\\n" "${YELLOW}${BOLD}" "${RESET}" "${BOLD}" "${RESET}" + else + printf " %sPreparing for build:%s\\n\\n" "${YELLOW}${BOLD}" "${RESET}" + fi + NOTIFIED_USER="true" + else + # do nothing + true + fi +} + + +function printDirectory() { + if [ "${MODE}" != "build" ]; then + DIR=$1 + NAME=$2 + NAMESPACE=$3 + REQUIRE=$4 + IS_LAST=$5 + printf "│\\n" + PREFIX="" + if [[ "$IS_LAST" == "last" ]]; then + printf "└─%s/\\n" "$DIR" + PREFIX=" " + else + printf "├─%s/\\n" "$DIR" + PREFIX="│ " + fi + printf "%s%s\\n" "$PREFIX" "$NAME" + printf "%s%s\\n" "$PREFIX" "$NAMESPACE" + if [ -z "$REQUIRE" ]; then + true + else + if [ "$REQUIRE" != " " ]; then + printf "%s%s\\n" "$PREFIX" "$REQUIRE" + fi + fi + fi +} + + +NOW="1$(/opt/homebrew/bin/gdate +%N)" +DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) +echo "DELTAms ${DELTA_MS} - define functions" +PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + + + +PACKAGE_NAME="chalk-console" +PACKAGE_NAME_UPPER_CAMEL="ChalkConsole" +NAMESPACE="ChalkConsole" +PUBLIC_LIB_NAME="chalk-console.lib" +#Default Namespace +lib_NAMESPACE="ChalkConsole" +#Default Requires +lib_REQUIRE="" +#Default Flags +lib_FLAGS="" +lib_OCAMLC_FLAGS="" +lib_OCAMLOPT_FLAGS="" +lib_PREPROCESS="" +lib_C_NAMES="" +#Default Requires +bin_REQUIRE="" +#Default Flags +bin_FLAGS="" +bin_OCAMLC_FLAGS="" +bin_OCAMLOPT_FLAGS="" +bin_PREPROCESS="" +bin_C_NAMES="" +lib_NAMESPACE=""ChalkConsole"" +bin_MAIN_MODULE=""TestChalkConsole"" +lib_REQUIRE=" console.lib chalk.lib " +bin_REQUIRE=" console.lib chalk.lib chalk-console.lib " + + +NOW="1$(/opt/homebrew/bin/gdate +%N)" +DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) +echo "DELTAms ${DELTA_MS} - define build variables" +PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + +printDirectory "lib" "library name: chalk-console.lib" "namespace: $lib_NAMESPACE" "require: $lib_REQUIRE" not-last +printDirectory "bin" "name: ChalkConsole.exe" "main: ${bin_MAIN_MODULE:-$DEFAULT_MAIN_MODULE_NAME}" "require:$bin_REQUIRE" last + + +NOW="1$(/opt/homebrew/bin/gdate +%N)" +DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) +echo "DELTAms ${DELTA_MS} - print directories" +PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + + +# Perform validation: + +LIB_DIR="${cur__root}/lib" +LIB_DUNE_FILE="${LIB_DIR}/dune" + +# TODO: Error if there are multiple libraries all using the default namespace. +if [ -d "${LIB_DIR}" ]; then + true +else + BUILD_STALE_PROBLEM="true" + notifyUser + if [ "${MODE}" == "build" ]; then + printf " □ Your project is missing the lib directory described in package.json buildDirs\\n" + else + printf " %s☒%s Your project is missing the lib directory described in package.json buildDirs\\n" "${BOLD}${GREEN}" "${RESET}" + mkdir -p "${LIB_DIR}" + fi +fi + +NOW="1$(/opt/homebrew/bin/gdate +%N)" +DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) +echo "DELTAms ${DELTA_MS} - check lib dir" +PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + +LIB_DUNE_CONTENTS="" +LIB_DUNE_EXISTING_CONTENTS="" +if [ -f "${LIB_DUNE_FILE}" ]; then + LIB_DUNE_EXISTING_CONTENTS=$(<"${LIB_DUNE_FILE}") +fi +LIB_DUNE_CONTENTS="(library" +LIB_DUNE_CONTENTS=$(printf "%s\\n %s" "${LIB_DUNE_CONTENTS}" " ; !!!! This dune file is generated from the package.json file. Do NOT modify by hand.") +LIB_DUNE_CONTENTS=$(printf "%s\\n %s" "${LIB_DUNE_CONTENTS}" " ; !!!! Instead, edit the package.json and then rerun 'esy pesy' at the project root.") +LIB_DUNE_CONTENTS=$(printf "%s\\n %s" "${LIB_DUNE_CONTENTS}" " ; The namespace other code see this as") +LIB_DUNE_CONTENTS=$(printf "%s\\n %s" "${LIB_DUNE_CONTENTS}" " (name ${lib_NAMESPACE})") +LIB_DUNE_CONTENTS=$(printf "%s\\n %s" "${LIB_DUNE_CONTENTS}" " (public_name chalk-console.lib)") +LIB_DUNE_CONTENTS=$(printf "%s\\n %s\\n" "${LIB_DUNE_CONTENTS}" " (libraries ${lib_REQUIRE})") +LIB_DUNE_CONTENTS=$(printf "%s\\n %s\\n" "${LIB_DUNE_CONTENTS}" " (c_names ${lib_C_NAMES}) ; From package.json cNames field") +LIB_DUNE_CONTENTS=$(printf "%s\\n %s\\n" "${LIB_DUNE_CONTENTS}" " (flags (:standard ${lib_FLAGS})) ; From package.json flags field") +LIB_DUNE_CONTENTS=$(printf "%s\\n %s\\n" "${LIB_DUNE_CONTENTS}" " (ocamlc_flags (:standard ${lib_OCAMLC_FLAGS})) ; From package.json ocamlcFlags field") +LIB_DUNE_CONTENTS=$(printf "%s\\n %s\\n" "${LIB_DUNE_CONTENTS}" " (ocamlopt_flags (:standard ${lib_OCAMLOPT_FLAGS}))) ; From package.json ocamloptFlags") + + +NOW="1$(/opt/homebrew/bin/gdate +%N)" +DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) +echo "DELTAms ${DELTA_MS} - create lib build file" +PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + +if [ "${LIB_DUNE_EXISTING_CONTENTS}" == "${LIB_DUNE_CONTENTS}" ]; then + true +else + notifyUser + BUILD_STALE_PROBLEM="true" + if [ "${MODE}" == "build" ]; then + printf " □ Update lib/dune build config\\n" + else + printf " %s☒%s Update lib/dune build config\\n" "${BOLD}${GREEN}" "${RESET}" + printf "%s" "$LIB_DUNE_CONTENTS" > "${LIB_DUNE_FILE}" + fi +fi + +NOW="1$(/opt/homebrew/bin/gdate +%N)" +DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) +echo "DELTAms ${DELTA_MS} - verify lib build existing contents" +PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + + +BIN_DIR="${cur__root}/bin" +BIN_DUNE_FILE="${BIN_DIR}/dune" +# FOR BINARY IN DIRECTORY bin +bin_MAIN_MODULE="${bin_MAIN_MODULE:-$DEFAULT_MAIN_MODULE_NAME}" + +bin_MAIN_MODULE_NAME="${bin_MAIN_MODULE%%.*}" + + +NOW="1$(/opt/homebrew/bin/gdate +%N)" +DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) +echo "DELTAms ${DELTA_MS} - setup bin vars" +PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + +# https://stackoverflow.com/a/965072 +if [ "$bin_MAIN_MODULE_NAME"=="$bin_MAIN_MODULE" ]; then + # If they did not specify an extension, we'll assume it is .re + bin_MAIN_MODULE_FILENAME="${bin_MAIN_MODULE}.re" +else + bin_MAIN_MODULE_FILENAME="${bin_MAIN_MODULE}" +fi + +NOW="1$(/opt/homebrew/bin/gdate +%N)" +DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) +echo "DELTAms ${DELTA_MS} - check bin main mod name" +PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + + +if [ -f "${BIN_DIR}/${bin_MAIN_MODULE_FILENAME}" ]; then + true +else + BUILD_STALE_PROBLEM="true" + notifyUser + echo "" + if [ "${MODE}" == "build" ]; then + printf " □ Generate %s main module\\n" "${bin_MAIN_MODULE_FILENAME}" + else + printf " %s☒%s Generate %s main module\\n" "${BOLD}${GREEN}" "${RESET}" "${bin_MAIN_MODULE_FILENAME}" + mkdir -p "${BIN_DIR}" + printf "print_endline(\"Hello!\");" > "${BIN_DIR}/${bin_MAIN_MODULE_FILENAME}" + fi +fi + + + +NOW="1$(/opt/homebrew/bin/gdate +%N)" +DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) +echo "DELTAms ${DELTA_MS} - check bin main module exists" +PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + +if [ -d "${BIN_DIR}" ]; then + LAST_EXE_NAME="ChalkConsole.exe" + BIN_DUNE_EXISTING_CONTENTS="" + if [ -f "${BIN_DUNE_FILE}" ]; then + BIN_DUNE_EXISTING_CONTENTS=$(<"${BIN_DUNE_FILE}") + else + BIN_DUNE_EXISTING_CONTENTS="" + fi + + NOW="1$(/opt/homebrew/bin/gdate +%N)" + DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) + echo "DELTAms ${DELTA_MS} - read existing dune bin contents" + PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + + + BIN_DUNE_CONTENTS="(executable" + BIN_DUNE_CONTENTS=$(printf "%s\\n %s" "${BIN_DUNE_CONTENTS}" " ; !!!! This dune file is generated from the package.json file. Do NOT modify by hand.") + BIN_DUNE_CONTENTS=$(printf "%s\\n %s" "${BIN_DUNE_CONTENTS}" " ; !!!! Instead, edit the package.json and then rerun 'esy pesy' at the project root.") + BIN_DUNE_CONTENTS=$(printf "%s\\n %s" "${BIN_DUNE_CONTENTS}" " ; The entrypoint module") + BIN_DUNE_CONTENTS=$(printf "%s\\n %s" "${BIN_DUNE_CONTENTS}" " (name ${bin_MAIN_MODULE_NAME}) ; From package.json main field") + BIN_DUNE_CONTENTS=$(printf "%s\\n %s" "${BIN_DUNE_CONTENTS}" " (public_name ChalkConsole.exe) ; From package.json name field") + BIN_DUNE_CONTENTS=$(printf "%s\\n %s\\n" "${BIN_DUNE_CONTENTS}" " (libraries ${bin_REQUIRE}) ; From package.json require field (array of strings)") + BIN_DUNE_CONTENTS=$(printf "%s\\n %s\\n" "${BIN_DUNE_CONTENTS}" " (flags (:standard ${bin_FLAGS})) ; From package.json flags field") + BIN_DUNE_CONTENTS=$(printf "%s\\n %s\\n" "${BIN_DUNE_CONTENTS}" " (ocamlc_flags (:standard ${bin_OCAMLC_FLAGS})) ; From package.json ocamlcFlags field") + BIN_DUNE_CONTENTS=$(printf "%s\\n %s\\n" "${BIN_DUNE_CONTENTS}" " (ocamlopt_flags (:standard ${bin_OCAMLOPT_FLAGS}))) ; From package.json ocamloptFlags field") + + + + NOW="1$(/opt/homebrew/bin/gdate +%N)" + DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) + echo "DELTAms ${DELTA_MS} - create bin dune contents" + PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + + if [ "${BIN_DUNE_EXISTING_CONTENTS}" == "${BIN_DUNE_CONTENTS}" ]; then + true + else + notifyUser + BUILD_STALE_PROBLEM="true" + if [ "${MODE}" == "build" ]; then + printf " □ Update bin/dune build config\\n" + else + printf " %s☒%s Update bin/dune build config\\n" "${BOLD}${GREEN}" "${RESET}" + printf "%s" "${BIN_DUNE_CONTENTS}" > "${BIN_DUNE_FILE}" + mkdir -p "${BIN_DIR}" + fi + fi + + NOW="1$(/opt/homebrew/bin/gdate +%N)" + DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) + echo "DELTAms ${DELTA_MS} - check bin against required bin" + PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + +else + BUILD_STALE_PROBLEM="true" + notifyUser + if [ "${MODE}" == "build" ]; then + printf " □ Generate missing the bin directory described in package.json buildDirs\\n" + else + printf " %s☒%s Generate missing the bin directory described in package.json buildDirs\\n" "${BOLD}${GREEN}" "${RESET}" + mkdir -p "${BIN_DIR}" + fi +fi + +if [ -f "${cur__root}/dune" ]; then + true +else + BUILD_STALE_PROBLEM="true" + notifyUser + if [ "${MODE}" == "build" ]; then + printf " □ Update ./dune to ignore node_modules\\n" + else + printf " %s☒%s Update ./dune to ignore node_modules\\n" "${BOLD}${GREEN}" "${RESET}" + printf "(ignored_subdirs (node_modules))" > "${cur__root}/dune" + fi +fi + +NOW="1$(/opt/homebrew/bin/gdate +%N)" +DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) +echo "DELTAms ${DELTA_MS} - check root dune exists" +PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + + + +if [ -f "${cur__root}/${PACKAGE_NAME}.opam" ]; then + true +else + BUILD_STALE_PROBLEM="true" + notifyUser + if [ "${MODE}" == "build" ]; then + printf " □ Add %s\\n" "${PACKAGE_NAME}.opam" + else + printf " %s☒%s Add %s\\n" "${BOLD}${GREEN}" "${RESET}" "${PACKAGE_NAME}.opam" + touch "${cur__root}/${PACKAGE_NAME}.opam" + fi +fi + + +NOW="1$(/opt/homebrew/bin/gdate +%N)" +DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) +echo "DELTAms ${DELTA_MS} - check opam file exists" +PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + + +if [ -f "${cur__root}/dune-project" ]; then + true +else + BUILD_STALE_PROBLEM="true" + notifyUser + if [ "${MODE}" == "build" ]; then + printf " □ Add a ./dune-project\\n" + else + printf " %s☒%s Add a ./dune-project\\n" "${BOLD}${GREEN}" "${RESET}" + printf "(lang dune 1.0)\\n (name %s)" "${PACKAGE_NAME}" > "${cur__root}/dune-project" + fi +fi + +NOW="1$(/opt/homebrew/bin/gdate +%N)" +DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) +echo "DELTAms ${DELTA_MS} - check root dune-project file exists" +PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + + +if [ "${MODE}" == "build" ]; then + if [ "${BUILD_STALE_PROBLEM}" == "true" ]; then + printf "\\n %sTo perform those updates and build run:%s\n\n" "${BOLD}${YELLOW}" "${RESET}" + printf " esy pesy\\n\\n\\n\\n" + exit 1 + else + # If you list a refmterr as a dev dependency, we'll use it! + + BUILD_FAILED="" + if hash refmterr 2>/dev/null; then + refmterr dune build -p "${PACKAGE_NAME}" || BUILD_FAILED="true" + else + dune build -p "${PACKAGE_NAME}" || BUILD_FAILED="true" + fi + + NOW="1$(/opt/homebrew/bin/gdate +%N)" + DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) + echo "DELTAms ${DELTA_MS} - perform actual build" + PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + + if [ -z "$BUILD_FAILED" ]; then + printf "\\n%s Build Succeeded!%s " "${BOLD}${GREEN}" "${RESET}" + if [ -z "$LAST_EXE_NAME" ]; then + printf "\\n\\n" + true + else + # If we built an EXE + printf "%sTo test a binary:%s\\n\\n" "${BOLD}" "${RESET}" + printf " esy x %s\\n\\n\\n" "${LAST_EXE_NAME}" + fi + true + NOW="1$(/opt/homebrew/bin/gdate +%N)" + DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) + echo "DELTAms ${DELTA_MS} - check build failure" + PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + else + exit 1 + fi + fi +else + # In update mode. + if [ "${BUILD_STALE_PROBLEM}" == "true" ]; then + printf "\\n %sUpdated!%s %sNow run:%s\\n\\n" "${BOLD}${GREEN}" "${RESET}" "${BOLD}" "${RESET}" + printf " esy build\\n\\n\\n" + else + printf "\\n %sAlready up to date!%s %sNow run:%s\\n\\n" "${BOLD}${GREEN}" "${RESET}" "${BOLD}" "${RESET}" + printf " esy build\\n\\n\\n" + fi +fi + + NOW="1$(/opt/homebrew/bin/gdate +%N)" + DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) + echo "DELTAms ${DELTA_MS} - end" + PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + + NOW="1$(/opt/homebrew/bin/gdate +%N)" + DELTA_MS=$(( $(($NOW-$PREV_TIME)) / 1000000)) + echo "DELTAms ${DELTA_MS} - end" + PREV_TIME="1$(/opt/homebrew/bin/gdate +%N)" + +``` + + + +Although we quickly call into genEverything if the package.json hasn't changed, +there appears to be an 80ms overhead in pesy until we get to that point. + + +DELTAms 4 - baseline margin of error amount +DELTAms 5 - check help +DELTAms 12 - check env +DELTAms 13 - check create +DELTAms 7 - record pesy dir + +super-project-now@0.0.0 +DELTAms 6 - output title +DELTAms 7 - mkdir cur__target_dir +DELTAms 7 - check if md5 exists +DELTAms 12 - compute md5 +DELTAms 14 - get previous md5 diff --git a/package.json b/package.json new file mode 100644 index 00000000..0d3415af --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "pesy", + "version": "0.0.0", + "description": "Pesy.", + "esy": { + "build": [ "refmterr dune build -p #{self.name}" ], + "buildsInSource": "_build", + "release": { + "bin": [ "pesy", "pesy-configure" ], + "includePackages": [ "root" ] + } + }, + "scripts": { + "test": "esy dune runtest" + }, + "dependencies": { + "@esy-ocaml/reason": "*", + "@opam/bos": "*", + "@opam/dune": "*", + "@opam/fpath": "*", + "@opam/ppx_expect": "v0.11.1", + "@opam/ppx_inline_test": "v0.11.0", + "@opam/sexplib": "v0.11.0", + "@opam/yojson": "1.4.1", + "ocaml": "~4.6.0", + "refmterr": "*" + }, + "devDependencies": { "@opam/merlin": "*" } +} diff --git a/pesy.opam b/pesy.opam new file mode 100644 index 00000000..e69de29b diff --git a/scripts/run.bat b/scripts/run.bat new file mode 100644 index 00000000..73311006 --- /dev/null +++ b/scripts/run.bat @@ -0,0 +1,7 @@ +call esy build +call esy npm-release +call cd _release +call npm pack +call npm install -g ./pesy-0.0.0.tgz +call cd .. +call .\_build\install\default\bin\TestPesyConfigure.exe diff --git a/scripts/run.sh b/scripts/run.sh new file mode 100755 index 00000000..3b20f583 --- /dev/null +++ b/scripts/run.sh @@ -0,0 +1,12 @@ +#! /bin/bash + +rm -rf _release +esy i && +esy b && +esy npm-release && +cd _release && +npm pack && +npm i -g ./pesy-0.0.0.tgz && +cd .. +./_build/install/default/bin/TestPesyConfigure.exe + diff --git a/utils/PesyUtils.re b/utils/PesyUtils.re new file mode 100644 index 00000000..b615c34b --- /dev/null +++ b/utils/PesyUtils.re @@ -0,0 +1,215 @@ +let prompt = q => { + print_endline(q); + read_line(); +}; + +let kebab = str => { + let charStrings = Str.split(Str.regexp_string(""), str); + let k = + String.concat( + "", + List.map( + c => + if (Char.code(c.[0]) >= 65 && Char.code(c.[0]) <= 90) { + "-" ++ String.lowercase_ascii(c); + } else { + c; + }, + charStrings, + ), + ); + if (k.[0] == '-') { + String.sub(k, 1, String.length(k) - 1); + } else { + k; + }; +}; + +let getCurrentDirName = () => Filename.basename(Sys.getenv("PWD")); + +let upperCamelCasify = kebab => { + let parts = Str.split(Str.regexp_string("-"), kebab); + let k = String.concat("", List.map(String.capitalize_ascii, parts)); + if (k.[0] == '-') { + String.sub(k, 1, String.length(k) - 1); + } else { + k; + }; +}; + +let removeScope = kebab => + Str.global_replace(Str.regexp("[^\\/]*/"), "", kebab); + +module NoLwt = { + open Printf; + let write = (file, str) => { + let oc = open_out(file); + fprintf(oc, "%s", str); + close_out(oc); + }; +}; + +let readFile = file => { + let buf = ref(""); + let breakOut = ref(false); + let ic = open_in(file); + while (! breakOut^) { + let line = + try (input_line(ic)) { + | End_of_file => + breakOut := true; + ""; + }; + buf := buf^ ++ "\n" ++ line; + }; + buf^; +}; + +module Path = { + let (/) = Filename.concat; +}; + +let parent = Filename.dirname; + +let loadTemplate = name => + readFile( + Path.( + (Sys.executable_name |> parent |> parent) + / "share" + / "template-repo" + / name + ), + ); + +let buffer_size = 8192; +let buffer = Bytes.create(buffer_size); +let copyTemplate = (input_name, output_name) => { + open Unix; + let fd_in = + openfile( + Path.( + (Sys.executable_name |> parent |> parent) + / "share" + / "template-repo" + / input_name + ), + [O_RDONLY], + 0, + ); + let fd_out = openfile(output_name, [O_WRONLY, O_CREAT, O_TRUNC], 438); + let rec copy_loop = () => + switch (read(fd_in, buffer, 0, buffer_size)) { + | 0 => () + | r => + ignore(write(fd_out, buffer, 0, r)); + copy_loop(); + }; + + copy_loop(); + close(fd_in); + close(fd_out); +}; + +let r = Str.regexp; + +let exists = Sys.file_exists; + +let mkdir = (~perms=?, p) => + switch (perms) { + | Some(x) => Unix.mkdir(p, x) + | None => Unix.mkdir(p, 0o755) + }; + +let mkdirp = p => { + let directory_created = + try (Sys.is_directory(p)) { + | Sys_error(_) => false + }; + if (!directory_created) { + mkdir(p); + }; +}; + +let spf = Printf.sprintf; + +let renderAsciiTree = (dir, name, namespace, require, isLast) => + if (isLast) { + spf({js|│ +└─ %s + %s + %s +|js}, dir, name, namespace); + } else { + Printf.sprintf( + {js|│ +├─ %s +│ %s +│ %s +|js}, + dir, + name, + namespace, + ) + ++ (require == "" ? "" : (isLast ? " " : "│ ") ++ require); + }; + +let readFileOpt = f => + if (exists(f)) { + Some(readFile(f)); + } else { + None; + }; + +/* module Cache = { */ +/* module CacheInternal = { */ +/* type t = {path: string}; */ +/* let init = path => {path: path}; */ +/* }; */ +/* let init = () => { */ +/* /\* let cacheStoragePath = *\/ */ +/* /\* Path.((Sys.executable_name |> parent |> parent) / "share" / "cache"); *\/ */ +/* }; */ +/* let get = (cache: CacheInternal.t, key: string) => {}; */ +/* }; */ + +let runCommandWithEnv = (command, args) => { + let attach = + Unix.create_process_env( + command, + Array.append([|command|], args), + Unix.environment(), + ); + let pid = attach(Unix.stdin, Unix.stdout, Unix.stderr); + switch (Unix.waitpid([], pid)) { + | (_, WEXITED(c)) => c + | (_, WSIGNALED(c)) => c + | (_, WSTOPPED(c)) => c + }; +}; + +let filterNone = l => { + let result = ref([]); + let rec loop = + fun + | [] => () + | [h, ...rest] => { + switch (h) { + | Some(a) => result := [a, ...result^] + | None => () + }; + loop(rest); + }; + loop(l); + List.rev(result^); +}; + +let%expect_test _ = { + List.iter( + print_int, + filterNone([Some(1), None, None, Some(2), None, Some(3)]), + ); + %expect + {| + 123 + |}; +}; diff --git a/utils/dune b/utils/dune new file mode 100644 index 00000000..9adcbc38 --- /dev/null +++ b/utils/dune @@ -0,0 +1,7 @@ +(library +(name PesyUtils) +(inline_tests (flags -verbose)) +(public_name pesy.utils) +(libraries unix str) +(preprocess (pps ppx_expect ppx_inline_test)) +(flags -w -6))