zigler
zigler copied to clipboard
llvm error when compiling nif library in windows
@seomwan encountered this error when trying to build the nif library on windows
Currently stuck at LLVM ERROR: Bad $ operand number: #195 (comment)
LLVM ERROR: Bad $ operand number in inline asm string:
possibly a missing configuration setting when compiling for windows in general, might require
- changes to
build.zigthat depend on windows
Some more details:
I used this mix test command to reproduce (hope it's doing what I think it is and just running that test only):
mix test .\test\support\zigtest\failing_test.ex
The output is this:
[..]
Compiling test/support/zigtest/failing_test.ex (it's taking more than 10s)
Compiling test/support/zigtest/passing_tests.ex (it's taking more than 10s)
== Compilation error in file test/support/zigtest/failing_test.ex ==
** (CompileError) this zig compiler warning hasn't been incorporated into the parser.
Please file a report at:
https://github.com/ityonemo/zigler/issues
<--- missing zig error message details in this line HERE <---
lib/zig/parser/error.ex:54: Zig.Parser.Error.parse/2
lib/zig/command.ex:36: Zig.Command.compile/2
[..]
Noticed three things:
- ex file compilation timing messages
(it's taking more than 10s)at the beginning - missing zig error message details (as indicated by
in this line HERE <---) - it's compiling other tests while only
failing_test.exwas given as an argument
Doing it a second time doesn't have that issue, and gives a proper error message:
[..]
== Compilation error in file test/support/zigtest/failing_test.ex ==
** (CompileError) this zig compiler warning hasn't been incorporated into the parser.
Please file a report at:
https://github.com/ityonemo/zigler/issues
LLVM ERROR: Bad $ operand number in inline asm string: ' movl %fs:0x18, $92135591189151744'
lib/zig/parser/error.ex:54: Zig.Parser.Error.parse/2
[..]
A third time gives the same error message as expected. But I'd expected the string to change randomly, but it didn't. However, another test was run this time:
== Compilation error in file test/support/zigtest/passing_tests.ex ==
Along with ZiglerTest.ZigTest.Transitive, the three tests are generated every time, although only one test runs and gives the error message.
Why does this happen? Am I using mix test the wrong way to run a single test?
This issue was recently fixed, it should build just fine now.
I think @ityonemo may need to update, they're mostly tracking stable branch?
Cool. I'm deliberately tracking stable branch on zigler, but it should be possible to tell use Zig to use a custom zig version. I'll try to test it out this weekend to make sure that feature is working, then I can push guidance to the docs on how to use with windows.