Closed jneira closed 5 years ago
The relevant pr adding the feature of global repl in cabal
is: https://github.com/haskell/cabal/pull/5454
Maybe the etlas install
global part is related to https://github.com/typelead/eta/issues/920
The etlas install
outside a project should be fixed with #91. Only left etlas repl
etlas repl
should be fixed fixed with #92
@jneira I've built your changes and I'm still getting this:
$ etlas repl
etlas: No targets given and there is no package in the current directory. Use
the target 'all' for all packages in the project or specify packages or
components by name or location. See 'etlas build --help' for more details on
target options.
Mmm, is there some subfolder with config files?, i've tested it in a empty dir and works for me:
D:\dev\lang\eta>mkdir empty
D:\dev\lang\eta>cd empty
D:\dev\lang\eta\empty>etlas repl
Prelude> import Data.Maybe
Prelude Data.Maybe> :t fromJust
fromJust :: Maybe a -> a
Yes, you're right - thanks for catching that! Doing that worked for me as well. I wonder if global repl should be triggered if there's no package description file OR a cabal.project in the current folder.
For example I just ran etlas repl
in my home directory which has neither cabal.project
or a .cabal
file in the current directory, but yet it caused an issue. I found that to be rather counterintuitive.
I get the error when running etlas repl
in a dir with subdirectories containing config files:
D:\dev\lang\eta\eta-test-multi>etlas repl
etlas: No targets given and there is no package in the current directory. Use
the target 'all' for all packages in the project or specify packages or
components by name or location. See 'etlas build --help' for more details on
target options.
D:\dev\lang\eta\eta-test-multi>tree
Listado de rutas de carpetas para el volumen DATA
El número de serie del volumen es E2A2-4E65
D:.
├───dist
│ └───cache
├───package1
│ ├───dist
│ │ └───cache
│ └───src
└───package2
└───src
D:\dev\lang\eta\eta-test-multi>etlas repl package1
Resolving dependencies...
In order, the following will be built (use -v for more details):
- package1-0.1.0.0 (lib) (first run)
Configuring library for package1-0.1.0.0..
Preprocessing library for package1-0.1.0.0..
╭─── Welcome to Eta REPL v0.8.6b4! ────────────────────────╮
│ │
│ :help for help │
│ :exit to exit │
│ :type [expr] for type of expression │
│ :kind [type] for kind of type │
│ :kind! [type] for kind of simplified type │
│ │
│ it refers to the last expression │
│ │
│ For more details, check out https://eta-lang.org │
│ │
╰──────────────────────────────────────────────────────────╯
[1 of 1] Compiling Example
Successful! One module loaded.
*Example> [0m[0m
For example I just ran
etlas repl
in my home directory which has neithercabal.project
or a.cabal
file in the current directory, but yet it caused an issue. I found that to be rather counterintuitive.
I think it is caused by the default project config. It actually has:
projectPackagesOptional = [ "./*.cabal", "./*.etlas", "./etlas.dhall"
, "./*/*.cabal", "./*/*.etlas", "./*/etlas.dhall" ]
The ./*/file
make any dir with package subdirs an implicit project based directory. Cabal works in a similar way (but only with ./*.cabal, ./*/*.cabal
in projectPackages
)
Hmm I guess that's OK for now. Being able to pick up packages like that is nice.
Closing this, going forward to make new-clean the default!
(pointed by @rahulmutt in gitter)
etlas install <package.name>
oretlas repl
in a directory without any config file and without any subdir with them, it fails with:etlas
and the version1.5.0.0
downloaded from the web.cabal new-install
andcabal new-repl
works as intended (tested withcabal-2.4.0.0
)cabal new-repl
it uses a dummy package: