1. 17 11月, 2021 1 次提交
    • P
      [wasm] renames and cleanup before modularization (#61596) · da0e0f73
      Pavel Savara 提交于
      - no imports from outer scope
      - move dotnet to -extern-pre-js
      - re-enable JS minification with ES2018
      - rename main javaScript files to main.js and test-main.js
      - sample and test script cleanup
      - rename set_exit_code method
      - rewrite test start as async method
      - improve script loading via script element on page in test
      - use BINDING.bind_static_method instead of INTERNAL where possible
      - better .d.ts exports
      - formatted html files
      - renamed modules.ts to imports.ts which makes more sense
      - improved error propagation
      - renamed __initializeImportsAndExports
      - delayed exit and stdout flush
      da0e0f73
  2. 03 11月, 2021 1 次提交
    • A
      [wasm] Re-enable source generator tests failing due to OOM (#60701) · 5a078b51
      Ankit Jain 提交于
      This adds support for setting per-project optimization flags, and sets them for these projects so they don't OOM.
      
      Microsoft.Extensions.Logging.Generators.Roslyn3.11.Tests
      Microsoft.Extensions.Logging.Generators.Roslyn4.0.Tests
      System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests
      System.Text.Json.SourceGeneration.Roslyn4.0.Unit.Tests
      System.Text.RegularExpressions.Generators.Tests
      Some individual ones are disabled due to
      #58226, and #60899 .
      
      Additionally, if a AOT build fails, then on linux it dumps the last few lines from dmesg, to help identify it was an oom-kill.
      
      Fixes #51961 .
      Co-authored-by: NLarry Ewing <lewing@microsoft.com>
      5a078b51
  3. 17 9月, 2021 1 次提交
  4. 18 8月, 2021 1 次提交
    • A
      [wasm] Add incremental build support (#57113) · 3e3b00c5
      Ankit Jain 提交于
      * Update tasks to support incremental build
      
      MonoAOTCompiler:
      - Compiles assemblies to .bc files.
      - Hashes for the .bc files are stored in a json cache file.
      - And uses .depfile generated by mono-aot-cross, to figure out the
        if any of the dependencies have changed
      - Writes out the actual .bc file only if the assembly, or it's
        dependencies changed
      
      EmccCompile.cs: Support a `%(Dependencies)` metadata on the source
      files, to compile the files only when needed.
      
      * Update wasm targets
      
      * don't pass unncessary args to RunTests
      
      * Add tests for incremental builds
      
      * Disable non-wasm builds, for testing
      
      * Add miggins LogAsErrorException.cs
      
      * Bump sdk for workload testing to 6.0.100-rc.1.21410.3
      
      * fix build
      
      * MonoAOTCompiler: use the full path to copy the final .bc file
      
      * Make the method used with `MemberData`, static
      
      otherwise xunit just shows a cryptic:
      ```
          Wasm.Build.Tests.RebuildTests.NoOpRebuild [STARTING]
          Wasm.Build.Tests.RebuildTests.NoOpRebuild [FAIL]
            System.NotSupportedException : Specified method is not supported.
      ```
      
      * add back builds
      
      * Split Wasm.Build.Tests into multiple helix jobs
      
      * Revert "add back builds"
      
      This reverts commit 1d031c04e13780ec73180ba6f06a37ee42c24203.
      
      * Split up native rebuild tests
      
      * remove non-test classes
      
      * add back builds
      
      This reverts commit b008130a7886c2e2b9f16c83641c1b8c936082f6.
      
      * MonoAOTCompiler: make cache optional
      
      * MonoAOTCompiler: handle the case where we have a cache entry, but the file on disk doesn't exist
      
      * Fix aot compiler task output
      
      * MonoAOTCompiler: Use hashes of .bc files instead of assemblies
      
      `--depfile` isn't supported on aot config used by android, and fails
      with:
      
      ```
      * Assertion at /__w/1/s/src/mono/mono/mini/aot-compiler.c:14216, condition `acfg->aot_opts.llvm_only && acfg->aot_opts.asm_only && acfg->aot_opts.llvm_outfile' not met
      ```
      
      Instead, use hashes of the .bc.tmp files generated, with the existing
      .bc files.
      
      * MonoAOTCompiler: Support more than one output file
      
      The earlier implementation assumed that there would be only one output
      file. But in some cases (eg. android), there are more than one, like
      `.s`, `.dll-llvm.o`.
      
      * -bump sdk for workload testing
      
      * MonoAOTCompiler: don't use tmp files at all, when cache isn't being
      
      .. used.
      Co-authored-by: NLarry Ewing <lewing@microsoft.com>
      3e3b00c5
  5. 06 8月, 2021 1 次提交
    • F
      Add runtimeconfig.json support for WebAssembly (#56486) · 13f80656
      Fan Yang 提交于
      * Initial change for adding runtimeconfig to wasm
      
      * Add runtimeconfig support to wasm
      
      * Move test folder and update runtimeconifg task name
      
      * Fix test
      
      * Fix test csproj file
      
      * Use the right var for main dll name
      
      * Resolve review feedback part 1
      
      * Resolve review feedbacks part 2
      
      * Add doc for updating dependencies when adding new tasks
      
      * Remove redundant condition and redundant copy
      
      * There is no runtimeconfig.json file to parse, when OutputType is library. So skip it.
      
      * Skip for Android tests as well.
      
      * Remove the wrong locatioin of WasmFilesToIncludeInFileSystem
      
      * Update runtimeconfig file path
      
      * Add RuntimeConfigParserTasksAssemblyPath to linker test project template
      
      * Fix test failures on WASM EAT and AOT lanes
      
      * [wasm] Add a test for reading runtimeconfig.json
      
      * improve error reporting slightly
      
      * Enable tests
      
      * One more thing to enable tests
      
      * Run target _WasmGenerateRuntimeConfig when runtimeconfig.json file exists
      
      * Add a test for configure runtime using msbuild properties
      
      * Fix runtime test failures
      
      * Update tests base on feedback
      
      * Add missing ")"
      
      * Add one more condition
      
      * More format changes
      
      * Better error handling
      
      * [wasm] Fix build for a test support project
      
      This fixes the build for ApplyUpdateReferencedAssembly.csproj, which is
      a support project for HotReload wasm functional test.
      
      ```
      D:\workspace\_work\1\s\src\mono\wasm\build\WasmApp.targets(131,5): error : Could not find
          D:\workspace\_work\1\s\artifacts\bin\ApplyUpdateReferencedAssembly\net6.0-Release\browser-wasm\publish\ApplyUpdateReferencedAssembly.runtimeconfig.json
          for D:\workspace\_work\1\s\artifacts\bin\ApplyUpdateReferencedAssembly\net6.0-Release\browser-wasm\publish\ApplyUpdateReferencedAssembly.dll.
      
          [D:\workspace\_work\1\s\src\tests\FunctionalTests\WebAssembly\Browser\HotReload\ApplyUpdateReferencedAssembly\ApplyUpdateReferencedAssembly.csproj]
      ```
      
      The wasm targets should be run at all for this project. But they are run
      because they get imported by tests.wasm.targets, which gets imported because
      `$(IsTestProject)=true`.
      
      The csproj has `$(IsTestProject)=false`, and `$(IsTestSupportProject)=true`,
      which should mean that the test.props/targets don't get imported. But the
      import is conditioned on `$(EnableTestSupport)`, which gets set in
      `src/libraries/Directory.Build.props`. And that means setting
      `$(IsTestProject)=true` in the csproj is too late.
      
      So, instead, set that in a `Directory.Build.props`. And also, ensure that the
      `Directory.Build.props` for functional tests doesn't override the value!
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      13f80656
  6. 19 7月, 2021 1 次提交
    • R
      [wasm] Run browser tests on helix/windows (#52699) · a587fa4b
      Radek Doulik 提交于
      * [wasm] Run browser tests on helix/windows
      
      * Build just wasm/browsertests on helix/windows
      
      * Use $(ChromiumRevision) in windows links
      
      * Fix conditions
      
      * Set PATH differently
      
      * Use backslash in PATH on windows
      
      * Try different version of chromium
      
      * Pass scenario and browser host to build
      
      And set browser path on windows to be able to start chrome
      from xharness
      
      * Try to get more info from the helix workitems
      
      * Fix dir separator, add broser path
      
      * Create WasmBuildSupportDir
      
      * Revert "Try to get more info from the helix workitems"
      
      This reverts commit 8807434a33a09a27f2c21cb321b743f155955cb2.
      
      * Put the dir cmds back, fix mkdir call
      
      * More debug info
      
      * Bump xharness
      
      * Bump xharness again
      
      With darc this time
      
      * StressLogAnalyzer didn't print the number of messages correctly if it exceeded the int range (2 billion). (#54832)
      
      Fix is to just use 64 bit ints instead.
      
      * Found a race condition where the LOH flag on a segment is set too late. This gives another thread the chance to allocate in a fresh LOH region that doesn't have the LOH flag set just yet and trip over an assert in Object::ValidateInner. (#54839)
      
      The fix is simply to set the flag in get_new_region before the region is put on the list for the LOH generation.
      
      * Try to show the chrome logs
      
      * Use different path for chrome logs
      
      * Use newer image with font for chrome
      
      The chrome was crashing, because it didn't find any sans-serif font.
      
      * Increase timeouts
      
      * Disable tests which timeout
      
      * Remove debug calls
      
      * Put back normal scenario
      
      * Do not set scenario in build args
      
      * Add browser sample exclusion
      
      * Restore the platform matrix
      
      * Remove the wasm build test changes
      
      That will be handled in https://github.com/dotnet/runtime/pull/54451
      
      * Remove duplicate exclusion
      
      * Suggested property name change
      
      * Fix last merge
      
      * Simplify condition
      
      We don't pass Scenario anymore
      
      * Include chrome and chromedriver in the payload
      Co-authored-by: NPeter Sollich <petersol@microsoft.com>
      a587fa4b
  7. 14 7月, 2021 1 次提交
  8. 24 6月, 2021 1 次提交
    • R
      [wasm] Bump emscripten to 2.0.23 (#53603) · 055a38a9
      Radek Doulik 提交于
      Bumps emscripten to 2.0.23
      
      The Browser AOT tests now use `-Wl,-lto-O0` option to reduce memory usage of `wasm-ld` tool, which was in some cases going over avaiable 8GB on helix machines.
      
      * Revert "Add ActiveIssue to the MemoryMappedFiles tests"
      
      This reverts commit ec1ae530606ef1061680600fc046226cc1c4cbc3.
      
      * Revert "Add ActiveIssue attr to the FileSystem tests"
      
      This reverts commit 356b3ff2a703980ac01b9df697a594e8c341c436.
      
      * Bump emscripten version to 2.0.23
      
      * Use newer docker images with 2.0.23
      
      * Update docs
      
      * Use 2.0.23 emscripten nuget packages
      
      * Revert "Revert "Add ActiveIssue attr to the FileSystem tests""
      
      This reverts commit eb2f9548b08c114b359fab8d867ba50de098fe48.
      
      The fix is not present in 2.0.23
      
      * Revert "Revert "Add ActiveIssue to the MemoryMappedFiles tests""
      
      This reverts commit 8be39f583499a8d8451034c65260a785330b0795.
      
      The fix is not present in 2.0.23
      
      * Increase timeout for AOT tests
      
      * Add description of emscripten bump to README
      
      * Try to get information about resources
      
      * Get all limits
      
      * Escape & chars
      
      * Reduce platform matrix
      
      * Lets try one more build with doubled timeout
      
      * Revert "Lets try one more build with doubled timeout"
      
      This reverts commit 67dd7754bb79218b2c6b687034162d041715093e.
      
      * Try -Wl,-O0 on CI
      
      To be sure it behaves the same as in local build
      
      * Use -Wl,-lto-O0 do lower link time optimization
      
      It looks like it reduces the memory load a lot
      
      * Set EmccLinkOptimizationFlag for AOT tests
      
      And reset the default value
      
      * Escape commas
      
      * Revert "Reduce platform matrix"
      
      This reverts commit fec0e557208eb165824e75cd57b895a74d164de4.
      
      * Remove resource info retrieval
      
      * Bump emsdk versions
      Co-authored-by: NLarry Ewing <lewing@microsoft.com>
      055a38a9
  9. 23 6月, 2021 1 次提交
  10. 19 6月, 2021 1 次提交
  11. 29 5月, 2021 1 次提交
    • M
      [libraries] Move library tests Feature Switches defaults to Functional tests (#53253) · c6b5994f
      Mitchell Hwang 提交于
      * [libraries] Remove UseSystemResourceKeys true default
      
      * [libraries] Remove UseSystemResourceKeys for iOS
      
      * [libraries] Resolve WebSockets System resource keys activeissue
      
      * [tests] Move default feature switches from libraries to functional tests
      
      * [tests] Move Browser wasm default switches into FuntionalTests scope
      
      * Add Browser OS condition
      
      * Move DefaultFeatureSwitches initialization to FunctionalTests project
      
      * Consolidate trimming framework library features and condition for libraries with EnableAggressiveTrimming
      
      * [testing][EAT] Revert trimming framework library features to browser defaults for enable aggressive trimming
      
      * [tests] Add Xamarin Android, Xamarin Mac/iOS, and Wasm feature defaults to Functional tests
      
      * Fixup tabs to spaces
      
      * Add common feature switches, links, and cleanup
      
      * Cleanup Xamarin Android link
      Co-authored-by: NMitchell Hwang <mitchell.hwang@microsoft.com>
      c6b5994f
  12. 05 5月, 2021 1 次提交
    • A
      [wasm] Fix Emscripten SDK provisioning for tests (#52273) · c3658d27
      Ankit Jain 提交于
      - For running on AOT tests on helix, we need to send emsdk as a payload
      - On the CI machines, emscripten is available in `/usr/local/emscripten/`
      - but the helix tasks try to write a `.payload` file in that dir, which fails
        because of permissions
      
      - So, we copy emsdk to local `src/mono/wasm/emsdk`
      - But we were doing it as part of *every* test build!
          - this meant unncessarily copying, and races causing errors like:
      
      ```
      /__w/1/s/eng/testing/tests.wasm.targets(138,5):
          error MSB3026: Could not copy "/usr/local/emscripten/emsdk/node/14.15.5_64bit/bin/node" to "/__w/1/s/src/mono/wasm/emsdk/node/14.15.5_64bit/bin/node".
      
          Beginning retry 1 in 1000ms. The process cannot access the file '/__w/1/s/src/mono/wasm/emsdk/node/14.15.5_64bit/bin/node' because it is being used by another process.  [/__w/1/s/src/libraries/System.Collections.Specialized/tests/System.Collections.Specialized.Tests.csproj]
      ```
      
      - Instead, do that once when preparing work items for helix
      
      Fixes https://github.com/dotnet/runtime/issues/52254 .
      c3658d27
  13. 24 4月, 2021 1 次提交
  14. 22 4月, 2021 1 次提交
    • S
      Shift Most of Wasm AOT test build to helix (#48226) · 6ca3d910
      Steve Pfister 提交于
      Since AOT'ing each test suite takes between 3-9 min, we need to shift the burden over to helix.
      
      ## This is done by:
      1. building the test assemblies on the build machine
         - the wasm part of the build is not executed on the build machine,
            because it has the AOT build part
      2. Zip up the test assembly+friends, *and* any bits required to run the wasm
          app build for that on helix (eg. emsdk, wasm app targets, cross compiler etc)
      3. Send all this to helix, and use a custom `aot-build.proj`
           - which recreates all the build inputs for the `WasmBuildApp` target
              using the paths for the assets on helix
           - then we can run `WasmBuildApp` for the build, resulting in a wasm app
             bundle.
      4. Run the tests!
      
      - We already have the bits required for building wasm apps on helix, supported
      for `Wasm.Build.Tests`, which we can use here too.
      
      ## Trimming:
      
      - Since, AOT can be so expensive, we use `EnableAggressiveTrimming=true`(EAT), but
         that means that we could have issues due to trimming.
      - And it can sometimes be unclear whether the build/test failures are due to trimming
           or AOT.
      
      - Because these builds+test runs are different from other builds, owing to the
         "build partially on helix" step, a normal EAT build would not be the same as 
      - to help with testing this, we add two lanes to `runtime-staging`:
         - `*_Mono_AOT`: builds AOT+EAT on helix
         - `*_Mono_EAT`: builds EAT, on helix
            - this is required because we want to run almost the same kinda
               build: 1. build test assembly; *2. send to helix; 3. build wasm app;* 4. run tests
      
      - This should effectively mean that we can see which errors might be due to EAT, and
         which are clearly because of EAT+AOT.
      Co-authored-by: NSteve Pfister <steve.pfister@microsoft.com>
      Co-authored-by: NMarek Safar <marek.safar@gmail.com>
      Co-authored-by: NMitchell Hwang <mitchell.hwang@microsoft.com>
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      6ca3d910
  15. 14 4月, 2021 1 次提交
    • R
      [wasm] Initial test support on windows (#49830) · a504a9b3
      Radek Doulik 提交于
      Add support to run libraries tests on windows. Examples of how to run the tests:
      
          .\build.cmd libs.tests -test -os browser
          .\dotnet.cmd build /t:Test /p:TargetOS=Browser src\libraries\System.Collections.Concurrent\tests
          .\dotnet.cmd build /t:Test /p:TargetOS=Browser /p:JSEngine="SpiderMonkey" src\libraries\System.Text.Json\tests
      a504a9b3
  16. 13 4月, 2021 1 次提交
  17. 08 4月, 2021 1 次提交
    • A
      [wasm][tests] Add properties to allow passing args to xharness (#50678) · 8a1101d2
      Ankit Jain 提交于
      * [wasm][tests] Add properties to allow passing args to xharness
      
      New properties:
      - `$(WasmXHarnessArgs)`
      - `$(WasmXHarnessMonoArgs)`
      - `$(WasmTestAppArgs)`
      
      Xharness command line is built with these:
      
      `dotnet xharness wasm test .. $(WasmXHarnessArgs) .. -- $(WasmXHarnessMonoArgs) .. --run .. $(WasmTestAppArgs)`
      
      * [wasm][tests] extract wasm bits into tests.wasm.targets
      
      * [wasm] set EMSDK_PATH for makefile run-tests- targets
      
      * [wasm] Update target dependencies for wasm
      
      * Don't overwrite RunScriptCommand, thus fixing wasm build tests
      
      * Track property name changes
      8a1101d2