justinwoo / easy-purescript-nix Goto Github PK
View Code? Open in Web Editor NEWEasy PureScript (and other tools) with Nix
License: MIT License
Easy PureScript (and other tools) with Nix
License: MIT License
I get the following error when running purs
from the 0.14.1
purescript package
$ result/bin/purs
result/bin/purs: /nix/store/cr4d9p20fy7npry1cyjppksjvb79xag1-ncurses-6.1-20190112-abi5-compat/lib/libtinfo.so.5: no version information available (required by result/bin/purs)
Though, the command seems to still work regardless
It would be really neat if https://github.com/nwolverson/purescript-language-server would be added. I guess the definition might be similar to other npm
based tools.
Can you please update spago
. Current version is 0.7.5.0
.
I'd like to do something like this in a container:
containers.mypyPurs =
{ autoStart = true;
privateNetwork = true;
config = { config, pkgs, ... }: {
environment.systemPackages = with pkgs; [
# Shells:
bash
# For PureScript:
# haskellPackages.purescript # using easy-ps instead:
easy-ps.purs
easy-ps.spago
# For mypy/Python
mypy
python38Full
python38Packages.virtualenv
];
I was using the described method to define easy-ps
: https://github.com/justinwoo/my-blog-posts/blob/master/posts/2018-10-24-using-purescript-easily-with-nix.md#using-this-from-downstream-projects
However, when I try to add to systemPackages
as shown, I get an error:
value is a function while a set was expected,
Any suggested workarounds?
@jmackie could you fix this issue?
Bintray, where purty
is currently being released, is down and as a result purty
was understandably removed from the easy-purescript-nix
project (see closed issue #137 and merged PR #139).
I always use purty
when writing PureScript because I'm now accustomed to autoformatters like elm-format
and eslint
. I opened an issue on purty
's GitLab repo to perhaps migrate to GitLab's generic repositories so that there would only be a single point of failure for binary upload and source code. Luckily, purty
still exists in my binary cache for now.
If anyone is familiar with Bazel+GitLab CI, this could be a solution. It would be a nice re-addition to have purty
(regardless of beta-quality) back in the tooling for users.
Currently everything defaults to node-12_x
, but we are using 14.x
in our project. The pscid/default.nix
allows nodejs
to be overridden but when easy-purescript
is being consumed via buildInputs [ easy-purescript.pscid ]
, nodejs
is not overridable.
No real reason why this couldn't just be in another repo
I don't use OSX, but these derivations mostly could depending. There are some isDarwin helpers and such in nixpkgs standard library that you can use for this.
Could be added to build matrix on Travis too.
easy-purescript-nix/psa/node-packages.nix
Lines 288 to 340 in 785a0ca
As currently configured, this derivation wraps psa Node package instead of purescript-psa. The former has nothing to do with PureScript and is not what psa
used to refer to in this repository in the past.
This breaks PureScript source code compilation when being used as a build input (I believe that purs
detects it and plugs it in in a runtime as its output formatter):
Error: ENOENT: no such file or directory, scandir 'announcements'
at Object.readdirSync (node:fs:1452:3)
at Object.<anonymous> (/nix/store/nkd3s8hb4ps3q2ch3ljc4jvs2nwy8q0b-psa-1.0.0/lib/node_modules/psa/index.js:33:26)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47 {
errno: -2,
syscall: 'scandir',
code: 'ENOENT',
path: 'announcements'
}
I think bintray went down.
So what I have been doing is keeping an uncommitted
package.json
around the folders. For instance this inpurs-tidy
:{ "name": "purs-tidy", "version": "0.7.1", "dependencies": { "purs-tidy": "0.7.1" } }When I new version comes in, I bump these numbers to match the NPM release. Following this I just run
node2nix
with the latestnode2nix
version (Node v12 is deprecated, andnode2nix
seems to favor the latest maintenance version instead of latest LTS).After
node2nix
does it's thing. I rungit checkout
on thedefault.nix
to keep the modifications Justin did way back when. Then I go back andnvim default.nix
and edit the version number to match thepackage.json
and generated code.I
git add *.nix
,git commit
and write my merge request message, thengit push github $BRANCH
. The diff this creates is usually minimal which Justin tends to approve of in <48 hours because it's just a few version bumps to read on his end.
Originally posted by @toastal in #146 (comment)
https://github.com/justinwoo/easy-purescript-nix/runs/5388418344?check_suite_focus=true#step:4:1836
purs: /nix/store/j0ibsi9cwb1aaglxmfbzvf18gqw0ylri-ncurses-6.2-abi5-compat/lib/libtinfo.so.5: no version information available (required by purs)
0.14.7
@toastal do you happen to know why purescript releases have ncurses problems now?
Running nix-shell shell.nix
will fail like this one .e.g. aarch64:
unpacking source archive /nix/store/hxjvw76iax0ly65fqz2qz66xkl23308n-dhall-json-1.4.1-x86_64-linux.tar.bz2
source root is bin
setting SOURCE_DATE_EPOCH to timestamp 1569383860 of file bin/yaml-to-dhall
patching sources
updateAutotoolsGnuConfigScriptsPhase
configuring
no configure script, doing nothing
building
no Makefile, doing nothing
installing
/nix/store/2sbj5bl69mjilbar7amlqhbdv4jfvr34-stdenv-linux/setup: line 1304: /nix/store/pgmdnnchhb8rw7q4y1iyc9rlfq6iv7j2-dhall-json-simple/bin/dhall-to-json: cannot execute binary file: Exec format error
builder for '/nix/store/1gdz67y4vj09wva19g6zpxr21k574l1z-dhall-json-simple.drv' failed with exit code 126
building '/nix/store/1lx798zxkhx8hdnfl4bgh8s73a3dkj39-dhall-json-simple.drv'...
cannot build derivation '/nix/store/vg0s1yy88vq2y5bmvjbrjqxq3nmmvdk5-spago2nix.drv': 1 dependencies couldn't be built
error: build of '/nix/store/1lx798zxkhx8hdnfl4bgh8s73a3dkj39-dhall-json-simple.drv', '/nix/store/2c0yf1ggxjrc84hp1ab7k1z34a8lhnxv-purescript-0.13.2.drv', '/nix/store/75j26im2kil7cc6a2j176r074g7293iq-zephyr-0.2.2.drv', '/nix/store/ccz8nf2apqd2rclqi41m48pziql469v9-node-pscid-2.6.0.drv', '/nix/store/dgbrdzlvlmwac0gbdnspnpr8gaql1fr2-purescript-0.13.4.drv', '/nix/store/gjrpsmnrf957nw7khfqhgnlahsc474zg-psc-package-simple-0.6.2.drv', '/nix/store/gprmr1k03mszv3njkjlfq4r12lps9sqc-spago-0.15.2.drv', '/nix/store/gyjdkcg80lndfnh996m8q43idbwbm3xn-purescript-v0.13.6.drv', '/nix/store/l7k0whhygzng1v39vizmdzdjh97nl6bq-psc-package2nix.drv', '/nix/store/m3c2q1c3kbwzmmkb6pbag2y53szi87xj-purty-4.5.1.drv', '/nix/store/mb7n5vb6rkhdicjpdh9s9z2adv5ccwkj-dhall-simple.drv', '/nix/store/q0v76mx8l7af6k36p6iysn632b967zkl-purescript-0.13.0.drv', '/nix/store/s5kfiqzliwim4f6r1p3dw38n9hpkks8s-purescript-0.13.3.drv', '/nix/store/vg0s1yy88vq2y5bmvjbrjqxq3nmmvdk5-spago2nix.drv', '/nix/store/wgivcf3l8zqw5nqnhjd8dp3354y4cdaz-purescript-0.13.5.drv', '/nix/store/yxk4rndyfj1ngk8aqmybzhzksc8k49sr-purp.drv' failed
that'd be great! ๐
on Mac m1 mini, I git cloned the repo, then ran
nix-shell ./ci.nix
appear to be getting bad cpu type with names mentioning Mac OS x86 on m1 chip
building '/nix/store/y8v3hq9adc1fkhciv2p5m83796bzmmkm-dhall-1.32.0-x86_64-macos.tar.bz2.drv'...
trying https://github.com/dhall-lang/dhall-haskell/releases/download/1.32.0/dhall-1.32.0-x86_64-macos.tar.bz2
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 670 100 670 0 0 1969 0 --:--:-- --:--:-- --:--:-- 1970
100 3002k 100 3002k 0 0 2314k 0 0:00:01 0:00:01 --:--:-- 4370k
building '/nix/store/njv5nxypaqm45pd14f0rsqlmaw75w8lw-dhall-json-1.4.1-x86_64-macos.tar.bz2.drv'...
trying https://github.com/dhall-lang/dhall-haskell/releases/download/1.26.1/dhall-json-1.4.1-x86_64-macos.tar.bz2
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 674 100 674 0 0 2168 0 --:--:-- --:--:-- --:--:-- 2174
100 10.0M 100 10.0M 0 0 9.9M 0 0:00:01 0:00:01 --:--:-- 25.2M
building '/nix/store/byw97gmvd1h3lcwdiwxp1jmdixrf0z2j-dhall-simple.drv'...
unpacking sources
unpacking source archive /nix/store/cpnkcr7drghx8il4iwxdllvak8ak51ha-dhall-1.32.0-x86_64-macos.tar.bz2
source root is bin
setting SOURCE_DATE_EPOCH to timestamp 1589062082 of file bin/dhall
patching sources
updateAutotoolsGnuConfigScriptsPhase
configuring
no configure script, doing nothing
building
no Makefile, doing nothing
installing
/nix/store/0qlq4s175mzlx9g0aqcdk95j92g1z7mf-stdenv-darwin/setup: line 1367: /nix/store/hql0mdgjbiax4qhm3i6hk8371c9fs2af-dhall-simple/bin/dhall: Bad CPU type in executable
error: builder for '/nix/store/byw97gmvd1h3lcwdiwxp1jmdixrf0z2j-dhall-simple.drv' failed with exit code 126;
last 10 log lines:
> source root is bin
> setting SOURCE_DATE_EPOCH to timestamp 1589062082 of file bin/dhall
> patching sources
> updateAutotoolsGnuConfigScriptsPhase
> configuring
> no configure script, doing nothing
> building
> no Makefile, doing nothing
> installing
> /nix/store/0qlq4s175mzlx9g0aqcdk95j92g1z7mf-stdenv-darwin/setup: line 1367: /nix/store/hql0mdgjbiax4qhm3i6hk8371c9fs2af-dhall-simple/bin/dhall: Bad CPU type in executable
I'm new to nix and macOS dev am not sure what to do. I will use a different computer for now.
add scripts to update packages
e.g. I always add update.sh
script to update revision.json
/other logic
example https://github.com/srghma/dotfiles/blob/master/nixos/pkgs/dunsted-volume/update.sh
this way I dont need to look for new commit, paste it in nix file, make nix-build
, then update expected hash
I just run update.sh
and that's all
Why I suggest this:
N.B. it would be good to have some script update-everything.sh
that would run all update.sh
scripts in repo
hi. I'm new to Purescript so I'm not sure if this makes sense:
cloned the repository
nix-shell ./ci.nix
mkdir test
cd test
pulp init
Error message:
ERROR: No bower
executable found.
Pulp no longer bundles Bower. You'll need to install it manually:
npm install -g bower
I was hoping to try out the pulp browserify feature. I don't believe that is in spago yet. If you have a workaround, I will try it.
@kritzcreek has made a new version that should fix some hangs.
kritzcreek/pscid@338d7ef
need to fix .lib references to work with new nix and nixpkgs
People would like to have multiple versions of purs, spago, etc. exposed. This can be done probably in a simple enough scheme:
purs.nix
->
purs/default.nix (import ./0.13.2.nix)
purs/0.13.2.nix
purs/0.13.0.nix
root default.nix
purs = import ./purs { inherit pkgs; }
purs-0.13.2 = import ./purs/0.13.2.nix { inherit pkgs; }
etc
I definitely don't want to block this, but importing nixpkgs from the classic file makes stuff like
inputs.easy-purescript.inputs.nixpkgs.follows = "nixpkgs";
impossible
Originally posted by @voidus in #134 (comment)
Lines 7 to 8 in 3dc8d80
since my primary usecase is for CI pipelines, would love to see purescript-psa added as I'm using it for catching compiler warnings and turning them into errors
Hello Justin, perhaps I'm doing something wrong, but I get a hash mismatch when I try to start nix-shell on nixos: 19.09.840.8bf142e001b (Loris)
Any idea please?
hash mismatch in fixed-output derivation '/nix/store/hxjvw76iax0ly65fqz2qz66xkl23308n-dhall-json-1.4.1-x86_64-linux.tar.bz2':
wanted: sha256:0hv5x8ps0z74acsh91ivlg5vw7r0c8p0g92ca1mxm7m4p4vf936k
got: sha256:1hpd3rwpawwgpb5v2ib5hnsl1jbw4p109hhd6qhi2fc8rd7g5s89
cannot build derivation '/nix/store/d3hygd9myx8bpby4kahcm2nm3m3lkycg-dhall-json-simple.drv': 1 dependencies couldn't be built
error: build of '/nix/store/6rqgbc2l51mprmr11dqppbsrqxrfqgvx-psc-package-simple.drv', '/nix/store/8wdfz19487h1lk1jxix7d2zxnsxfwpr4-node-pscid-2.6.0.drv', '/nix/store/ckjiakym33gx8l0yr36da4262655yabv-zephyr.drv', '/nix/store/d3hygd9myx8bpby4kahcm2nm3m3lkycg-dhall-json-simple.drv', '/nix/store/hisn48bpwpncdgg52fnm2izc7ypgx23m-spago2nix.drv', '/nix/store/hlbh86i596sqxli69i31vzy2pjaqpka0-purescript.drv', '/nix/store/k62v4dyvgqkaw8xfz8il1j1kmisnyybc-psc-package2nix.drv', '/nix/store/viqqilrilfdzi1qjn4lkw5hw07ipw8ci-spago.drv' failed
pulp
is required to publish packages to Pursuit, right? I'd like to have pulp
in my shell.nix
.
Following the template of
easy-purescript-nix/remote-test.nix
Line 17 in 93b47ad
I have in my shell.nix
something like this:
buildInputs = [
remote.purs-0_13_8
remote.psc-package
remote.spago
pkgs.nodejs-13_x
pkgs.nodePackages.bower
pkgs.nodePackages.pulp
];
but nix-shell
fails like this while trying to make pulp
:
> install-purescript --purs-ver=0.12.5
sh: install-purescript: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] postinstall: `install-purescript --purs-ver=0.12.5`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /build/.npm/_logs/2020-07-26T14_31_35_943Z-debug.log
builder for '/nix/store/nczy5zk99zy0sa7bdc4ls9h4knnfq3vv-node_pulp-14.0.0.drv' failed with exit code 1
I note that this seems to be doing the wrong thing anyway, it looks like it's trying to build a version of purs
which I don't want.
Advice on how to get pulp
in my shell.nix
? Or how to publish to Pursuit without pulp
?
I'm new to nix so this may be off base but I think spago has an implicit dependency on git since it will clone dependency repositories for building. I was trying to use this package to write a derivation for a nix project and I kept getting Installation failed
. Upon upgrading easy-purescript-nix to the newest version that displays the underlying error, it was because git was missing from the nix-build environment. I think this might be a use case for adding it to propagatedBuildInputs
in the derivation, which I understand to be where you put dependencies that aren't required directly but will be needed downstream.
Hey,
I guess this is more a nix question, how do I update the purs and spago
I tried nix-env -f . -uA spago
or nix-env -f . -uA purs-simple
, they don't work. I have to nix-env -e purs-simple
first, and re-install purs and spago. If there any works to update them ?
Thank you
probably a good deal of crap to go through, but in short
I...
nix-shell ./ci.nix
spago init
spago test
Got the following
[info] Build succeeded.
/bin/sh: node: command not found
[error] Tests failed: exit code: 127
Adding nodejs
to buildInputs
seems to fix it.
I upgraded to master and upon running nix-shell
I get the error message:
error: value is a function while a set was expected, at `default.nix:8:17`
This refers to the line
buildInputs = easy-ps.buildInputs;
Full context:
This is my default.nix
:
{ pkgs ? import <nixpkgs> {} }:
let
easy-ps = import ./easy-ps.nix { inherit pkgs; };
in pkgs.stdenv.mkDerivation {
name = "nerg";
buildInputs = easy-ps.buildInputs;
}
And this is my easy-ps.nix
:
{ pkgs ? import <nixpkgs> {} }:
import (pkgs.fetchFromGitHub {
owner = "justinwoo";
repo = "easy-purescript-nix";
rev = "47507b27e15a9c3b929111cf43d2e9c0e4b97f4c";
sha256 = "0gnwymgm4i5y9vknpcsr99pwy76w14nclqxb6xmmzlw2s8fx85hm";
})
easy-purescript-nix/default.nix
Line 119 in 5716cd7
somewhere in this body causes all of the derivations to be built it seems, which isn't that slow because we do not allow derivations that try to build from source (this was explained a long time ago by me and can be read in the README)
however, i still do not like wasting disk space and time to build derivations for shit i never want to use
these should be fixed at some point to facilitate nix being able to lazily evaluate instead of having to build all of the derivations.
need to do this at some poin
The purs binary has missing libraries, patchelf should be able to help here
$ ldd /nix/store/g0bimx9bfl1dis5hkn5naq1nddwscd9b-purs-simple/bin/purs
linux-vdso.so.1 (0x00007ffffb7fd000)
libm.so.6 => /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libm.so.6 (0x00007f76a4bd5000)
libz.so.1 => not found
libtinfo.so.5 => not found
librt.so.1 => /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/librt.so.1 (0x00007f76a49cd000)
libutil.so.1 => /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libutil.so.1 (0x00007f76a47ca000)
libdl.so.2 => /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libdl.so.2 (0x00007f76a45c6000)
libgmp.so.10 => not found
libpthread.so.0 => /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libpthread.so.0 (0x00007f76a43a7000)
libgcc_s.so.1 => /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libgcc_s.so.1 (0x00007f76a4191000)
libc.so.6 => /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6 (0x00007f76a3ddd000)
/lib64/ld-linux-x86-64.so.2 => /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007f76a4f6a000)
Is it possible to merge #134?
https://github.com/justinwoo/easy-purescript-nix/blob/master/default.nix
Needs { inherit pkgs; }
it seems for all of these
Are there things missing for a "1.0" tag? If so, they should be listed down here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.