Navigation Menu

Skip to content
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

Fix reading file with a path relative to HOME #224

Merged
merged 6 commits into from Dec 7, 2021
Merged

Conversation

basile-henry
Copy link
Collaborator

Fixes #223

We need to actually resolve the ~ in the path, this is not something supported by the std::fs::File API.

It looks like dhall-haskell does this as well:
https://github.com/dhall-lang/dhall-haskell/blob/14ae4296874fa9bdd4b585f0ef82d43cff36b091/dhall/src/Dhall/Import.hs#L475-L477

Maybe we should add some tests to cover this?
At the moment all import tests are relative, doing otherwise in the dhall-lang repo would be tricky as it would rely on knowing where the file are located.
But we should be able to do the following in this test suite: for all import tests, parse and convert imports to absolute imports and to relative to home imports, serialize and then test that.

@Nadrieril
Copy link
Owner

Looks good, but you're right we need tests. We should set "$HOME" to point to dhall/tests in the test harness and then try to import things.

@Nadrieril
Copy link
Owner

Looks perfect!

@Nadrieril Nadrieril merged commit 826b2fd into master Dec 7, 2021
@padhia
Copy link

padhia commented Dec 22, 2021

Sorry if I am being too impatient, but are you able to share an approximate timeline of the next release that includes this fix?

PS: my interest in having this fix rolled out is due to s-zeng/dhall-python#41

@Nadrieril Nadrieril deleted the fix-home-import branch January 1, 2022 15:10
@Nadrieril
Copy link
Owner

@padhia oh yeah don't hesistate to ask!
Here you go, v0.11.0 is out

@padhia
Copy link

padhia commented Jan 1, 2022

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

home-anchored imports don't work
3 participants