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 ConfigOption for disabling the .NET SDK Validator #2641

Conversation

caaavik-msft
Copy link
Contributor

We are in the process of upgrading the .NET runtime repository to target the .NET 10 TFM, and so when this happens we have some benchmarks which are configured to target .NET 9, but the .NET 10 SDK will be installed. We wanted to add a config option that lets us disable the SDK validator so that we can do this without getting a validation error.

@timcassell
Copy link
Collaborator

What's the actual error you're getting? I wonder if the validator can be fixed rather than disabled.

@caaavik-msft
Copy link
Contributor Author

caaavik-msft commented Sep 21, 2024

In our specific case, we are passing in wasmnet90 but the SDK being installed is .NET 10 SDK. So it was invalid because there is no .NET 9 SDK installed, which is what we want at this point. Longer term we probably want to find a way to handle wasm that doesn't require us to have to specify the .NET version in the runtime.

The error is "The required .NET Core SDK version 9.0 for runtime moniker WasmNet90 is not installed."

@timcassell
Copy link
Collaborator

In our specific case, we are passing in wasmnet90 but the SDK being installed is .NET 10 SDK. So it was invalid because there is no .NET 9 SDK installed, which is what we want at this point.

The error is "The required .NET Core SDK version 9.0 for runtime moniker WasmNet90 is not installed."

Is running wasm for net9.0 supported with the net10 sdk?

Longer term we probably want to find a way to handle wasm that doesn't require us to have to specify the .NET version in the runtime.

Using wasm moniker doesn't already work? It looks like the config parser should use the current runtime version for it. And the validator uses the same logic.

case RuntimeMoniker.Wasm:
return MakeWasmJob(baseJob, options, RuntimeInformation.IsNetCore ? CoreRuntime.GetCurrentVersion().MsBuildMoniker : "net5.0", runtimeMoniker);

@timcassell
Copy link
Collaborator

timcassell commented Sep 21, 2024

Oh I see, you aren't using wasm moniker because of the mainJs branching.

string mainJs = runtime.RuntimeMoniker < RuntimeMoniker.WasmNet70 ? "main.js" : "test-main.js";

Is that actually still relevant? Can that branch be removed and we just always use test-main.js? Or should we update that branch to account for the wasm case to account for the current runtime version?

@lewing
Copy link
Member

lewing commented Sep 21, 2024

In our specific case, we are passing in wasmnet90 but the SDK being installed is .NET 10 SDK. So it was invalid because there is no .NET 9 SDK installed, which is what we want at this point.
The error is "The required .NET Core SDK version 9.0 for runtime moniker WasmNet90 is not installed."

Is running wasm for net9.0 supported with the net10 sdk?

The .NET SDK can target previous versions, so it is fine to target 9 in a 10.0.xxx SDK, it is a required part of the support matrix. During the part of the year when the runtime and sdk are being updated to support a new tfm (now) that feature can be critical to resolve what would otherwise be circular dependencies between the runtime and sdk.

@timcassell
Copy link
Collaborator

The .NET SDK can target previous versions, so it is fine to target 9 in a 10.0.xxx SDK, it is a required part of the support matrix. During the part of the year when the runtime and sdk are being updated to support a new tfm (now) that feature can be critical to resolve what would otherwise be circular dependencies between the runtime and sdk.

So the Core SDK is backwards compatible just like the Framework SDK. In that case, we do need to update the validator to account for that backwards compatibility.

We can also update the WasmExecutor to fix the wasm moniker for the test-main.js path.

Either or both of those things should make this PR unnecessary, I think.

@caaavik-msft
Copy link
Contributor Author

Will close this PR in favour of an alternative solution

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.

3 participants