Skip to content

Compile items after Import All #368

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

Merged
merged 6 commits into from
Jun 27, 2024

Conversation

isc-pbarton
Copy link
Collaborator

Fixes #362

@isc-pbarton isc-pbarton requested a review from isc-tleavitt June 20, 2024 16:00
@raymond-rebbeck
Copy link
Contributor

Please make this configurable. The codebase I work with requires some classes to be compiled in a particular order on first import for reasons that are not practical to address in the short term. I am concerned that this will cause problems for us.

@isc-tleavitt
Copy link
Collaborator

@isc-pbarton the point @raymond-rebbeck raises is fair - let's make this configurable, but we want to default to compiling (particularly for the sake of less-technical interop users who wouldn't necessarily understand the implications).

Copy link
Collaborator

@isc-tleavitt isc-tleavitt left a comment

Choose a reason for hiding this comment

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

Two points here: configurability is needed (defaulting to compile but should be able to turn it off), and we should compile everything after loading everything rather than compiling each thing as it's loaded.

@@ -1230,7 +1230,7 @@ ClassMethod ImportItem(InternalName As %String, force As %Boolean = 0, verbose A
if ($extract(InternalName, 1) = "/"){
set sc = ..ImportCSPFile(InternalName)
} else{
set sc = $system.OBJ.Load(filename,"-l-d")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Interesting that we were using -l - I wonder if there was a reason for this. I agree that displaying output is reasonable, for sure.

Question - what's the behavior if a single item fails to load/compile?

A better architecture here would be to maintain a list of things that were loaded by specific calls to ImportItem and then compile all of them at the same time after all have been loaded. As written this is likely to hit dependencies (especially on initial load); with compilation at the end it at least should be possible for a developer to fix compilation dependencies with the right values for System, CompileAfter, DependsOn, etc.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Note from discussion today: just use PullEventHandler

@isc-pbarton isc-pbarton changed the base branch from main to private-memory-store June 26, 2024 21:32
@isc-pbarton isc-pbarton changed the base branch from private-memory-store to main June 26, 2024 21:33
@isc-pbarton isc-pbarton requested a review from isc-tleavitt June 26, 2024 21:34
Copy link
Collaborator

@isc-tleavitt isc-tleavitt left a comment

Choose a reason for hiding this comment

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

Looks good

@isc-tleavitt isc-tleavitt merged commit 92c5751 into intersystems:main Jun 27, 2024
1 check 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.

Import All doesn't compile imported items
3 participants