devbox icon indicating copy to clipboard operation
devbox copied to clipboard

[WIP][NimPlanner] shell and build

Open savil opened this issue 3 years ago β€’ 3 comments

Summary

Added a basic code skeleton for NimPlanner.

How was it tested?

Installing nimble packages doesn't work right now:

➜ nimble install jsonbuilder
    Prompt: No local packages.json found, download it from internet? [y/N]
    Answer:
    Prompt: jsonbuilder not found in any local packages.json, check internet for updated packages? [y/N]
    Answer: y
Downloading Official package list
SIGBUS: Illegal storage access. (Attempt to read from nil?)
zsh: bus error  nimble install jsonbuilder

Need to debug it

savil avatar Sep 16 '22 21:09 savil

Current dependencies on/for this PR:

  • main
    • PR #139 Graphite πŸ‘ˆ

This comment was auto-generated by Graphite.

savil avatar Sep 16 '22 21:09 savil

πŸ€” adding openssl nix package seems to unblock this.

  • It wasn't obvious from the error that this was caused by SSL issues.
  • Using the --noSSLChecks flag nimble hadn't unblocked it. Given that installing the openssl nix package fixes this issue, I don't quite understand why that flag hadn't worked.
  • In desperation, I tried adding openssl since we've needed it in other planners and it began working.

savil avatar Sep 27 '22 01:09 savil

Made progress:

  • Working hello world: Added a testdata/nim/hello_world example that one can shell into, build image and run image. Image size is ~ 130MB.
  • Error when using external nimble package: Added a testdata/nim/json_example to see if I can install an external nimble package and run it.

This is running into an error:

devbox/testdata/nim/json_example on ξ‚  savil/nim-lang [⇕$?] at ☸️  jetpack-cloud (savil-srivastava-jetpack-io)
➜ nimble build
   Warning: Using project local deps mode
  Verifying dependencies for [email protected]
      Info: Dependency on json_builder@any version already satisfied
  Verifying dependencies for [email protected]
   Building json_example/json_example using c backend
       Tip: 2 messages have been suppressed, use --verbose to show them.
     Error: Build failed for package: json_example
        ... Execution failed with exit code 1
        ... Command: /nix/store/17p8dj2gjfdckyp3vkcb7z2v50p04z3h-x86_64-apple-darwin-nim-wrapper-1.6.6/bin/x86_64-apple-darwin-nim c --colors:on --noNimblePath -d:NimblePkgVersion=0.1.0 --path:/Users/savil/code/jetpack/devbox/testdata/nim/json_example/nimbledeps/pkgs/json_builder-0.1.3 --hints:off -o:/Users/savil/code/jetpack/devbox/testdata/nim/json_example/json_example /Users/savil/code/jetpack/devbox/testdata/nim/json_example/src/json_example.nim
        ... Output: /Users/savil/code/jetpack/devbox/testdata/nim/json_example/src/json_example.nim:3:19 Error: cannot open file: jsonbuilder/json_builder

Observations:

  • I'm new to this, so may not be calling things correctly
  • The --noNimblePath nim compiler option may be messing things up. I'm not sure where that is being set. Could it be in the nix wrapper package? Feels odd.
    • I tried calling nimble build --nimblePath:./nimbledeps/pkg/ --noNimblePath=false but those added these options in addition to --noNimblePath . Either way, it didn't make a difference.

savil avatar Sep 27 '22 23:09 savil