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

main.out not being generated? #65

Open
mikesol opened this issue Feb 27, 2021 · 8 comments
Open

main.out not being generated? #65

mikesol opened this issue Feb 27, 2021 · 8 comments

Comments

@mikesol
Copy link

mikesol commented Feb 27, 2021

When running npm t, I'm receiving the following error.

[info] Build succeeded.
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
valgrind: ./main.out: No such file or directory
make[3]: *** [Makefile:22: main_leakcheck] Error 127
make[2]: *** [Makefile:20: premain] Error 2
/home/meeshkan-abel/mike/purec/output/Effect.Aff/foreign.js:526
                throw util.fromLeft(step);
                ^

Error: Subcommand exited with: 2
    at Object.exports.error (/home/meeshkan-abel/mike/purec/output/Effect.Exception/foreign.js:8:10)
    at /home/meeshkan-abel/mike/purec/output/Test.Utils/index.js:47:100
    at ChildProcess.<anonymous> (/home/meeshkan-abel/mike/purec/output/Node.ChildProcess/foreign.js:80:21)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)

I'm wondering if I'm doing something wrong in the setup? Thanks for your help!

@felixSchl
Copy link
Collaborator

Hey, here are the steps we run on CI to get the test to build and run: https://github.com/pure-c/purec/blob/1b7ff43cc011efd4ebb44cfa389e16a7ca954c60/.github/workflows/main.yml. Have you run npm run build?

@mikesol
Copy link
Author

mikesol commented Feb 28, 2021

Hey, thanks for the quick reply. I did run npm run build.
Here is my full console output.

10:12 meeshkan-abel@Abel:~/mike/purec$ npm install
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported

> [email protected] postinstall /home/meeshkan-abel/mike/purec/node_modules/purescript
> install-purescript --purs-ver=0.13.8

ℹ Found a cache at /home/meeshkan-abel/.cache/purescript-npm-installer-nodejs/content-v2/sha512/0c/df

✔ Restore the cached 0.13.8 binary for linux (171ms)
✔ Verify the restored binary works correctly

Installed to /home/meeshkan-abel/mike/purec/node_modules/purescript/purs.bin 50.68 MB


> [email protected] postinstall /home/meeshkan-abel/mike/purec/node_modules/spago
> node ./install.js

npm notice created a lockfile as package-lock.json. You should commit this file.
added 311 packages from 215 contributors and audited 311 packages in 15.283s

12 packages are looking for funding
  run `npm fund` for details

found 4 vulnerabilities (3 low, 1 high)
  run `npm audit fix` to fix them, or `npm audit` for details
10:12 meeshkan-abel@Abel:~/mike/purec$ sudo apt install -y valgrind libcmocka-dev
[sudo] password for meeshkan-abel: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libcmocka-dev is already the newest version (1.1.5-2).
valgrind is already the newest version (1:3.15.0-1ubuntu9.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
10:12 meeshkan-abel@Abel:~/mike/purec$ npm run build

> [email protected] build /home/meeshkan-abel/mike/purec
> spago bundle-app -t purec.js

[info] Build succeeded.
[info] Bundle succeeded and output file to purec.js
10:12 meeshkan-abel@Abel:~/mike/purec$ npm test

> [email protected] test /home/meeshkan-abel/mike/purec
> make check

=== test: c-tests ===================================================
Compile runtime/purescript.c
Compile ccan/asprintf/asprintf.c
Compile vendor/vec.c
[==========] Running 11 test(s).
[ RUN      ] leak_string_test
[       OK ] leak_string_test
[ RUN      ] leak_array_test
[       OK ] leak_array_test
[ RUN      ] leak_record_test
[       OK ] leak_record_test
[ RUN      ] leak_cont_test
[       OK ] leak_cont_test
[ RUN      ] purs_scope_new1_test
[       OK ] purs_scope_new1_test
[ RUN      ] purs_any_concat_test
Expected assertion x.tag == y.tag occurred
Expected assertion x.tag == y.tag occurred
Expected assertion x.tag != PURS_ANY_TAG_NULL occurred
Expected assertion x.tag == y.tag occurred
Expected assertion x.tag == y.tag occurred
Expected assertion x.tag == y.tag occurred
Expected assertion x.tag == y.tag occurred
Expected assertion x.tag == y.tag occurred
Expected assertion x.tag == y.tag occurred
Expected assertion x.tag == y.tag occurred
[       OK ] purs_any_concat_test
[ RUN      ] purs_vec_concat_test
[       OK ] purs_vec_concat_test
[ RUN      ] purs_any_ref_test
[       OK ] purs_any_ref_test
[ RUN      ] purs_any_lazy_test
[       OK ] purs_any_lazy_test
[ RUN      ] purs_cons_test
[       OK ] purs_cons_test
[ RUN      ] purs_string_test
[       OK ] purs_string_test
[==========] 11 test(s) run.
[  PASSED  ] 11 test(s).
=== test: tests =====================================================
tests/00-basic: clean
tests/00-basic: compile C
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
Compiling Main
Compiling from Corefn to C
Compiling .purec-work/main/Main/corefn.json.1...
Compile ../../runtime/purescript.c
Compile ../../ccan/asprintf/asprintf.c
Compile ../../vendor/vec.c
Compile .purec-work/main/Main.c
Purec build succeeded!
tests/00-basic: run ouput
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
tests/01-partialfuns: clean
tests/01-partialfuns: compile C
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
Compiling Main
Compiling from Corefn to C
Compiling .purec-work/main/Main/corefn.json.1...
Compile ../../runtime/purescript.c
Compile ../../ccan/asprintf/asprintf.c
Compile ../../vendor/vec.c
Compile .purec-work/main/Main.c
Purec build succeeded!
tests/01-partialfuns: run ouput
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
tests/02-foreign: clean
tests/02-foreign: compile C
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
Compiling Main
Compiling from Corefn to C
Compiling .purec-work/main/Main/corefn.json.1...
Compile ../../runtime/purescript.c
Compile ../../ccan/asprintf/asprintf.c
Compile ../../vendor/vec.c
Compile .purec-work/main/Main.c
Compile .purec-work/main/Main_ffi.c
Purec build succeeded!
tests/02-foreign: run ouput
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
tests/03-mutrec: clean
tests/03-mutrec: compile C
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
Compiling Main
Compiling from Corefn to C
Compiling .purec-work/main/Main/corefn.json.1...
Compile ../../runtime/purescript.c
Compile ../../ccan/asprintf/asprintf.c
Compile ../../vendor/vec.c
Compile .purec-work/main/Main.c
Purec build succeeded!
tests/03-mutrec: run ouput
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
tests/04-memory: clean
tests/04-memory: compile C
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
Compiling Main
Compiling from Corefn to C
Compiling .purec-work/main/Main/corefn.json.1...
Compile ../../runtime/purescript.c
Compile ../../ccan/asprintf/asprintf.c
Compile ../../vendor/vec.c
Compile .purec-work/main/Main.c
Compile .purec-work/main/Main_ffi.c
Purec build succeeded!
tests/04-memory: run ouput
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
tests/05-datacons: clean
tests/05-datacons: compile C
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
Compiling Main
Compiling from Corefn to C
Compiling .purec-work/main/Main/corefn.json.1...
Compile ../../runtime/purescript.c
Compile ../../ccan/asprintf/asprintf.c
Compile ../../vendor/vec.c
Compile .purec-work/main/Main.c
Purec build succeeded!
tests/05-datacons: run ouput
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
tests/06-typeclasses: clean
tests/06-typeclasses: compile C
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
Compiling Main
Compiling from Corefn to C
Compiling .purec-work/main/Main/corefn.json.1...
Compile ../../runtime/purescript.c
Compile ../../ccan/asprintf/asprintf.c
Compile ../../vendor/vec.c
Compile .purec-work/main/Main.c
Purec build succeeded!
tests/06-typeclasses: run ouput
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
tests/10-prelude: clean
tests/10-prelude: compile C
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
Compiling Type.Data.Row
Compiling Type.Data.RowList
Compiling Record.Unsafe
Compiling Data.NaturalTransformation
Compiling Data.Boolean
Compiling Data.Symbol
Compiling Control.Semigroupoid
Compiling Control.Category
Compiling Data.Show
Compiling Data.Unit
Compiling Data.Void
Compiling Data.Semiring
Compiling Data.HeytingAlgebra
Compiling Data.Semigroup
Compiling Data.Ring
Compiling Data.BooleanAlgebra
Compiling Data.Eq
Compiling Data.CommutativeRing
Compiling Data.Ordering
Compiling Data.EuclideanRing
Compiling Data.Ord.Unsafe
Compiling Data.Ord
Compiling Data.DivisionRing
Compiling Data.Field
Compiling Data.Bounded
Compiling Data.Monoid
Compiling Data.Function
Compiling Data.Functor
Compiling Control.Apply
Compiling Control.Applicative
Compiling Control.Bind
Compiling Control.Monad
Compiling Prelude
Compiling Data.Monoid.Additive
Compiling Main
Compiling Data.Monoid.Endo
Compiling Data.Monoid.Conj
Compiling Data.Semigroup.Last
Compiling Data.Semigroup.First
Compiling Data.Monoid.Dual
Compiling Data.Monoid.Multiplicative
Compiling Data.Monoid.Disj
Compiling from Corefn to C
Compiling .purec-work/main/Type.Data.RowList/corefn.json.1...
Compiling .purec-work/main/Data.Void/corefn.json.1...
Compiling .purec-work/main/Data.Boolean/corefn.json.1...
Compiling .purec-work/main/Control.Category/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Conj/corefn.json.1...
Compiling .purec-work/main/Data.Show/corefn.json.1...
Compiling .purec-work/main/Control.Semigroupoid/corefn.json.1...
Compiling .purec-work/main/Data.Ring/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Multiplicative/corefn.json.1...
Compiling .purec-work/main/Data.Semiring/corefn.json.1...
Compiling .purec-work/main/Data.Ordering/corefn.json.1...
Compiling .purec-work/main/Data.CommutativeRing/corefn.json.1...
Compiling .purec-work/main/Data.Function/corefn.json.1...
Compiling .purec-work/main/Control.Bind/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Dual/corefn.json.1...
Compiling .purec-work/main/Data.Field/corefn.json.1...
Compiling .purec-work/main/Data.Ord/corefn.json.1...
Compiling .purec-work/main/Control.Applicative/corefn.json.1...
Compiling .purec-work/main/Record.Unsafe/corefn.json.1...
Compiling .purec-work/main/Data.BooleanAlgebra/corefn.json.1...
Compiling .purec-work/main/Data.Eq/corefn.json.1...
Compiling .purec-work/main/Type.Data.Row/corefn.json.1...
Compiling .purec-work/main/Control.Apply/corefn.json.1...
Compiling .purec-work/main/Prelude/corefn.json.1...
Compiling .purec-work/main/Data.Ord.Unsafe/corefn.json.1...
Compiling .purec-work/main/Data.Semigroup/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Additive/corefn.json.1...
Compiling .purec-work/main/Data.HeytingAlgebra/corefn.json.1...
Compiling .purec-work/main/Data.Bounded/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Disj/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Endo/corefn.json.1...
Compiling .purec-work/main/Data.NaturalTransformation/corefn.json.1...
Compiling .purec-work/main/Data.Monoid/corefn.json.1...
Compiling .purec-work/main/Data.Semigroup.First/corefn.json.1...
Compiling .purec-work/main/Data.Symbol/corefn.json.1...
Compiling .purec-work/main/Data.Functor/corefn.json.1...
Compiling .purec-work/main/Main/corefn.json.1...
Compiling .purec-work/main/Data.DivisionRing/corefn.json.1...
Compiling .purec-work/main/Data.Unit/corefn.json.1...
Compiling .purec-work/main/Data.Semigroup.Last/corefn.json.1...
Compiling .purec-work/main/Data.EuclideanRing/corefn.json.1...
Compiling .purec-work/main/Control.Monad/corefn.json.1...
Compile ../../runtime/purescript.c
Compile ../../ccan/asprintf/asprintf.c
Compile ../../vendor/vec.c
Compile .purec-work/main/Data.Ord_ffi.c
Compile .purec-work/main/Data.EuclideanRing.c
Compile .purec-work/main/Data.Semiring_ffi.c
Compile .purec-work/main/Type.Data.Row.c
Compile .purec-work/main/Data.Monoid.c
Compile .purec-work/main/Data.Functor.c
Compile .purec-work/main/Data.Eq_ffi.c
Compile .purec-work/main/Data.Bounded_ffi.c
Compile .purec-work/main/Data.Show.c
Compile .purec-work/main/Prelude.c
Compile .purec-work/main/Data.Semigroup_ffi.c
Compile .purec-work/main/Data.HeytingAlgebra_ffi.c
Compile .purec-work/main/Control.Apply_ffi.c
Compile .purec-work/main/Data.Monoid.Multiplicative.c
Compile .purec-work/main/Data.Semiring.c
Compile .purec-work/main/Data.Ord.Unsafe.c
Compile .purec-work/main/Data.Ordering.c
Compile .purec-work/main/Data.Symbol_ffi.c
Compile .purec-work/main/Data.Field.c
Compile .purec-work/main/Data.Ord.c
Compile .purec-work/main/Data.Unit_ffi.c
Compile .purec-work/main/Data.Unit.c
Compile .purec-work/main/Data.Eq.c
Compile .purec-work/main/Data.Bounded.c
Compile .purec-work/main/Data.Semigroup.c
Compile .purec-work/main/Data.HeytingAlgebra.c
Compile .purec-work/main/Control.Apply.c
Compile .purec-work/main/Control.Applicative.c
Compile .purec-work/main/Data.Show_ffi.c
Compile .purec-work/main/Data.Semigroup.First.c
Compile .purec-work/main/Data.Symbol.c
Compile .purec-work/main/Type.Data.RowList.c
Compile .purec-work/main/Data.DivisionRing.c
Compile .purec-work/main/Control.Monad.c
Compile .purec-work/main/Record.Unsafe_ffi.c
Compile .purec-work/main/Data.Semigroup.Last.c
Compile .purec-work/main/Data.Void.c
Compile .purec-work/main/Control.Bind_ffi.c
Compile .purec-work/main/Record.Unsafe.c
Compile .purec-work/main/Data.Boolean.c
Compile .purec-work/main/Control.Semigroupoid.c
Compile .purec-work/main/Data.Monoid.Conj.c
Compile .purec-work/main/Data.EuclideanRing_ffi.c
Compile .purec-work/main/Data.Ring_ffi.c
Compile .purec-work/main/Control.Category.c
Compile .purec-work/main/Data.CommutativeRing.c
Compile .purec-work/main/Main.c
Compile .purec-work/main/Data.Function.c
Compile .purec-work/main/Data.Functor_ffi.c
Compile .purec-work/main/Data.Monoid.Dual.c
Compile .purec-work/main/Data.Monoid.Endo.c
Compile .purec-work/main/Control.Bind.c
Compile .purec-work/main/Data.Ord.Unsafe_ffi.c
Compile .purec-work/main/Data.BooleanAlgebra.c
Compile .purec-work/main/Data.Ring.c
Compile .purec-work/main/Data.Monoid.Disj.c
Compile .purec-work/main/Data.NaturalTransformation.c
Compile .purec-work/main/Data.Monoid.Additive.c
Purec build succeeded!
tests/10-prelude: run ouput
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
tests/11-effects: clean
tests/11-effects: compile C
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
Compiling Type.Data.RowList
Compiling Type.Data.Row
Compiling Data.NaturalTransformation
Compiling Data.Symbol
Compiling Data.Boolean
Compiling Record.Unsafe
Compiling Control.Semigroupoid
Compiling Control.Category
Compiling Data.Show
Compiling Data.Unit
Compiling Data.Void
Compiling Data.Semiring
Compiling Data.HeytingAlgebra
Compiling Data.Semigroup
Compiling Data.Ring
Compiling Data.CommutativeRing
Compiling Data.BooleanAlgebra
Compiling Data.Eq
Compiling Data.Ordering
Compiling Data.EuclideanRing
Compiling Data.Ord.Unsafe
Compiling Data.Ord
Compiling Data.DivisionRing
Compiling Data.Field
Compiling Data.Monoid
Compiling Data.Bounded
Compiling Data.Function
Compiling Data.Functor
Compiling Control.Apply
Compiling Control.Applicative
Compiling Control.Bind
Compiling Control.Monad
Compiling Prelude
Compiling Data.Semigroup.Last
Compiling Data.Monoid.Endo
Compiling Data.Monoid.Multiplicative
Compiling Data.Monoid.Conj
Compiling Effect
Compiling Data.Monoid.Disj
Compiling Data.Monoid.Additive
Compiling Data.Monoid.Dual
Compiling Data.Semigroup.First
Compiling Effect.Uncurried
Compiling Effect.Unsafe
Compiling Effect.Class
Compiling Main
Warning 1 of 3:

  in module Main
  at src/Main.purs:4:1 - 4:14 (line 4, column 1 - line 4, column 14)

    Module Effect has unspecified imports, consider using the explicit form:

      import Effect (Effect)



  See https://github.com/purescript/documentation/blob/master/errors/ImplicitImport.md for more information,
  or to contribute content related to this warning.

Warning 2 of 3:

  in module Main
  at src/Main.purs:5:1 - 5:21 (line 5, column 1 - line 5, column 21)

    Module Effect.Unsafe has unspecified imports, consider using the explicit form:

      import Effect.Unsafe (unsafePerformEffect)



  See https://github.com/purescript/documentation/blob/master/errors/ImplicitImport.md for more information,
  or to contribute content related to this warning.

Warning 3 of 3:

  in module Main
  at src/Main.purs:3:1 - 3:15 (line 3, column 1 - line 3, column 15)

    Module Prelude has unspecified imports, consider using the explicit form:

      import Prelude (bind, pure, void, (<>))



  See https://github.com/purescript/documentation/blob/master/errors/ImplicitImport.md for more information,
  or to contribute content related to this warning.


Compiling from Corefn to C
Compiling .purec-work/main/Type.Data.RowList/corefn.json.1...
Compiling .purec-work/main/Data.Void/corefn.json.1...
Compiling .purec-work/main/Data.Boolean/corefn.json.1...
Compiling .purec-work/main/Control.Category/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Conj/corefn.json.1...
Compiling .purec-work/main/Data.Show/corefn.json.1...
Compiling .purec-work/main/Effect.Unsafe/corefn.json.1...
Compiling .purec-work/main/Control.Semigroupoid/corefn.json.1...
Compiling .purec-work/main/Data.Ring/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Multiplicative/corefn.json.1...
Compiling .purec-work/main/Data.Semiring/corefn.json.1...
Compiling .purec-work/main/Effect.Uncurried/corefn.json.1...
Compiling .purec-work/main/Data.Ordering/corefn.json.1...
Compiling .purec-work/main/Data.CommutativeRing/corefn.json.1...
Compiling .purec-work/main/Data.Function/corefn.json.1...
Compiling .purec-work/main/Control.Bind/corefn.json.1...
Compiling .purec-work/main/Effect/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Dual/corefn.json.1...
Compiling .purec-work/main/Data.Field/corefn.json.1...
Compiling .purec-work/main/Data.Ord/corefn.json.1...
Compiling .purec-work/main/Control.Applicative/corefn.json.1...
Compiling .purec-work/main/Record.Unsafe/corefn.json.1...
Compiling .purec-work/main/Data.BooleanAlgebra/corefn.json.1...
Compiling .purec-work/main/Data.Eq/corefn.json.1...
Compiling .purec-work/main/Type.Data.Row/corefn.json.1...
Compiling .purec-work/main/Control.Apply/corefn.json.1...
Compiling .purec-work/main/Prelude/corefn.json.1...
Compiling .purec-work/main/Effect.Class/corefn.json.1...
Compiling .purec-work/main/Data.Semigroup/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Additive/corefn.json.1...
Compiling .purec-work/main/Data.HeytingAlgebra/corefn.json.1...
Compiling .purec-work/main/Data.Bounded/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Disj/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Endo/corefn.json.1...
Compiling .purec-work/main/Data.NaturalTransformation/corefn.json.1...
Compiling .purec-work/main/Data.Monoid/corefn.json.1...
Compiling .purec-work/main/Data.Semigroup.First/corefn.json.1...
Compiling .purec-work/main/Data.Symbol/corefn.json.1...
Compiling .purec-work/main/Data.Functor/corefn.json.1...
Compiling .purec-work/main/Data.Ord.Unsafe/corefn.json.1...
Compiling .purec-work/main/Main/corefn.json.1...
Compiling .purec-work/main/Data.DivisionRing/corefn.json.1...
Compiling .purec-work/main/Data.Unit/corefn.json.1...
Compiling .purec-work/main/Data.Semigroup.Last/corefn.json.1...
Compiling .purec-work/main/Data.EuclideanRing/corefn.json.1...
Compiling .purec-work/main/Control.Monad/corefn.json.1...
Compile ../../runtime/purescript.c
Compile ../../ccan/asprintf/asprintf.c
Compile ../../vendor/vec.c
Compile .purec-work/main/Data.Ord_ffi.c
Compile .purec-work/main/Data.EuclideanRing.c
Compile .purec-work/main/Effect_ffi.c
Compile .purec-work/main/Data.Semiring_ffi.c
Compile .purec-work/main/Data.Monoid.c
Compile .purec-work/main/Data.Unit_ffi.c
Compile .purec-work/main/Data.Functor.c
Compile .purec-work/main/Data.Bounded_ffi.c
Compile .purec-work/main/Data.Show.c
Compile .purec-work/main/Prelude.c
Compile .purec-work/main/Data.Semigroup_ffi.c
Compile .purec-work/main/Data.HeytingAlgebra_ffi.c
Compile .purec-work/main/Control.Apply_ffi.c
Compile .purec-work/main/Data.Monoid.Multiplicative.c
Compile .purec-work/main/Data.Semiring.c
Compile .purec-work/main/Data.Ord.Unsafe.c
Compile .purec-work/main/Data.Ordering.c
Compile .purec-work/main/Effect.Unsafe.c
Compile .purec-work/main/Data.Symbol_ffi.c
Compile .purec-work/main/Data.Field.c
Compile .purec-work/main/Type.Data.Row.c
Compile .purec-work/main/Data.Ord.c
Compile .purec-work/main/Effect.c
Compile .purec-work/main/Data.Unit.c
Compile .purec-work/main/Data.Eq.c
Compile .purec-work/main/Data.Bounded.c
Compile .purec-work/main/Data.Semigroup.c
Compile .purec-work/main/Effect.Class.c
Compile .purec-work/main/Data.HeytingAlgebra.c
Compile .purec-work/main/Control.Apply.c
Compile .purec-work/main/Control.Applicative.c
Compile .purec-work/main/Data.Eq_ffi.c
Compile .purec-work/main/Data.Show_ffi.c
Compile .purec-work/main/Data.Monoid.Additive.c
Compile .purec-work/main/Data.Semigroup.First.c
Compile .purec-work/main/Data.Symbol.c
Compile .purec-work/main/Type.Data.RowList.c
Compile .purec-work/main/Data.DivisionRing.c
Compile .purec-work/main/Control.Monad.c
Compile .purec-work/main/Record.Unsafe_ffi.c
Compile .purec-work/main/Data.Void.c
Compile .purec-work/main/Data.Semigroup.Last.c
Compile .purec-work/main/Effect.Uncurried_ffi.c
Compile .purec-work/main/Control.Bind_ffi.c
Compile .purec-work/main/Record.Unsafe.c
Compile .purec-work/main/Data.Boolean.c
Compile .purec-work/main/Control.Semigroupoid.c
Compile .purec-work/main/Data.Monoid.Conj.c
Compile .purec-work/main/Data.EuclideanRing_ffi.c
Compile .purec-work/main/Data.Ring_ffi.c
Compile .purec-work/main/Effect.Uncurried.c
Compile .purec-work/main/Control.Category.c
Compile .purec-work/main/Data.CommutativeRing.c
Compile .purec-work/main/Main.c
Compile .purec-work/main/Data.Function.c
Compile .purec-work/main/Data.Functor_ffi.c
Compile .purec-work/main/Data.Monoid.Dual.c
Compile .purec-work/main/Data.Monoid.Endo.c
Compile .purec-work/main/Control.Bind.c
Compile .purec-work/main/Data.Ord.Unsafe_ffi.c
Compile .purec-work/main/Data.BooleanAlgebra.c
Compile .purec-work/main/Data.Ring.c
Compile .purec-work/main/Data.Monoid.Disj.c
Compile .purec-work/main/Effect.Unsafe_ffi.c
Compile .purec-work/main/Data.NaturalTransformation.c
Purec build succeeded!
tests/11-effects: run ouput
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
hi!
hi!andhi!
world
tests/12-rec-fns: clean
tests/12-rec-fns: compile C
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
Compiling Type.Data.Row
Compiling Type.Data.RowList
Compiling Data.NaturalTransformation
Compiling Record.Unsafe
Compiling Data.Symbol
Compiling Data.Boolean
Compiling Control.Semigroupoid
Compiling Data.Show
Compiling Control.Category
Compiling Data.Unit
Compiling Data.Void
Compiling Data.HeytingAlgebra
Compiling Data.Semiring
Compiling Data.Semigroup
Compiling Data.Ring
Compiling Data.BooleanAlgebra
Compiling Data.Eq
Compiling Data.CommutativeRing
Compiling Data.Ordering
Compiling Data.EuclideanRing
Compiling Data.Ord.Unsafe
Compiling Data.Ord
Compiling Data.DivisionRing
Compiling Data.Field
Compiling Data.Monoid
Compiling Data.Bounded
Compiling Data.Function
Compiling Data.Functor
Compiling Control.Apply
Compiling Control.Applicative
Compiling Control.Bind
Compiling Control.Monad
Compiling Prelude
Compiling Data.Monoid.Disj
Compiling Main
Compiling Data.Monoid.Multiplicative
Compiling Data.Monoid.Endo
Compiling Data.Monoid.Conj
Compiling Effect
Compiling Data.Semigroup.Last
Compiling Data.Monoid.Dual
Compiling Data.Monoid.Additive
Compiling Data.Semigroup.First
Compiling Effect.Class
Compiling Effect.Unsafe
Compiling Effect.Uncurried
Warning 1 of 2:

  in module Main
  at src/Main.purs:55:9 - 55:19 (line 55, column 9 - line 55, column 19)

    Name loop was shadowed.

  in value declaration testLetBoundRecFn3

  See https://github.com/purescript/documentation/blob/master/errors/ShadowedName.md for more information,
  or to contribute content related to this warning.

Warning 2 of 2:

  in module Main
  at src/Main.purs:3:1 - 3:15 (line 3, column 1 - line 3, column 15)

    Shadowed definitions are in scope for type Unit from the following open imports:

      import Prelude

    These will be ignored and the local declaration will be used.


  See https://github.com/purescript/documentation/blob/master/errors/ScopeShadowing.md for more information,
  or to contribute content related to this warning.


Compiling from Corefn to C
Compiling .purec-work/main/Type.Data.RowList/corefn.json.1...
Compiling .purec-work/main/Data.Void/corefn.json.1...
Compiling .purec-work/main/Data.Boolean/corefn.json.1...
Compiling .purec-work/main/Control.Category/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Conj/corefn.json.1...
Compiling .purec-work/main/Data.Show/corefn.json.1...
Compiling .purec-work/main/Effect.Unsafe/corefn.json.1...
Compiling .purec-work/main/Control.Semigroupoid/corefn.json.1...
Compiling .purec-work/main/Data.Ring/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Multiplicative/corefn.json.1...
Compiling .purec-work/main/Data.Semiring/corefn.json.1...
Compiling .purec-work/main/Effect.Uncurried/corefn.json.1...
Compiling .purec-work/main/Data.Ordering/corefn.json.1...
Compiling .purec-work/main/Data.CommutativeRing/corefn.json.1...
Compiling .purec-work/main/Data.Function/corefn.json.1...
Compiling .purec-work/main/Control.Bind/corefn.json.1...
Compiling .purec-work/main/Effect/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Dual/corefn.json.1...
Compiling .purec-work/main/Data.Field/corefn.json.1...
Compiling .purec-work/main/Data.Ord/corefn.json.1...
Compiling .purec-work/main/Control.Applicative/corefn.json.1...
Compiling .purec-work/main/Record.Unsafe/corefn.json.1...
Compiling .purec-work/main/Data.BooleanAlgebra/corefn.json.1...
Compiling .purec-work/main/Data.Eq/corefn.json.1...
Compiling .purec-work/main/Type.Data.Row/corefn.json.1...
Compiling .purec-work/main/Control.Apply/corefn.json.1...
Compiling .purec-work/main/Prelude/corefn.json.1...
Compiling .purec-work/main/Effect.Class/corefn.json.1...
Compiling .purec-work/main/Data.Semigroup/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Additive/corefn.json.1...
Compiling .purec-work/main/Data.HeytingAlgebra/corefn.json.1...
Compiling .purec-work/main/Data.Bounded/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Disj/corefn.json.1...
Compiling .purec-work/main/Data.Monoid.Endo/corefn.json.1...
Compiling .purec-work/main/Data.NaturalTransformation/corefn.json.1...
Compiling .purec-work/main/Data.Monoid/corefn.json.1...
Compiling .purec-work/main/Data.Semigroup.First/corefn.json.1...
Compiling .purec-work/main/Data.Symbol/corefn.json.1...
Compiling .purec-work/main/Data.Functor/corefn.json.1...
Compiling .purec-work/main/Data.Ord.Unsafe/corefn.json.1...
Compiling .purec-work/main/Main/corefn.json.1...
Compiling .purec-work/main/Data.DivisionRing/corefn.json.1...
Compiling .purec-work/main/Data.Unit/corefn.json.1...
Compiling .purec-work/main/Data.Semigroup.Last/corefn.json.1...
Compiling .purec-work/main/Data.EuclideanRing/corefn.json.1...
Compiling .purec-work/main/Control.Monad/corefn.json.1...
Compile ../../runtime/purescript.c
Compile ../../ccan/asprintf/asprintf.c
Compile ../../vendor/vec.c
Compile .purec-work/main/Data.Ord_ffi.c
Compile .purec-work/main/Data.EuclideanRing.c
Compile .purec-work/main/Effect_ffi.c
Compile .purec-work/main/Data.Semiring_ffi.c
Compile .purec-work/main/Data.Monoid.c
Compile .purec-work/main/Data.Unit_ffi.c
Compile .purec-work/main/Data.Functor.c
Compile .purec-work/main/Data.Bounded_ffi.c
Compile .purec-work/main/Data.Show.c
Compile .purec-work/main/Prelude.c
Compile .purec-work/main/Data.Semigroup_ffi.c
Compile .purec-work/main/Data.HeytingAlgebra_ffi.c
Compile .purec-work/main/Control.Apply_ffi.c
Compile .purec-work/main/Data.Monoid.Multiplicative.c
Compile .purec-work/main/Data.Semiring.c
Compile .purec-work/main/Data.Ord.Unsafe.c
Compile .purec-work/main/Data.Ordering.c
Compile .purec-work/main/Effect.Unsafe.c
Compile .purec-work/main/Data.Symbol_ffi.c
Compile .purec-work/main/Data.Field.c
Compile .purec-work/main/Type.Data.Row.c
Compile .purec-work/main/Data.Ord.c
Compile .purec-work/main/Effect.c
Compile .purec-work/main/Data.Unit.c
Compile .purec-work/main/Data.Eq.c
Compile .purec-work/main/Data.Bounded.c
Compile .purec-work/main/Data.Semigroup.c
Compile .purec-work/main/Effect.Class.c
Compile .purec-work/main/Data.HeytingAlgebra.c
Compile .purec-work/main/Control.Apply.c
Compile .purec-work/main/Control.Applicative.c
Compile .purec-work/main/Data.Eq_ffi.c
Compile .purec-work/main/Data.Show_ffi.c
Compile .purec-work/main/Data.Monoid.Additive.c
Compile .purec-work/main/Data.Semigroup.First.c
Compile .purec-work/main/Data.Symbol.c
Compile .purec-work/main/Type.Data.RowList.c
Compile .purec-work/main/Data.DivisionRing.c
Compile .purec-work/main/Control.Monad.c
Compile .purec-work/main/Record.Unsafe_ffi.c
Compile .purec-work/main/Data.Void.c
Compile .purec-work/main/Data.Semigroup.Last.c
Compile .purec-work/main/Effect.Uncurried_ffi.c
Compile .purec-work/main/Control.Bind_ffi.c
Compile .purec-work/main/Record.Unsafe.c
Compile .purec-work/main/Data.Boolean.c
Compile .purec-work/main/Control.Semigroupoid.c
Compile .purec-work/main/Data.Monoid.Conj.c
Compile .purec-work/main/Data.EuclideanRing_ffi.c
Compile .purec-work/main/Data.Ring_ffi.c
Compile .purec-work/main/Effect.Uncurried.c
Compile .purec-work/main/Control.Category.c
Compile .purec-work/main/Data.CommutativeRing.c
Compile .purec-work/main/Main.c
Compile .purec-work/main/Data.Function.c
Compile .purec-work/main/Data.Functor_ffi.c
Compile .purec-work/main/Data.Monoid.Dual.c
Compile .purec-work/main/Data.Monoid.Endo.c
Compile .purec-work/main/Control.Bind.c
Compile .purec-work/main/Data.Ord.Unsafe_ffi.c
Compile .purec-work/main/Data.BooleanAlgebra.c
Compile .purec-work/main/Data.Ring.c
Compile .purec-work/main/Data.Monoid.Disj.c
Compile .purec-work/main/Effect.Unsafe_ffi.c
Compile .purec-work/main/Data.NaturalTransformation.c
Purec build succeeded!
tests/12-rec-fns: run ouput
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
=== test: upstream ==================================================
[info] Build succeeded.
[warn] Unable to parse compiler and package set versions, not checking if `purs` is compatible with it..
valgrind: ./main.out: No such file or directory
make[3]: *** [Makefile:22: main_leakcheck] Error 127
make[2]: *** [Makefile:20: premain] Error 2
/home/meeshkan-abel/mike/purec/output/Effect.Aff/foreign.js:526
                throw util.fromLeft(step);
                ^

Error: Subcommand exited with: 2
    at Object.exports.error (/home/meeshkan-abel/mike/purec/output/Effect.Exception/foreign.js:8:10)
    at /home/meeshkan-abel/mike/purec/output/Test.Utils/index.js:47:100
    at ChildProcess.<anonymous> (/home/meeshkan-abel/mike/purec/output/Node.ChildProcess/foreign.js:80:21)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
[error] Tests failed: exit code: 1
make[1]: *** [Makefile:182: check/upstream] Error 1
make: *** [Makefile:191: check] Error 2
npm ERR! Test failed.  See above for more details.

Interestingly, when I run find . -name "*.out", there are no files with that pattern. Maybe there's a step I'm missing? Thanks for your help!

@felixSchl
Copy link
Collaborator

Looks like the C tests and all tests in the tests/ directory are passing fine, and the problem appears to be with the upstream tests. After running the above do you see a ".tmp" directory? Should be in "/home/meeshkan-abel/mike/purec/.tmp", if so what are the contents? tree .tmp

@mikesol
Copy link
Author

mikesol commented Feb 28, 2021

20:37 meeshkan-abel@Abel:~/mike/purec$ tree .tmp/
.tmp/
├── output
│   ├── Makefile
│   ├── mkPackage.dhall
│   ├── packages.dhall
│   ├── sources
│   └── spago.dhall
└── output.cache
    ├── Main.purs
    ├── Makefile
    ├── mkPackage.dhall
    ├── packages.dhall
    ├── sources
    └── spago.dhall

2 directories, 11 files

Actually, the only reason I'm running the tests is to get a sense of how to put together a Makefile & how to build a simple "hello-world" project. If it's possible to do without working from the tests, that'd be great. Is there a README/documentation on how to build a "hello-world" project?

@felixSchl
Copy link
Collaborator

Yes I should really add that kind of documentation. The tests/ are actually independent of the rest in the project in the sense that they are an example of how to set up a project. You just have your spago.dhall as you always would but for now point the upstream packages to the packages.dhall bundled with purec and in your Makefile (or via environment variables) set the PUREC_DIR to where purec is checked out and that should pretty much be it. I am still thinking about a better way to "ship" the tool, perhaps via npm to make this process easier. I also should upload the package set so there's no need to point to the local check out. I just chose to focus on other issues first.

@felixSchl
Copy link
Collaborator

felixSchl commented Feb 28, 2021

Actually, all of the contrib libs are compiled using purec. They are all set up like described above. So if you, for example checkout pure-c/purescript-foldable-traversable you could see their Makefile and build and test the project there, too. https://github.com/pure-c/purescript-foldable-traversable.

Here's the example contents of a fully functional Makefile

CFLAGS = -O0 -g3

include $(PUREC_DIR)/mk/target.mk

$(eval $(call purs_mk_target,main,Test.Main,src test))

check: main_leakcheck
.PHONY: check

@mikesol
Copy link
Author

mikesol commented Feb 28, 2021

Sounds good! I can do that. Another thing that would be helpful from a documentation perspective is how to get the C-equivalent of log working, as it is in the Effect monad and I'm guessing that's not "out-of-the-box" in C-land.

@felixSchl
Copy link
Collaborator

Good idea. The tests already feature this as an example: https://github.com/pure-c/purec/blob/next/tests/11-effects/src/Main.h.
I'll see if I can spare a couple hours this week to put this into the README

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

2 participants