-
Notifications
You must be signed in to change notification settings - Fork 210
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
dhall resolve doesn't respect relative directories #617
Comments
Oh, thank you for opening this 👏 |
@f-f Heh, for sure! I'm gonna try fix it now. We want to get caching working so first step is to get freezing working 😁 |
Seems that the import is using Import {importHashed = ImportHashed {hash = Nothing, importType = Local Here (File {directory = Directory {components = []}, file = "dub"})}, importMode = Code} |
It seems that |
I'm starting to realize the underlying issue here. So when we do |
@FintanH this is my reproduction case: $ dhall freeze --inplace examples/deployment.dhall
↳ ./../api/Deployment/default
Error: Missing file /Users/fabrizio/code/dhall-kubernetes/../api/Deployment/default Where this is the file I'm trying to freeze, and it imports the file Note that if you do EDIT: of course if you do So the issue is the same one that you're describing in your last comment: what |
@f-f Can you try use https://github.com/FintanH/dhall-haskell/tree/fintan/fix-freeze and see if it works for you? Make sure to have a copy just in case 😬 Also it seems it needs to be |
@FintanH tried the branch:
|
I think the second point is actually what we want, right? Because if you run it through |
No, that would lose whatever content is in the file, so I cannot edit it anymore, ever. |
Ahhhh right. I'll get on it 😂 |
I need some way of forcing only one level of resolution so that I can then walk the imports in the input file 🤔 |
@FintanH: In the Haskell REPL you can do |
Thanks, I'll give it a look tomorrow 👌 |
I was taking a look because of obsessive brain. I'm not sure I can come up with a solution using what's already there. I think some functionality akin to the |
Fixes #617 This changes `dhall freeze` to use the directory of the supplied file path as the root import instead of using ".". This fixes the behavior of relative imports when the root file is not located in the current working directory.
Fix up here: #619 |
Also, note that this is not an issue with import resolution per se. For example, |
Ya, I realized this after the face 😳 Thanks for the fix! |
Fixes #617 This changes `dhall freeze` to use the directory of the supplied file path as the root import instead of using ".". This fixes the behavior of relative imports when the root file is not located in the current working directory.
You're welcome! |
Working off of d1e8fde
Directory structure:
dub
num
Error
Running
dhall freeze --inplace "./test/num"
the following error is produced:EDIT
Actually this isn't really
freeze
s fault. This is down to resolution.Running
cat ./test/num | dhall resolve
we get the same error as aboveThe text was updated successfully, but these errors were encountered: