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

translator build broken -- not found: value JuliaCompiler #1127

Open
Mingun opened this issue Aug 20, 2024 · 3 comments
Open

translator build broken -- not found: value JuliaCompiler #1127

Mingun opened this issue Aug 20, 2024 · 3 comments

Comments

@Mingun
Copy link

Mingun commented Aug 20, 2024

I tried to build tests for kaitai-io/kaitai_struct_compiler#288, but building translator failed with error:

[20.08.2024 19:13:31] mingun@win7 /d/Projects/parsers/kaitai_struct/tests
$ ./build-tests java
[info] welcome to sbt 1.9.7 (Oracle Corporation Java 17.0.1)
[info] loading project definition from D:\Projects\parsers\kaitai_struct\tests\translator\project
[info] loading settings for project translator from build.sbt ...
[info] set current project to translator (in build file:/D:/Projects/parsers/kaitai_struct/tests/translator/)
[warn] there's a key that's not used by any other settings/tasks:
[warn]
[warn] * translator / mainClass
[warn]   +- D:\Projects\parsers\kaitai_struct\tests\translator\build.sbt:15
[warn]
[warn] note: a setting might still be used by a command; to exclude a key from this `lintUnused` check
[warn] either append it to `Global / excludeLintKeys` or call .withRank(KeyRanks.Invisible) on the key
[info] compiling 19 Scala sources to D:\Projects\parsers\kaitai_struct\tests\translator\target\scala-2.13\classes ...
[error] D:\Projects\parsers\kaitai_struct\tests\translator\src\main\scala\io\kaitai\struct\testtranslator\specgenerators\JuliaSG.scala:6:8: object JuliaCompiler is not a member of package io.kaitai.struct.languages
[error] did you mean JavaCompiler or LuaCompiler?
[error] import _root_.io.kaitai.struct.languages.JuliaCompiler
[error]        ^
[error] D:\Projects\parsers\kaitai_struct\tests\translator\src\main\scala\io\kaitai\struct\testtranslator\specgenerators\JuliaSG.scala:8:8: object JuliaTranslator is not a member of package io.kaitai.struct.translators
[error] did you mean JavaTranslator or LuaTranslator?
[error] import _root_.io.kaitai.struct.translators.JuliaTranslator
[error]        ^
[error] D:\Projects\parsers\kaitai_struct\tests\translator\src\main\scala\io\kaitai\struct\testtranslator\specgenerators\JuliaSG.scala:13:24: not found: type JuliaTranslator
[error]   val translator = new JuliaTranslator(provider, importList)
[error]                        ^
[error] D:\Projects\parsers\kaitai_struct\tests\translator\src\main\scala\io\kaitai\struct\testtranslator\specgenerators\JuliaSG.scala:14:19: not found: value JuliaCompiler
[error]   val className = JuliaCompiler.type2class(spec.id)
[error]                   ^
[error] D:\Projects\parsers\kaitai_struct\tests\translator\src\main\scala\io\kaitai\struct\testtranslator\specgenerators\JuliaSG.scala:34:31: not found: value JuliaCompiler
[error]     out.puts(s"@test_throws ${JuliaCompiler.ksErrorName(exception)} ${className}Module.from_file(${'"'}src/${spec.data}${'"'})")
[error]                               ^
[error] D:\Projects\parsers\kaitai_struct\tests\translator\src\main\scala\io\kaitai\struct\testtranslator\specgenerators\JuliaSG.scala:64:31: not found: value JuliaCompiler
[error]     out.puts(s"@test_throws ${JuliaCompiler.ksErrorName(exception)} ${translateAct(actual)}")
[error]                               ^
[error] 6 errors found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 7 s, completed 20 ╨░╨▓╨│. 2024 ╨│., 19:17:35
bash: ConEmuC: команда не найдена

[20.08.2024 19:17:35] mingun@win7 /d/Projects/parsers/kaitai_struct/tests
$

(./build-test here from kaitai-io/kaitai_struct_tests#112, it is just

#!/bin/sh

cd translator
arg="run $@"
sbt -Dsbt.log.noformat=true "$arg"

)
Search for JuliaCompiler returns results only in this repo:
https://github.com/search?q=org%3Akaitai-io+JuliaCompiler&type=code

@generalmimon
Copy link
Member

generalmimon commented Aug 20, 2024

Yeah, this is the result of a hasty merge of kaitai-io/kaitai_struct_tests#126 by @GreyCat. Since that PR contains the addition of Julia to the KST translator, it relies on having support for Julia in the compiler (kaitai-io/kaitai_struct_compiler#305), which hasn't been merged yet (thank goodness because I'd like to properly review it before merging, but unfortunately I don't have time for that right now). So this is kind of a zombie state that we shouldn't have gotten into.

For the time being, just disable the julia target in the KST translator (as I also did locally), i.e. change these two files in kaitai_struct_tests / translator/src/main/scala/io/kaitai/struct/testtranslator:

diff --git i/translator/src/main/scala/io/kaitai/struct/testtranslator/Main.scala w/translator/src/main/scala/io/kaitai/struct/testtranslator/Main.scala
index be8dda37..9b8d33fb 100644
--- i/translator/src/main/scala/io/kaitai/struct/testtranslator/Main.scala
+++ w/translator/src/main/scala/io/kaitai/struct/testtranslator/Main.scala
@@ -21,7 +21,7 @@ object Main extends App {
     "go",
     "java",
     "javascript",
-    "julia",
+    // "julia",
     "lua",
     "nim",
     "perl",
diff --git i/translator/src/main/scala/io/kaitai/struct/testtranslator/TestTranslator.scala w/translator/src/main/scala/io/kaitai/struct/testtranslator/TestTranslator.scala
index 3a0cc1e8..89d333f0 100644
--- i/translator/src/main/scala/io/kaitai/struct/testtranslator/TestTranslator.scala
+++ w/translator/src/main/scala/io/kaitai/struct/testtranslator/TestTranslator.scala
@@ -117,7 +117,7 @@ class TestTranslator(options: CLIOptions) {
     case "go" => new GoSG(testSpec, provider)
     case "java" => new JavaSG(testSpec, provider)
     case "javascript" => new JavaScriptSG(testSpec, provider)
-    case "julia" => new JuliaSG(testSpec, provider)
+    // case "julia" => new JuliaSG(testSpec, provider)
     case "lua" => new LuaSG(testSpec, provider)
     case "nim" => new NimSG(testSpec, provider)
     case "perl" => new PerlSG(testSpec, provider)

... and remove JuliaSG.scala:

$ rm -v translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/JuliaSG.scala
removed 'translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/JuliaSG.scala'

We should probably revert kaitai-io/kaitai_struct_tests#126 and once the compiler PR has been reviewed and merged, merge kaitai-io/kaitai_struct_tests#127 (which currently addresses some of my post-merge review comments, so it would become a full remake of kaitai-io/kaitai_struct_tests#126).

@Mingun
Copy link
Author

Mingun commented Aug 20, 2024

Yes, of course I deleted the problem code locally. Issue is to inform you about the situation.

@generalmimon
Copy link
Member

@Mingun:

Yes, of course I deleted the problem code locally.

Well, this remark sounded like you didn't know what happened:

Search for JuliaCompiler returns results only in this repo:

... so here you go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants