Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is lablqml trying to write into the ocaml library location instead of its own installation location: #61

Open
jordwalke opened this issue Sep 25, 2019 · 2 comments

Comments

@jordwalke
Copy link

With the following package.json file in the directory, run npm install -g esy && esy

{
  "name": "reason-qml",
  "version": "0.1.0",
  "description": "Starter Reason Esy Pesy Project",
  "esy": {
    "build": "refmterr dune build -p #{self.name}",
    "NOTE": "Optional release Section. Customizes result of `esy release`",
    "buildsInSource": "_build",
    "release": {
      "releasedBinaries": [
        "ReasonQmlApp.exe"
      ]
    },
    "sandboxEnv": {
      "PKG_CONFIG_PATH": "/usr/local/opt/qt/lib/pkgconfig:#{$PKG_CONFIG_PATH}",
      "LD_LIBRARY_PATH": "/usr/local/opt/qt/lib:#{$LD_LIBRARY_PATH}",
      "PATH": "/usr/local/opt/qt/bin:#{$PATH}"
    },
    "buildEnv": {
      "ODOC_SYNTAX": "re",
      "PATH": "/usr/local/opt/qt/bin:#{$PATH}"
    },
    "exportedEnv": {
      "PATH": {
        "val": "/usr/local/opt/qt/bin:#{$PATH}",
        "scope": "global"
      }
    }
  },
  "buildDirs": {
    "test": {
      "imports": [
        "Library = require('reason-qml/library')",
        "Rely = require('rely/lib')"
      ],
      "flags": [
        "-linkall",
        "-g",
        "-w",
        "-9"
      ]
    },
    "testExe": {
      "imports": [
        "Test = require('reason-qml/test')"
      ],
      "bin": {
        "RunReasonQmlTests.exe": "RunReasonQmlTests.re"
      }
    },
    "library": {
      "imports": [
        "Console = require('console/lib')",
        "Pastel = require('pastel/lib')",
        "Lablqml = require('lablqml/lib')"
      ]
    },
    "bin": {
      "imports": [
        "Library = require('reason-qml/library')"
      ],
      "bin": {
        "ReasonQmlApp.exe": "ReasonQmlApp.re"
      }
    }
  },
  "scripts": {
    "start": "esy x ReasonQmlApp.exe",
    "test": "esy x RunReasonQmlTests.exe",
    "doc": "esy dune build @doc",
    "doc-path": "esy echo #{self.target_dir}/default/_doc/_html/index.html"
  },
  "dependencies": {
    "@opam/dune": "*",
    "@reason-native/console": "*",
    "@reason-native/pastel": "*",
    "@reason-native/rely": "*",
    "@esy-ocaml/reason": "*",
    "refmterr": "*",
    "ocaml": "~4.7.0",
    "@opam/lablqml": ">=0.6.2"
  },
  "devDependencies": {
    "@opam/merlin": "*",
    "ocaml": "~4.7.0",
    "@opam/odoc": "*",
    "@pesy/esy-pesy": "0.1.0-alpha.2"
  }
}

Then you get an error that this package is trying to install itself into the ocaml library, not the package's own install location. This destroys reproducible/cached builds.

    # esy-build-package: running: 'make' 'install'
    dune build @install
    dune install
    Installing /Users/jfiorini/.esy/3________________________________________________________________/i/o
caml-4.7.1004-ba9a4808/lib/lablqml/META
    Error: mkdir: /Users/jfiorini/.esy/3________________________________________________________________/
i/ocaml-4.7.1004-ba9a4808/lib/lablqml: Operation not permitted
    make: *** [install] Error 1
    error: command failed: 'make' 'install' (exited with 2)
    esy-build-package: exiting with errors above...

@jordwalke
Copy link
Author

This never usually happens for stock Dune/opam packages. What was done differently about this package build/install?

@jordwalke
Copy link
Author

For example, you don't even need a separate install command, as the package manager (both opam and esy) will do the right thing by default. See how merlin builds:

https://github.com/ocaml/merlin/blob/master/merlin.opam#L8

joefiorini added a commit to joefiorini/lablqml that referenced this issue Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant