Skip to content

Commit

Permalink
Add global package directory to search paths (and update Idris2 submo…
Browse files Browse the repository at this point in the history
…dule) (#215)

* Add global package directory to search paths

* update Idris2 refs

* This should get the additional PACKAGE_PATH loaded up into the correct spot.
  • Loading branch information
mattpolzin authored Mar 10, 2024
1 parent a77ef2d commit 07e751b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Idris2
Submodule Idris2 updated 137 files
16 changes: 8 additions & 8 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/Server/Main.idr
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module Server.Main

import Core.Context
import Core.Core
import Core.Directory
import Core.InitPrimitives
import Core.Metadata
import Core.UnifyState
Expand Down Expand Up @@ -174,14 +175,15 @@ startServer =
Nothing => pure ()
pdirs <- coreLift $ idrisGetEnv "IDRIS2_PACKAGE_PATH"
the (Core ()) $ case pdirs of
Just path => do traverseList1_ addPackageDir (map trim (split (==pathSeparator) path))
Just path => do traverseList1_ addPackageSearchPath (map trim (split (==pathSeparator) path))
Nothing => pure ()
cg <- coreLift $ idrisGetEnv "IDRIS2_CG"
the (Core ()) $ case cg of
Just e => case getCG (options defs) e of
Just cg => setCG cg
Nothing => throw (InternalError ("Unknown code generator " ++ show e))
Nothing => pure ()
addPackageSearchPath !pkgGlobalDirectory
addPkgDir "prelude" anyBounds
addPkgDir "base" anyBounds
addDataDir (prefix_dir (dirs (options defs)) </> ("idris2-" ++ showVersion False Idris.Version.version) </> "support")
Expand Down

0 comments on commit 07e751b

Please sign in to comment.