-
Notifications
You must be signed in to change notification settings - Fork 18
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
Compile Error #28
Comments
There are indeed a lot of warnings when compiling it's dependencies and itself (especially those URL-linked warnings, yeesh ton of those!), but I didn't get an error in compiling itself. My versions: Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:false]
Interactive Elixir (1.6.1) - press Ctrl+C to exit (type h() ENTER for help) /me wonders what this library would look like and how much faster it would be if implemented via my ProtocolEx libraries without structs (proper pattern matching)... |
all elements in my environment have a higher version than @OvermindDL1 's, I suggest that it is the reason? |
I know the brand-new OTP 21.0 is broken on Windows right now (the just released patch for it fixed it I think though?) but you said you tested 19 as well (assuming 2.1 meant 21 and 1.9 meant 19)? Do you have a fully reproduceable project that you can upload that examples the issue? |
@OvermindDL1 In fact, for fare that it is a problem caused by other objects in my project, I reopenned a new one which has the only dep of algae, and it also fails. |
Have you updated to the new OTP 21.1 patch yet? Where is a git repo of the example? |
Sorry for not being able to reply at once. I am now updating my |
Just now, I even compiled |
I can replicate it! Woo! ╰─➤ mix compile 1 ↵
==> algae
Compiling 71 files (.ex)
warning: module Witchcraft.Monad.Proto is not a behaviour (in module Witchcraft.Monad.Proto.Algae.State)
lib/algae/state/monad.ex:3
warning: The data type Elixir.Algae.State has been forced to skip property validation for the type class Elixir.Witchcraft.Monad
This is sometimes valid, since TypeClass's property checker may not be able to accurately validate all data types correctly for all possible cases. Forcing a type instance in this way is like telling the checker "trust me this is correct", and should only be used as a last resort.
For more, please see the TypeClass README:
https://github.com/expede/type_class/blob/master/README.md
(elixir) src/elixir_compiler.erl:85: :elixir_compiler.dispatch/6
(elixir) src/elixir_lexical.erl:18: :elixir_lexical.run/3
(elixir) src/elixir_compiler.erl:27: :elixir_compiler.quoted/3
(elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
warning: module Witchcraft.Monad.Proto is not a behaviour (in module Witchcraft.Monad.Proto.Algae.Writer)
lib/algae/writer/monad.ex:3
warning: module Witchcraft.Monad.Proto is not a behaviour (in module Witchcraft.Monad.Proto.Algae.Id)
lib/algae/id/monad.ex:2
warning: function default/1 is unused
lib/algae/state.ex:79
warning: The data type Elixir.Algae.State has been forced to skip property validation for the type class Elixir.Witchcraft.Applicative
This is sometimes valid, since TypeClass's property checker may not be able to accurately validate all data types correctly for all possible cases. Forcing a type instance in this way is like telling the checker "trust me this is correct", and should only be used as a last resort.
For more, please see the TypeClass README:
https://github.com/expede/type_class/blob/master/README.md
(elixir) src/elixir_compiler.erl:85: :elixir_compiler.dispatch/6
(elixir) src/elixir_lexical.erl:18: :elixir_lexical.run/3
(elixir) src/elixir_compiler.erl:27: :elixir_compiler.quoted/3
(elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
warning: The data type Elixir.Algae.State has been forced to skip property validation for the type class Elixir.Witchcraft.Apply
This is sometimes valid, since TypeClass's property checker may not be able to accurately validate all data types correctly for all possible cases. Forcing a type instance in this way is like telling the checker "trust me this is correct", and should only be used as a last resort.
For more, please see the TypeClass README:
https://github.com/expede/type_class/blob/master/README.md
(elixir) src/elixir_compiler.erl:85: :elixir_compiler.dispatch/6
(elixir) src/elixir_lexical.erl:18: :elixir_lexical.run/3
(elixir) src/elixir_compiler.erl:27: :elixir_compiler.quoted/3
(elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
warning: The data type Elixir.Algae.Reader has been forced to skip property validation for the type class Elixir.Witchcraft.Applicative
This is sometimes valid, since TypeClass's property checker may not be able to accurately validate all data types correctly for all possible cases. Forcing a type instance in this way is like telling the checker "trust me this is correct", and should only be used as a last resort.
For more, please see the TypeClass README:
https://github.com/expede/type_class/blob/master/README.md
(elixir) src/elixir_compiler.erl:85: :elixir_compiler.dispatch/6
(elixir) src/elixir_lexical.erl:18: :elixir_lexical.run/3
(elixir) src/elixir_compiler.erl:27: :elixir_compiler.quoted/3
(elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
warning: The data type Elixir.Algae.State has been forced to skip property validation for the type class Elixir.Witchcraft.Chain
This is sometimes valid, since TypeClass's property checker may not be able to accurately validate all data types correctly for all possible cases. Forcing a type instance in this way is like telling the checker "trust me this is correct", and should only be used as a last resort.
For more, please see the TypeClass README:
https://github.com/expede/type_class/blob/master/README.md
(elixir) src/elixir_compiler.erl:85: :elixir_compiler.dispatch/6
(elixir) src/elixir_lexical.erl:18: :elixir_lexical.run/3
(elixir) src/elixir_compiler.erl:27: :elixir_compiler.quoted/3
(elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
warning: module Witchcraft.Monad.Proto is not a behaviour (in module Witchcraft.Monad.Proto.Algae.Tree.BinarySearch.Empty)
lib/algae/tree/binary_search/monad.ex:4
warning: module Witchcraft.Monad.Proto is not a behaviour (in module Witchcraft.Monad.Proto.Algae.Reader)
lib/algae/reader/monad.ex:3
warning: The data type Elixir.Algae.Reader has been forced to skip property validation for the type class Elixir.Witchcraft.Monad
This is sometimes valid, since TypeClass's property checker may not be able to accurately validate all data types correctly for all possible cases. Forcing a type instance in this way is like telling the checker "trust me this is correct", and should only be used as a last resort.
For more, please see the TypeClass README:
https://github.com/expede/type_class/blob/master/README.md
(elixir) src/elixir_compiler.erl:85: :elixir_compiler.dispatch/6
(elixir) src/elixir_lexical.erl:18: :elixir_lexical.run/3
(elixir) src/elixir_compiler.erl:27: :elixir_compiler.quoted/3
(elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
warning: The data type Elixir.Algae.State has been forced to skip property validation for the type class Elixir.Witchcraft.Functor
This is sometimes valid, since TypeClass's property checker may not be able to accurately validate all data types correctly for all possible cases. Forcing a type instance in this way is like telling the checker "trust me this is correct", and should only be used as a last resort.
For more, please see the TypeClass README:
https://github.com/expede/type_class/blob/master/README.md
(elixir) src/elixir_compiler.erl:85: :elixir_compiler.dispatch/6
(elixir) src/elixir_lexical.erl:18: :elixir_lexical.run/3
(elixir) src/elixir_compiler.erl:27: :elixir_compiler.quoted/3
(elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
warning: module Witchcraft.Monad.Proto is not a behaviour (in module Witchcraft.Monad.Proto.Algae.Free.Pure)
lib/algae/free/monad.ex:3
warning: module Witchcraft.Monad.Proto is not a behaviour (in module Witchcraft.Monad.Proto.Algae.Tree.Rose)
lib/algae/tree/rose/monad.ex:3
warning: variable "type" is unused
lib/algae.ex:161
warning: The data type Elixir.Algae.Reader has been forced to skip property validation for the type class Elixir.Witchcraft.Chain
This is sometimes valid, since TypeClass's property checker may not be able to accurately validate all data types correctly for all possible cases. Forcing a type instance in this way is like telling the checker "trust me this is correct", and should only be used as a last resort.
For more, please see the TypeClass README:
https://github.com/expede/type_class/blob/master/README.md
(elixir) src/elixir_compiler.erl:85: :elixir_compiler.dispatch/6
(elixir) src/elixir_lexical.erl:18: :elixir_lexical.run/3
(elixir) src/elixir_compiler.erl:27: :elixir_compiler.quoted/3
(elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
warning: this clause cannot match because a previous clause at line 34 always matches
lib/algae/tree/rose.ex:52
warning: variable "ask" does not exist and is being expanded to "ask()", please use parentheses to remove the ambiguity or change the variable name
lib/algae/reader.ex:130
warning: variable "ask" does not exist and is being expanded to "ask()", please use parentheses to remove the ambiguity or change the variable name
lib/algae/reader.ex:153
warning: The data type Elixir.Algae.Reader has been forced to skip property validation for the type class Elixir.Witchcraft.Apply
This is sometimes valid, since TypeClass's property checker may not be able to accurately validate all data types correctly for all possible cases. Forcing a type instance in this way is like telling the checker "trust me this is correct", and should only be used as a last resort.
For more, please see the TypeClass README:
https://github.com/expede/type_class/blob/master/README.md
(elixir) src/elixir_compiler.erl:85: :elixir_compiler.dispatch/6
(elixir) src/elixir_lexical.erl:18: :elixir_lexical.run/3
(elixir) src/elixir_compiler.erl:27: :elixir_compiler.quoted/3
(elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
warning: The data type Elixir.Algae.Reader has been forced to skip property validation for the type class Elixir.Witchcraft.Functor
This is sometimes valid, since TypeClass's property checker may not be able to accurately validate all data types correctly for all possible cases. Forcing a type instance in this way is like telling the checker "trust me this is correct", and should only be used as a last resort.
For more, please see the TypeClass README:
https://github.com/expede/type_class/blob/master/README.md
(elixir) src/elixir_compiler.erl:85: :elixir_compiler.dispatch/6
(elixir) src/elixir_lexical.erl:18: :elixir_lexical.run/3
(elixir) src/elixir_compiler.erl:27: :elixir_compiler.quoted/3
(elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
warning: this clause cannot match because a previous clause at line 99 always matches
lib/algae/tree/binary_search.ex:108
warning: this clause cannot match because a previous clause at line 100 always matches
lib/algae/tree/binary_search.ex:109
== Compilation error in file lib/algae/tree/binary_search/ord.ex ==
** (ExUnit.AssertionError)
Assertion with == failed
code: assert left == right
left: :equal
right: :lesser
lib/ex_unit/assertions.ex:330: ExUnit.Assertions.assert/2
lib/witchcraft/ord.ex:90: Witchcraft.Ord.Property.transitivity/1
lib/type_class/property.ex:34: anonymous fn/5 in TypeClass.Property.run!/4
(elixir) lib/stream.ex:1312: Stream.do_repeatedly/3
(elixir) lib/enum.ex:2423: Enum.take/2
lib/algae/tree/binary_search/ord.ex:5: anonymous fn/2 in :elixir_compiler_29.__FILE__/1
(elixir) lib/enum.ex:1899: Enum."-reduce/3-lists^foldl/2-0-"/3
lib/algae/tree/binary_search/ord.ex:5: (file)
could not compile dependency :algae, "mix compile" failed. You can recompile this dependency with "mix deps.compile algae", update it with "mix deps.update algae" or clean it with "mix deps.clean algae" |
rewrite dependence version
I resolved compile by using this method |
Oh did you lock in an old version? I didn't even check that... >.> |
Sorry for the delay! I only got an email about this thread now 😖 Weird TL;DR I know where the issue was introduced (in @OvermindDL1 & @SchrodingerZhu
Yeah, those are override warnings from TypeClass, and are totally normal. We skip compile-time prop checks on some instances, and it intentionally prints that message warning you that the instance has fewer guarantees about lawfulness. I agree that it's a lot of text, but I'm not sure if this is better or worse than potentially having unprincipled behaviour. I've been considering breaking it out into test helpers instead, which would also speed up the first compilation, but having compile-time checks is a nicety.
This is normal the first time you compile Algae. We're doing a bunch of compile-time property checking (via
Hmm, I was initially getting this exact error when reviewing this PR, but thought that it was fixed 🤔 I'll do some digging, but may just revert that change in |
I've been thinking about how to handle these similar tests in my ProtocolEx library as well, right now they are always enforced on and ran at compile-time in all modes, but I want to make it configurable, but I cannot really come up with a way that I really like, I might just defer it to a tag-style system environment enable/disable thing... >.> |
Thinking out loud here, but a potential solution is to add a flag inside the module for when you're happy with an instance, and include a hash of the AST. Now if a single character changes, essentially your cache gets invalidated, and you're forced to retest at compile time 🤔 It might be overkill, I'm not totally sure yet. |
In my ProtocolEx system (an Elixir Protocol-like library that works on matchers instead of structs and such, significantly more powerful with many chances for optimizations so it generates faster code than Elixir's Protocol's) it supports being able to define property tests (any idea where I got that idea from eh? ;-) ) to ensure the implementations fulfill the requirements of the interface. I could indeed hash the implementation timestamps and only re-run that when wanted, but it is also designed to be done with actual property testing frameworks like proper or StreamData(sp?) or so, thus it can test different randomized conditions each time, so I'm not sure when it is a good time to stop it. So many variables! o.O! |
Will be merged shortly and pushed to Hex as |
@SchrodingerZhu I'm going to close this issue. Running |
Thanks for your work! |
I got a compile error on Windows.
First, there is a long stuck when building
witchcraft
.And then, there is an error.
I have tested on
erlang 2.1
anderlang 1.9
, and theelixir
version is1.6.5
and1.6.6
.The text was updated successfully, but these errors were encountered: