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

Building docs with mdz fails due to broken import of base64 in spork/init.janet #194

Closed
CFiggers opened this issue Sep 1, 2024 · 2 comments

Comments

@CFiggers
Copy link
Contributor

CFiggers commented Sep 1, 2024

Attempting to run mdz build in the project root produces this error:

error: could not find module ./base64:
    spork/base64.jimage
    spork/base64.janet
    spork/base64/init.janet
    spork/base64.so
  in require-1 [boot.janet] on line 3017, column 20
  in import* [boot.janet] on line 3061, column 15
  in thunk [spork/init.janet] (tail call) on line 4, column 1
  in dofile [boot.janet] (tail call) on line 2992, column 7
  in source-loader [boot.janet] on line 3004, column 15
  in require-1 [boot.janet] (tail call) on line 3028, column 18
  in api-index [/usr/local/lib/janet/mendoza/markup-env.janet] on line 189, column 33
  in thunk [eval] (tail call) on line -1, column -1
  in do-contents [/usr/local/lib/janet/mendoza/markup.janet] on line 165, column 26
  in markup [/usr/local/lib/janet/mendoza/markup.janet] on line 172, column 3
  in with-dyns [/usr/local/lib/janet/mendoza/markup.janet] on line 183, column 51
  in <anonymous> [/usr/local/lib/janet/mendoza/markup.janet] on line 182, column 41
  in require-1 [boot.janet] (tail call) on line 3028, column 18
  in read-pages [/usr/local/lib/janet/mendoza/init.janet] on line 127, column 25
  in read-pages [/usr/local/lib/janet/mendoza/init.janet] on line 124, column 20
  in build [/usr/local/lib/janet/mendoza/init.janet] (tail call) on line 132, column 3

This seems to be fixed by removing the relative import of the base64 module in spork/init.janet and replacing it with a native import:

diff --git a/spork/init.janet b/spork/init.janet
index d07b4e9..7db4b64 100644
--- a/spork/init.janet
+++ b/spork/init.janet
@@ -1,7 +1,6 @@
 # make (use spork) useful

 (import ./argparse :export true)
-(import ./base64 :export true)
 (import ./cron :export true)
 (import ./ev-utils :export true)
 (import ./fmt :export true)
@@ -33,3 +32,4 @@
 (import spork/tarray :export true)
 (import spork/utf8 :export true)
 (import spork/zip :export true)
+(import spork/base64 :export true)

Related discussion in #185 and #188 . This seems trivially fixable to me—is there a reason we haven't done so yet?

@sogaiu
Copy link
Contributor

sogaiu commented Sep 1, 2024

Don't have an answer to your question, but I tried changes similar to what you mentioned, and they seem to work here.

@CFiggers
Copy link
Contributor Author

CFiggers commented Sep 1, 2024

Fixed with #195

@CFiggers CFiggers closed this as completed Sep 1, 2024
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