You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This post has been edited from the original. Comments prior to this comment refer to the earlier version of this post.
This PR changes the error message produced during bundle installation if a bundle directory does not contain a bundle script (i.e. ./bundle.janet or ./bundle/init.janet).
To assist with testing, it also adds a new assert-error-value macro to test/helpers.janet.
Background
If a user attempts to install a bundle that does not contain a bundle script, the bundle/install function can fail with an error message that does not clearly explain that the error is that this file is missing.
The error will occur in get-bundle-module and look like this:
error: could not find module @syspath/bundle/example:
<syspath>/bundle/example.jimage
<syspath>/bundle/example.janet
<syspath>/bundle/example/init.janet
<syspath>/bundle/example.so
in require-1 [boot.janet] (tail call) on line 3126, column 20
in defer [boot.janet] on line 4200, column 7
in get-bundle-module [boot.janet] on line 4192, column 5
in edefer [boot.janet] on line 4351, column 19
in bundle/install [boot.janet] (tail call) on line 4339, column 5
[...]
Implementation
This PR changes the error message in get-bundle-module to specifically refer to the absence of a bundle script. There are some related clean-ups of the bundle/install logic (notably, initfile is changed to bscript to avoid visual confusion with infofile).
To assist with testing, this PR also adds an assert-error-value macro to test/helpers.janet so that tests can check that the error they are expecting is raised as opposed to a different kind of error.
After further review, I realised that it's almost certainly intentional that you can call bundle/install for a bundle that does not include an info file. I've reverted the changes that required this file to exist and instead changed the error message thrown in get-bundle-module to more helpfully explain the problem. I've rewritten the OP to reflect this new version.
pyrmont
changed the title
Confirm necessary files during bundle installation
Clarify error message for missing bundle script during bundle installation
Oct 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This post has been edited from the original. Comments prior to this comment refer to the earlier version of this post.
This PR changes the error message produced during bundle installation if a bundle directory does not contain a bundle script (i.e.
./bundle.janetor./bundle/init.janet).To assist with testing, it also adds a new
assert-error-valuemacro totest/helpers.janet.Background
If a user attempts to install a bundle that does not contain a bundle script, the
bundle/installfunction can fail with an error message that does not clearly explain that the error is that this file is missing.The error will occur in
get-bundle-moduleand look like this:Implementation
This PR changes the error message in
get-bundle-moduleto specifically refer to the absence of a bundle script. There are some related clean-ups of thebundle/installlogic (notably,initfileis changed tobscriptto avoid visual confusion withinfofile).To assist with testing, this PR also adds an
assert-error-valuemacro totest/helpers.janetso that tests can check that the error they are expecting is raised as opposed to a different kind of error.