Skip to content

Unable to get EMSDK version when evaluating NativeFileReference in nuget package props or targets #61306

Closed
dotnet/emsdk
#393

Description

@yamachu

Is your feature request related to a problem? Please describe.

The following article explains that pre-built libraries need to be built with the same version of emscripten specified in wasm-tools.
https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-net-6-rc-2/#native-dependencies-support-for-blazor-webassembly-apps
As the version of wasm-tools increases in the future, the version of emscripten is expected to increase as well.

Describe the solution you'd like

If we can get the version of emscripten in the build environment,
we can create backward compatible nuget packages by including the version information in the NativeFileReference path.

So, I would like you to provide a variable to get the version.

Additional context

I evaluated RuntimeEmccVersionRaw and ActualEmccVersionRaw with PropertyGroup and with NativeFileReference, but they were evaluated as empty characters. (so now fixed value is written as 2.0.23)

https://github.com/yamachu/SharpOpenJTalk/blob/f864409201d446de8757a8b2d4fdde17e5c29dc8/library/full/nuget/SharpOpenJTalk.props#L2-L6

I think this is due to the slow evaluation timing of the target that evaluates Emscripten's Version.

https://github.com/dotnet/runtime/blob/b9a2c48aa84b0b05f9a02ff42f2e249033261292/src/mono/wasm/build/WasmApp.Native.targets

Activity

  1. transferred this issue fromdotnet/aspnetcoreon Nov 8, 2021
  2. ghost added
    untriaged
    on Nov 8, 2021
  3. added
    arch-wasm
    on Nov 8, 2021
  4. lewing commented on Nov 9, 2021

    @lewing
    Member

    Assume 2.0.23 for net6.0 until further notice, we're working on an improved versioning setup.

  5. removed
    untriaged
    on Nov 9, 2021
  6. added this to the 7.0.0 milestone on Nov 9, 2021
  7. modified the milestones: 7.0.0, 8.0.0 on Aug 10, 2022
  8. radical commented on Jul 25, 2023

    @radical
    Member

    These properties become available when _CheckEmccIsExpectedVersion target is run. But we should have the fixed version available as a property.

    @directhex could we add the emsdk version string as a property in https://github.com/dotnet/emsdk/blob/1f68fcee45ca75a2cb780edaff1e695af4d4f787/eng/sdk_files/Emscripten.Sdk.props#L4 or similar?

  9. directhex commented on Jul 26, 2023

    @directhex
    Contributor

    We can do anything we like. We live in a universe of infinite possibilities, unbound by anything but the limits of our own imaginations.

    In the emsdk case, the version string reported by emcc --version is composed from the contents of two files, emscripten/emscripten-version.txt and emscripten/emscripten-revision.txt (which for us come from hand-maintained files in eng/ in emscripten.git). If we get our property to load from those files, that avoids needing to keep it up to date in multiple places.

  10. ghost locked as resolved and limited conversation to collaborators on Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-wasmarea-Build-mono

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions