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

Import issues #2829

Merged
merged 3 commits into from
Mar 22, 2025
Merged

Import issues #2829

merged 3 commits into from
Mar 22, 2025

Conversation

swamishiju
Copy link
Contributor

This PR is regarding the first part of #2828 this does seem to fix part of the problem but I think it fails integration tests because it hangs when trying to create the lnn pkg i'm not entirely sure why

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@swamishiju swamishiju marked this pull request as draft March 19, 2025 03:51
@swamishiju swamishiju marked this pull request as ready for review March 19, 2025 04:38
@swamishiju
Copy link
Contributor Author

Seems to be working now

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you show the output of executing this with the lpython built from latest main branch? I would like to see this test getting failed with the current lpython.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current lpython main

% src/bin/lpython test.py -I.
ASR verify pass error: Module __main__ dependencies must contain string because a function present in it is getting called in __main__.
Internal Compiler Error: Unhandled exception
^C

cpython

% python3 test.py
Inside import

lpython after changes

% src/bin/lpython test.py -I.
Inside import

Copy link
Collaborator

@Shaikh-Ubaid Shaikh-Ubaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

I think we can merge once we see output for https://github.com/lcompilers/lpython/pull/2829/files#r2004399682.

@swamishiju
Copy link
Contributor Author

Oh ye there is another thing i noticed. When the compiler crashes and hangs integration tests don't stop and give and error (afaik i may have waited too little). If there is no check for that I think we need to add a TLE exit on each test

@swamishiju
Copy link
Contributor Author

This PR also fixes a related problem

foo.py

print("Inside import")

main.py

import foo

Lpython current main

$ src/bin/lpython main.py -I.
ASR verify pass error: Module __main__ dependencies must contain foo because a function present in it is getting called in __main__.
Internal Compiler Error: Unhandled exception
^C

Cpython

$ python3 main.py
Inside import

Lpython after changes

$ src/bin/lpython main.py -I.
Inside import

I'll add an stdout test for this too

@swamishiju
Copy link
Contributor Author

@Shaikh-Ubaid all done i think. I'll continue checking for bugs, I have midterms coming so might be less active

@swamishiju
Copy link
Contributor Author

I'm having some problems with tests can someone help?

@swamishiju
Copy link
Contributor Author

swamishiju commented Mar 20, 2025

If its possible i'd prefer if we merge just the approved changes before adding the tests

@Shaikh-Ubaid
Copy link
Collaborator

You will need to remove those extra commits.

@swamishiju
Copy link
Contributor Author

@Shaikh-Ubaid just did also if you are free I had a question on Zulip

@Shaikh-Ubaid Shaikh-Ubaid merged commit 635ed20 into lcompilers:main Mar 22, 2025
36 checks passed
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.

None yet

2 participants