dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.55k stars 4.54k forks source link

[wasm] Build doesn't rebuild when certain properties change #94595

Open vargaz opened 7 months ago

vargaz commented 7 months ago

Description

Changing certain msbuild properties doesn't cause the app to be rebuilt.

Reproduction Steps

In src/mono/sample/wasm/console-v8:

  1. WasmBuildNative time make MSBUILD_ARGS="/p:WasmBuildNative=true" time make MSBUILD_ARGS="/p:WasmBuildNative=false" -> the second one doesn't rebuild. It should be using dotnet.*wasm from the runtime pack.
  2. WasmNativeStrip time make MSBUILD_ARGS="/p:WasmBuildNative=true /p:WasmNativeStrip=false" time make MSBUILD_ARGS="/p:WasmBuildNative=true /p:WasmNativeStrip=true" -> the second one doesn't rebuild
  3. WasmEnableWebcil time make MSBUILD_ARGS="" time make MSBUILD_ARGS="/p:WasmEnableWebcil=false" -> the second one doesn't rebuild.

    Expected behavior

Rebuilds.

Actual behavior

.

Regression?

No response

Known Workarounds

No response

Configuration

dotnet/runtime master

Other information

No response

vargaz commented 7 months ago

@radical

ghost commented 7 months ago

Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.

Issue Details
### Description Changing certain msbuild properties doesn't cause the app to be rebuilt. ### Reproduction Steps In src/mono/sample/wasm/console-v8: 1. WasmBuildNative ```time make MSBUILD_ARGS="/p:WasmBuildNative=false" time make MSBUILD_ARGS="/p:WasmBuildNative=true" ``` -> the second one doesn't rebuild 2. WasmNativeStrip ```time make MSBUILD_ARGS="/p:WasmBuildNative=true /p:WasmNativeStrip=false" time make MSBUILD_ARGS="/p:WasmBuildNative=true /p:WasmNativeStrip=true" ``` -> the second one doesn't rebuild ### Expected behavior Rebuilds. ### Actual behavior . ### Regression? _No response_ ### Known Workarounds _No response_ ### Configuration dotnet/runtime master ### Other information _No response_
Author: vargaz
Assignees: radical
Labels: `arch-wasm`, `untriaged`, `area-Build-mono`
Milestone: -
ilonatommy commented 1 month ago

It should be using dotnet.*wasm from the runtime pack.

Judging by the message, it's an expected behavior. However, when we pass:

We should have a way of passing SkipUnchangedFiles to the target that copies to AppBundle.

radical commented 1 month ago

We should have a way of passing SkipUnchangedFiles to the target that copies to AppBundle.

That's an implementation detail. For this issue you will probably need to track some important properties for every build, so save their values during a build. And when a subsequent one is done then you can compare whether any of the important properties changed, and if so trigger a native rebuild.