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 static compiler-flag #562

Merged
merged 5 commits into from
Aug 20, 2024
Merged

Conversation

AliveDevil
Copy link
Collaborator

No description provided.

@wasabii
Copy link
Contributor

wasabii commented Jul 26, 2024

My only hesitation at this point is around the name of the MSBuild property: CompileStatically doesn't strike me as correct.

@AliveDevil
Copy link
Collaborator Author

AliveDevil commented Jul 26, 2024

How about DisableDynamicTypeResolution or DisableUnknownRuntimeTypeResolution?

@wasabii
Copy link
Contributor

wasabii commented Jul 27, 2024

Is just Static an option? Does it overlap with anything else? I can't think of anything.

@AliveDevil
Copy link
Collaborator Author

Could be, but just "Static" for me isn't a descriptive property.
Sure, it is used in IKVM.NET.Sdk, but that is also used when importing IKVM, and what does "Static" mean in a csproj then?
So, if you want to have a 1:1 mapping of MSBuild property to ikvmc arg, prefixing it with Ikvm or Ikvmc would be ideal - signalling that this is exclusively used for IKVM.

Suggesting Static, IkvmStatic, IkvmcStatic.

@wasabii
Copy link
Contributor

wasabii commented Jul 27, 2024

What do you mean importing IKVM? You mean IKVM reference? That doesn't use global properties.

@AliveDevil
Copy link
Collaborator Author

Ah, didn't know that. Thought that the IkvmReference would also use the IKVM.NET.Sdk-stuff for invoking ikvmc.

@wasabii
Copy link
Contributor

wasabii commented Jul 27, 2024

The IkvmCompiler and IkvmExporter task are shared, but that's about it.

I like the more verbose name better (DisableDynamicTypeResolution). I tried to think it through. Problem is, -static itself is sort of a hack right now on ikvmc.... and includes more than just dynamic type lookup. But also a codegen option to disable refemit in various circumstances. It's not exactly strictly defined as to what 'static' means here. And I can imagine us adding more options here too: NAOT scenarios might want to limit certain things, but allow other things.

I don't like it as an option at all on ikvmc. But, it's there. And it's going to have to stay.

I figure if "Static" doesn't overlap with any javac options (and it doesn't). And we can add a similar "Static" metadata value to IkvmReference.... that's probably fine. For now.

@AliveDevil
Copy link
Collaborator Author

Ack.
Expose coarse Static property to enable current ikvmc StaticCompiler, and gradually remove Static-behavior with finer grained properties in the future.

@AliveDevil AliveDevil force-pushed the feature/sdk-static branch from 7a1be54 to 34da447 Compare July 30, 2024 08:14
@AliveDevil
Copy link
Collaborator Author

  • IKVM.Net.Sdk has project <Static>-parameter
  • IKVM has <IkvmReference Static="true" />
    Defaults to false

@AliveDevil AliveDevil requested a review from wasabii August 12, 2024 06:45
@wasabii wasabii merged commit 2da8a19 into ikvmnet:develop Aug 20, 2024
82 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.

2 participants