Open hdgarrood opened 5 years ago
I’m pretty sure it has, because there are a fair few operating systems and architectures which we don’t support - anything which isn’t x86_64 windows, mac, or linux. I definitely remember seeing issues opened by people on other platforms.
I started porting this via https://github.com/JordanMartinez/purs-installer. However, I ran into issues due to the NPM dependencies used, which are still on CJS modules: cacache. I think everything else is otherwise fine.
What issues? (Not in a good place to clone and try your repo right now, sorry.)
What issues? (Not in a good place to clone and try your repo right now, sorry.)
The cacache
dependency is written using CJS modules with a dynamic import in one of its dependencies. So, bundling the final PureScript code using esbuild and running the result of that fails.
That's surprising! I thought esbuild handled mixed dependencies just fine; pretty sure I've used it for this in the past. Are you invoking esbuild through Spago or separately? Any special arguments?
Oh, if this is only when bundling then declaring the dependency as external should do the trick for esbuild, try with --external:cacache
Spago can pass these through to esbuild, see the config file of spago-bin for an example
Oh! I think the issue was I was naming the output file with a .mjs
extension, which causes Node to run it with ES modules enabled. Dropping that fixes the issue. Also, I don't need to include --external:cacache
to fix this problem. Commits that got this to work: https://github.com/JordanMartinez/purs-installer/compare/ed313e558ac051a0ac1bfb94995fb690f5b3dd36..master
Ok, the setup code for tests has been added (based on the ones in Spago). I'll work on that more later.
I've ported this to PureScipt. One can run it via npm i purs-installer
and npx purs-installer install --purs-version 0.15.14
. However, see the repo's issues for features not yet implemented.
Should we merge that into here?
Would be interesting to know if the code path for building from sources ever ran on anyone's machine, and if it did if it succeeded. Otherwise, I'd put my vote in for getting rid of it.