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

Add import_to_main flag for Main module package name conflicts resolution #807

Merged
merged 9 commits into from
Oct 9, 2024

Conversation

krynju
Copy link
Collaborator

@krynju krynju commented May 10, 2023

This contains only the import_to_main part of #794

Fixes #768

Changelog:

  1. added import_into_main flag (default true), which allows you to control whether the top level packages will be imported into Main in the sysimage
  2. added skip & warnings on the import to Main name conflict Incremental sysimage build doesn't support packages with same name but different uuid #768

for pkg in packages
print(julia_code_buffer, """
if isdefined(Main, Symbol("$pkg"))
@warn(
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Did you check that users will see this warning?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I saw it on a build once but let me confirm on a simple example

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

visible
image

@codecov
Copy link

codecov bot commented May 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.64%. Comparing base (8e57908) to head (c68f67b).

❗ Current head c68f67b differs from pull request most recent head c255bdc. Consider uploading reports for the commit c255bdc to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #807   +/-   ##
=======================================
  Coverage   84.64%   84.64%           
=======================================
  Files           3        3           
  Lines         827      827           
=======================================
  Hits          700      700           
  Misses        127      127           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@krynju
Copy link
Collaborator Author

krynju commented Jun 23, 2023

@KristofferC Can we merge and tag this? I confirmed it works fine on my case

@@ -504,6 +516,9 @@ compiler (can also include extra arguments to the compiler, like `-g`).
transitive dependencies into the sysimage. This only makes a difference if some
packages do not load all their dependencies when themselves are loaded. Defaults to `true`.

- `import_into_main::Bool`: If `true`, import all packages from the sysimage into `Main`.
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Is this true? I thought it was just the packages in the [deps] section of the project file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, I believe only deps from the project you're creating a sysimage of go in

Suggested change
- `import_into_main::Bool`: If `true`, import all packages from the sysimage into `Main`.
- `import_into_main::Bool`: If `true`, import all packages from `packages` into `Main`.

This is more accurate I guess

@krynju krynju merged commit 0c8c5c7 into JuliaLang:master Oct 9, 2024
14 of 39 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.

Incremental sysimage build doesn't support packages with same name but different uuid
2 participants