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.
Description
For a number of versions now it has been the case that two different concepts share the same name in the Idris2 build process:
~/.idris2/idris2-0.7.0
)~/.idris2/idris2-0.7.0/base-0.7.0
)The build context has stored both of these things as
package_dirs
until now. This mixed-use can be quite confusing. If you printidris2 --paths
, you will see a mix of(1)
and(2)
in the output for "Package Directories." Despite this output, the two really are used differently. Adding a path toIDRIS2_PACKAGE_PATH
will add it to that shared list, but it will only work (i.e. a package will only be discoverable due to the additional path) if you are specifying a path of type(1)
, not type(2)
.This PR breaks the two concepts out. directories containing packages at resolved versions are still stored as
package_dirs
but directories within which packages should be searched for are stored aspackage_search_paths
. They have their own line items in the output ofidris2 --paths
.IDRIS2_PACKAGE_PATH
only affectspackage_search_paths
.This PR also takes the previously implicit "global" package search path and explicitly stores it in the
package_search_paths
. This is a small code cleanup, but it has the added benefit that the global search path is printed byidris2 --paths
rather than being a hidden implementation detail.The last thing this PR does is fix a bug already present in Idris2 that stopped the REPL
:package "<name>"
command from working. It must have stopped working way back when package ttc files started getting stored under a versioned subfolder because the fix was to pop the top directory off of the path when attempting to load a whole package at the REPL.Should this change go in the CHANGELOG?
implementation, I have updated
CHANGELOG_NEXT.md
(and potentially alsoCONTRIBUTORS.md
).