Figured out patchelf hack for nixos users

This commit is contained in:
Quinn Dougherty 2022-03-28 22:39:59 -04:00
parent 0deb914805
commit b8159a88e0
5 changed files with 39 additions and 1 deletions

View File

@ -36,6 +36,15 @@ You need `yarn`.
TODO: fill this out based on all the different packages scripts once they cool down.
## If you're on NixOS
You'll need to run a command like this in order to get `yarn build` to run, especially in `packages/squiggle-lang`.
```sh
patchelf --set-interpreter $(patchelf --print-interpreter $(which mkdir)) ./node_modules/gentype/gentype.exe
```
See [here](https://github.com/NixOS/nixpkgs/issues/107375)
# Pull request protocol
Please work against `staging` branch. **Do not** work against `master`. Please do not merge without approval from some subset of Quinn, Sam, and Ozzie; they will be auto-pinged.

View File

@ -44,6 +44,7 @@
yarn2nix
nodePackages.npm
nodejs
patchelf
(pkgs.vscode-with-extensions.override {
vscode = pkgs.vscodium;
vscodeExtensions = pkgs.vscode-utils.extensionsFromVscodeMarketplace [

View File

@ -0,0 +1,23 @@
open Jest
open Expect
open Js.Array
open SymbolicDist
open E.Sp
let makeTest = (~only=false, str, item1, item2) =>
only
? Only.test(str, () => expect(item1) -> toEqual(item2))
: test(str, () => expect(item1) -> toEqual(item2))
let normalParams1: SymbolicDistTypes.normal = {mean: 5.0, stdev: 2.0}
let normalParams2: SymbolicDistTypes.normal = {mean: 10.0, stdev: 2.0}
let normalParams3: SymbolicDistTypes.normal = {mean: 20.0, stdev: 2.0}
let range20 = [0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0]
let forSparkline = (thisPdf, inps) => map(thisPdf, inps)
describe("normal combine", () => {
let pdf1 = x => Normal.pdf(x, normalParams1)
let forSparkline1 = forSparkline(pdf1, range20)
let x = forSparkline1 -> toString -> sparkly -> Js.Console.log
makeTest("Spark1", 1, 0)
})

View File

@ -24,7 +24,8 @@
"mathjs": "10.4.1",
"pdfast": "^0.2.0",
"rationale": "0.2.0",
"rescript": "^9.1.4"
"rescript": "^9.1.4",
"sparkly": "6.0.0"
},
"devDependencies": {
"@glennsl/rescript-jest": "^0.9.0",

View File

@ -441,3 +441,7 @@ module JsArray = {
|> Js.Array.map(Rationale.Option.toExn("Warning: This should not have happened"))
let filter = Js.Array.filter
}
module Sp = {
@module("sparkly") @scope("sparkly") external sparkly: string => string = "sparkly"
}