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

C# Compiler #3

Draft
wants to merge 223 commits into
base: master
Choose a base branch
from
Draft

C# Compiler #3

wants to merge 223 commits into from

Conversation

DaRacci
Copy link
Member

@DaRacci DaRacci commented Apr 30, 2024

Very early days, not quite in a testable state yet.

Feels like im getting close to have the text editing, replacment and substitution working soon.

Then the next part starts, it won't be very fun.
* In process of implementing graph system for dependencies
This is useful for using something like the AST to decide where the changes need to be but the index these items live at can and will be updated, so we account for this by using the new SpanUpdateInfo class and its new method that uses it in TextSpanUpdater called PushByUpdate, this will update the index based off the last changes made.
Fix AST errors from missing modules during parse, these will be automatically populated when modules are automatically downloaded for these modules.
Modules are now being embedded into the output string, though not perfect yet its pretty close for the local files, downloadable files are still going to be a challenge though.
Add Guid Merging if the base doesn't have one currently.
Fix RequiredVersion never being able to merge and throwing error.

Also Added a fuck ton of tests for it.
Add comments to each branch for easier readability.
Fix some incompatability with base versions.
Add short circuit for other requirement types.
Also add tests for remaining uncovered lines.
.EXTERNALHELP
https://amtsupport.github.io/scripts/docs/modules/Utils/Export-Types
#>
function Export-Types {

Check warning

Code scanning / PSScriptAnalyzer

The cmdlet 'Export-Types' uses a plural noun. A singular noun should be used instead. Warning

The cmdlet 'Export-Types' uses a plural noun. A singular noun should be used instead.
@@ -1039,8 +1015,7 @@
$null = Install-Module -Name 'PSReadLine' -MinimumVersion '2.3.4' -Force;
try {
$null = Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force -ErrorAction SilentlyContinue;
}
catch {
} catch {

Check warning

Code scanning / PSScriptAnalyzer

Empty catch block is used. Please use Write-Error or throw statements in catch blocks. Warning

Empty catch block is used. Please use Write-Error or throw statements in catch blocks.

If((Get-WmiObject Win32_OperatingSystem).OSArchitecture -like "*64*"){
If ((Get-WmiObject Win32_OperatingSystem).OSArchitecture -like '*64*') {

Check warning

Code scanning / PSScriptAnalyzer

File 'Fix-AgentUpdateLoop.ps1' uses WMI cmdlet. For PowerShell 3.0 and above, use CIM cmdlet which perform the same tasks as the WMI cmdlets. The CIM cmdlets comply with WS-Management (WSMan) standards and with the Common Information Model (CIM) standard, which enables the cmdlets to use the same techniques to manage Windows computers and those running other operating systems. Warning

File 'Fix-AgentUpdateLoop.ps1' uses WMI cmdlet. For PowerShell 3.0 and above, use CIM cmdlet which perform the same tasks as the WMI cmdlets. The CIM cmdlets comply with WS-Management (WSMan) standards and with the Common Information Model (CIM) standard, which enables the cmdlets to use the same techniques to manage Windows computers and those running other operating systems.
A debuggable file could been a .psm1 file in a directory which wasn't covered for creation.
Was missing an override for equals inside PathedModuleSpec which caused non matching modules to equal.
The AzureAD module seems to be broken when attempting to Import it inside the powershell session managed by C#, complaining about the processor arch being MSIL and not matching the AMD64 requirement.

Due to this we can't get any export information from AzureAD.
This also seems to fix an issue that was somehow cloning instances of a compiled object.
The AddRequirementHashBytes method now also adds the ComputedHash for all Compiled Module Dependencies so that changes to a dependencies content are properly reflected to the top level scripts hash.
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.

1 participant