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

Package name & version are not set properly in moduleIds #2985

Closed
lukaszcz opened this issue Sep 2, 2024 · 0 comments · Fixed by #3215
Closed

Package name & version are not set properly in moduleIds #2985

lukaszcz opened this issue Sep 2, 2024 · 0 comments · Fixed by #3215
Milestone

Comments

@lukaszcz
Copy link
Collaborator

lukaszcz commented Sep 2, 2024

In the Compiler/Pipeline/Driver.hs file, when processing the imports we should change the _entryPointPackage field of the EntryPoint to the package of the imported module. We don't do that, which results in wrong package information being associated with the moduleId. This can lead to a name clash when there are two modules with the same name in two different packages, or in two different versions of the same package used as dependencies in the project.

The PR

fixes this for the recursive pipelines (for HTML and Isabelle/HOL generation) by modifying processRecursiveUpTo. The solution is a hack, because it reads the global package from disk every time a module in this package is processed. The problem is that for the global package, Package is not available in PackageInfo. The extra disk reads is why I didn't implement this solution in general. The Package should be read only once and information about the Package, not only PackageLike, should be available in PackageInfo.

@lukaszcz lukaszcz added this to the 0.6.7 milestone Sep 2, 2024
paulcadman pushed a commit that referenced this issue Nov 1, 2024
- Fixes #3009 
- Fixes #2877
- TODO think if this makes #2985
slightly easier to fix
@paulcadman paulcadman modified the milestones: 0.6.8, 0.6.9 Nov 11, 2024
janmasrovira added a commit that referenced this issue Dec 6, 2024
#3215)

- Fixes #2985 
- Fixes #3154 

This pr fixes the above issues by appending the hash of all project
files in the package version. In particular, it appends the hash to the
pre-release tag.
Also, when recursing in an import, we properly update the PackageId in
the Entrypoint.

---------

Co-authored-by: Lukasz Czajka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants