Skip to content

Improve idris-filename-to-load to return expected pair of dir and relative path depending on idris-protocol version#634

Merged
jfdm merged 1 commit intoidris-hackers:mainfrom
keram:idris-filename-to-load-v2
Apr 24, 2025
Merged

Improve idris-filename-to-load to return expected pair of dir and relative path depending on idris-protocol version#634
jfdm merged 1 commit intoidris-hackers:mainfrom
keram:idris-filename-to-load-v2

Conversation

@keram
Copy link
Contributor

@keram keram commented Jul 8, 2024

What:

Make (idris-filename-to-load) to return

  • a "source dir" and "relative file path" when source dir is exctracted from ipkg file.
  • a "work dir" (parent directory containing a ipkg file) and "relative file path" when Idris protocol version is greater than 1.
  • a "parent directory" and "file" when no ipkg file found

Why:

In Idris2 the files are loaded relative to work directory which is a directory containing an ".ipkg" file.
This will allow us reintroduce regexp to correctly extract sourcedir value from ipkg file in Idris2.

Relates to:
idris-lang/Idris2#3310
#627

@jfdm
Copy link
Contributor

jfdm commented Jul 9, 2024

AFAICT, the error is due to flycheck. I am not sure how your changes would have triggered the flycheck eror, I suspect they didn't.

I will run the builds again and hope for the best...

@jfdm
Copy link
Contributor

jfdm commented Jul 9, 2024

Ahh, the flycheck things are warnings.

The issue seems to be:

 In toplevel form:
idris-commands.el:1390:1:Error: the function ‘file-name-parent-directory’ is not known to be defined.
make: *** [Makefile:45: idris-commands.elc] Error 1
Error: Process completed with exit code 2.

I wonder if file-name-parent-directory is new for 29.X and we need to be backwards compatible for 27.X and 28.X. (Comparing this and this) shows me that the function is missing)

@keram
Copy link
Contributor Author

keram commented Jul 9, 2024

I wonder if file-name-parent-directory is new for 29.X and we need to be backwards compatible for 27.X and 28.X.

Yes, I think we can backport it into ./idris-compat.el . Will update this pull request later this week.
I was curious if the pipeline will pass on first try and to catch something like this.
Thanks for looking to the draft already ! :)

@keram keram force-pushed the idris-filename-to-load-v2 branch from 2694443 to 51e59b6 Compare July 13, 2024 15:34
@keram keram marked this pull request as ready for review July 13, 2024 15:49
@keram keram force-pushed the idris-filename-to-load-v2 branch from 51e59b6 to 92b7e1b Compare July 15, 2024 13:08
"source dir" and "relative file path" or
"work dir" and "relative file path" when idris protocol version
is greater than 1.

Why:
In Idris2 the files are loaded relative to work directory
which is a directory containing an ".ipkg" file.

Relates to:
idris-lang/Idris2#3310
idris-hackers#627
@keram keram force-pushed the idris-filename-to-load-v2 branch from 92b7e1b to 73c718a Compare April 18, 2025 13:15
@jfdm
Copy link
Contributor

jfdm commented Apr 22, 2025

Is this good to go now?

@keram
Copy link
Contributor Author

keram commented Apr 23, 2025

Yes I think so.
I havent work with Idris for some time so did quick test now.
Loaded few random files in the Idris2 repository itself and everythink worked well on this branch. 🆗

@jfdm jfdm merged commit 1856fdb into idris-hackers:main Apr 24, 2025
4 checks passed
@keram keram deleted the idris-filename-to-load-v2 branch August 25, 2025 12:02
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.

2 participants