-
Notifications
You must be signed in to change notification settings - Fork 379
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
Improve error messages around usage of depends
folder
#3411
Comments
I'm sure it's an expected behaviour. Compiler itself does not have any facility to compile dependencies. |
There are two ways to take this from here:
|
It’s possible this is only because I’m biased by knowing the depends folder to be an install location from the start, but I don’t think there’s a need for the compiler to build dependencies as opposed to just bringing installed dependencies into scope. I think this both because Pack (or the nix tooling alternatively) do this quite well already and also because if the compiler did have a concept for “build this if needed” then I’m not sure we would want to have the “location of dependency source code” and the “location of dependency build artifacts” to necessarily be the same thing anyway. Throwing source code into install artifacts works well for downstream IDE integrations that want to be able to map to the source code but aside from that use case I think the compiler has already gotten a bit fast and loose with how it interprets its different configured “paths” in the past and it made things more confusing rather than less — for example, I disentangled the compiler’s concepts of “package search path” and “package directories” a little while ago because they are distinct things but paths of each kind were confusingly thrown together which made it hard to determine what was wrong for anyone unaware of the dual purpose of the path. I see something similar happening if the same path can contain (a) just the source code for a dependency, (b) just the build artifacts, or (c) both and the compiler behaves differently depending on which is the case. Regardless, I’m totally and perpetually in favor of better error messages and documentation naturally. |
FWIW, I've wanted some sort of That's tangential but certainly related because it speaks to the depends folder being awkward and unintuitive because although the compiler treats it as an install location when searching it does not offer a way to put dependencies into it in the way it needs them to be in there. |
depends
subfolder doesn't compile subprojects correctlydepends
folder
I think those two things could be part of a I feel like there should be a difference between "there are unexpected files here" and "I cannot find the module advertised". Right now the compiler does not even say where it looked for modules so maybe that's the first step. What would you think for the following:
|
That all sounds good and we’ve got most of the machinery and logic in place for the suggested logging too (not the depends folder inspection though) because of the list-packages and paths commands. Just need to put better errors together and write something that inspects the depends folder if present. |
Related: #3445 |
Steps to Reproduce
setup a project like this:
With
main.ipkg
containing:and
dep.ipkg
containing:Main.idr:
Dep.idr:
Expected Behavior
Compiling main with
idris2 --build main.ipkg
should work.Observed Behavior
If the dependency is instead installed globally with
--install
and thedepends
folder removed, the project works just fineThe text was updated successfully, but these errors were encountered: