-
Notifications
You must be signed in to change notification settings - Fork 34
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
(bug: lean4.py): Propagate the lakefile #96
Conversation
Thanks a lot! Looking at the code, it seems that the |
Indeed, its much better. #fee2fc1 should be fine. |
alectryon/lean4.py
Outdated
working_directory = os.path.dirname(os.path.realpath(self.lake_file_path)) | ||
self.user_args += [self.LAKE_ENV_KEY, self.LAKE_TMP_FILE_PATH] | ||
try: | ||
idx = self.user_args.index("--lake") + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this try..catch is fine, but it might be more readable as
lake_idx = self.user_args.index("--lake")
if lake_idx < 0:
lake_idx = len(self.user_args) # or -2
self.user_args += …
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the issue is that if --lake
is not in user_args
, the .index
method will raise an error...
Sorry, I meant to rebase on main and merge, but Github only let me do the first step and marked the PR closed; can you reopen it by force-pushing to it? (Sorry for the trouble) I have one last question: this will pass a dummy |
I am sorry, I don't know how to do that right now but I'll look into it.
I guess it depends on the behaviour of LeanInk. In any case, a Lean project must have a lakefile so if the user is not providing one, I think pass a dummy |
I made a new PR. See #98. |
The lakefile path was not propagated to the Lean4 driver. As Lean recently changed their lakefile format from .lean to .toml, it can cause Alectryon + LeanInk to fail on any recent Lean4 project.