Skip to content

[ppc64le][.net7] Unhandled Exception: System.PlatformNotSupportedException: System.Data.ODBC is not supported on this platform #78563

Closed

Description

@janani66

Description

Support for ppc64le architecture was added in .NET7. Using this, we were trying some sample code which uses System.Data.Odbc package.

The sample code works on x86 machine with .NET7 but fails on ppc64le. We are not sure about the root cause of the problem but suspect it is because there is no enablement for ppc64le in https://github.com/dotnet/msbuild/blob/main/eng/common/cross

dotnet build shows the MSBuild Version as MSBuild version 17.4.0+18d5aef85 for .NET

The .csproj has the following:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net7.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="System.Data.Odbc" Version="7.0.0" />
  </ItemGroup>

</Project>

Project was created as follows:

# dotnet new console -o odbc_sample
The template "Console App" was created successfully.

Processing post-creation actions...
Restoring /root/samples/odbc_sample/odbc_sample.csproj:
 Determining projects to restore...
 Restored /root/samples/odbc_sample/odbc_sample.csproj (in 230 ms).
Restore succeeded.

# cd odbc_sample/
# dotnet add package System.Data.Odbc
 Determining projects to restore...
 Writing /tmp/tmp5D3gRy.tmp
info : X.509 certificate chain validation will use the system certificate bundle at '/etc/pki/ca-trust/extracted/pem/objsign-ca-bundle.pem'.
info : X.509 certificate chain validation will use the fallback certificate bundle at '/usr/lib64/dotnet/sdk/7.0.100/trustedroots/timestampctl.pem'.
info : Adding PackageReference for package 'System.Data.Odbc' into project '/root/samples/odbc_sample/odbc_sample.csproj'.
info :  GET https://api.nuget.org/v3/registration5-gz-semver2/system.data.odbc/index.json
info :  OK https://api.nuget.org/v3/registration5-gz-semver2/system.data.odbc/index.json 43ms
info : Restoring packages for /root/samples/odbc_sample/odbc_sample.csproj...
info :  GET https://api.nuget.org/v3-flatcontainer/system.data.odbc/index.json
info :  OK https://api.nuget.org/v3-flatcontainer/system.data.odbc/index.json 117ms
info :  GET https://api.nuget.org/v3-flatcontainer/system.data.odbc/7.0.0/system.data.odbc.7.0.0.nupkg
info :  OK https://api.nuget.org/v3-flatcontainer/system.data.odbc/7.0.0/system.data.odbc.7.0.0.nupkg 17ms
info :  GET https://api.nuget.org/v3-flatcontainer/system.text.encoding.codepages/index.json
info :  OK https://api.nuget.org/v3-flatcontainer/system.text.encoding.codepages/index.json 116ms
info :  GET https://api.nuget.org/v3-flatcontainer/system.text.encoding.codepages/7.0.0/system.text.encoding.codepages.7.0.0.nupkg
info :  OK https://api.nuget.org/v3-flatcontainer/system.text.encoding.codepages/7.0.0/system.text.encoding.codepages.7.0.0.nupkg 17ms
info : Installed System.Text.Encoding.CodePages 7.0.0 from https://api.nuget.org/v3/index.json with content hash LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ==.
info : Installed System.Data.Odbc 7.0.0 from https://api.nuget.org/v3/index.json with content hash siwu7NoCsfHa9bfw2a2wSeTt2c/rhk3X8I28nJln1dlxdW3KqhRp0aW87yH1XkCo9h8zO1qcIfdTHO7YvvWLEA==.
info : Package 'System.Data.Odbc' is compatible with all the specified frameworks in project '/root/samples/odbc_sample/odbc_sample.csproj'.
info : PackageReference for package 'System.Data.Odbc' version '7.0.0' added to file '/root/samples/odbc_sample/odbc_sample.csproj'.
info : Writing assets file to disk. Path: /root/samples/odbc_sample/obj/project.assets.json
log : Restored /root/samples/odbc_sample/odbc_sample.csproj (in 1.21 sec).

Sample code ( note: we are able to connect to the database using cli )

using System;
using System.Collections.Generic;
using System.Text;
using System.Data.Odbc;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string MyConString = "DRIVER={Free Sybase & MS SQL Driver}; " +
            "SERVER=(local); " +
            "DATABASE=TestDB; " +
            "UID=sa; " +
            "PWD=password@123; " +
            "TrustServerCertificate=yes; ";

            OdbcConnection DbConnection = new OdbcConnection(MyConString);
            //OdbcConnection DbConnection = new OdbcConnection("driver={ODBC Driver 18 for SQL Server};Server=(local);TrustServerCertificate=yes;Database=TestDB;UID=sa;PWD=password@123;");

            DbConnection.Open();

            OdbcCommand DbCommand = DbConnection.CreateCommand();

            DbCommand.CommandText = "SELECT * FROM Persons";
            OdbcDataReader DbReader = DbCommand.ExecuteReader();

            int fCount = DbReader.FieldCount;

            Console.Write( ":" );
            for ( int i = 0; i < fCount; i ++ )
            {
                String fName = DbReader.GetName(i);
                Console.Write( fName + ":" );
            }
            Console.WriteLine();

            while( DbReader.Read())
            {
                Console.Write( ":" );
                for (int i = 0; i < fCount; i++)
                {
                    String col = DbReader.GetString(i);
                    Console.Write(col + ":");
                }
                Console.WriteLine();
            }

            DbReader.Close();
            DbCommand.Dispose();
            DbConnection.Close();
        }
    }
}

But on Power ppc64le machine we are getting below error

# dotnet build
MSBuild version 17.4.0+18d5aef85 for .NET
  Determining projects to restore...
  Restored /root/samples/odbc_sample/odbc_sample.csproj (in 527 ms).
  odbc_sample -> /root/samples/odbc_sample/bin/Debug/net7.0/odbc_sample.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:04.13

# dotnet run 
Unhandled Exception:
 System.PlatformNotSupportedException: 
System.Data.ODBC is not supported on this platform. at System.Data.Odbc.OdbcConnection..ctor(String connectionString)   at ConsoleApplication1.Program.Main(String[] args) in /root/samples/odbc_sample/Program.cs:line 19 

[ERROR] FATAL UNHANDLED EXCEPTION: 
System.PlatformNotSupportedException: System.Data.ODBC is not supported on this platform. 
at System.Data.Odbc.OdbcConnection..ctor(String connectionString) at ConsoleApplication1.Program.Main(String[] args) in /root/samples/odbc_sample/Program.cs:line 19

During debugging what we found MSBuild::GetTargetPlatformIdentifier () may be returning empty string and this (https://github.com/dotnet/runtime/blob/main/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj#L27) code throwing error. When we check the MSBuild repo https://github.com/dotnet/msbuild we don’t see ppc64le changes in eng/common/cross folder.

https://github.com/dotnet/msbuild/blob/main/eng/common/README.md says "The files in this directory are shared by all Arcade repos and managed by automation. If you need to make changes to these files, open an issue or submit a pull request to https://github.com/dotnet/arcade first." --

Question @akoeplinger :
Since the https://github.com/dotnet/arcade/tree/main/eng/common/cross has support for ppc64le, does it also need to get propagated to msbuild?

Note: We opened the same issue in the arcade repo ( see dotnet/arcade#11675 ) but since we don't know if our analysis of root cause is right, opening it in the runtime repo also

Tagging @omajid / @Sapana-Khemkar / @uweigand for awareness.

Reproduction Steps

On a ppc64le machine

  • Install .net7 SDK

  • Install mysql, created database and table, add sample data in table. Verify that you can connect to database and retrieve data using command line

  • Create a sample C# program that uses System.Data.Odbc to connect to the backend mysql database

# dotnet new console -o odbc_sample
The template "Console App" was created successfully.

Processing post-creation actions...
Restoring /root/samples/odbc_sample/odbc_sample.csproj:
 Determining projects to restore...
 Restored /root/samples/odbc_sample/odbc_sample.csproj (in 230 ms).
Restore succeeded.

# cd odbc_sample/
# dotnet add package System.Data.Odbc
  • Run the program using dotnet run

Expected behavior

Be able to connect to the database and retrieve data

Actual behavior

# dotnet run 
Unhandled Exception:
 System.PlatformNotSupportedException: 
System.Data.ODBC is not supported on this platform. at System.Data.Odbc.OdbcConnection..ctor(String connectionString)   at ConsoleApplication1.Program.Main(String[] args) in /root/samples/odbc_sample/Program.cs:line 19 

[ERROR] FATAL UNHANDLED EXCEPTION: 
System.PlatformNotSupportedException: System.Data.ODBC is not supported on this platform. 
at System.Data.Odbc.OdbcConnection..ctor(String connectionString) at ConsoleApplication1.Program.Main(String[] args) in /root/samples/odbc_sample/Program.cs:line 19

Regression?

No response

Known Workarounds

No response

Configuration

# uname -a
Linux dotnet-validator-ghatwala 4.18.0-348.2.1.el8_5.ppc64le #1 SMP Mon Nov 8 12:14:56 EST 2021 ppc64le ppc64le ppc64le GNU/Linux
# cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.6 (Ootpa)
[root@dotnet-validator-ghatwala ~]# dotnet --info
.NET SDK:
 Version:   7.0.100
 Commit:    e12b7af219

Runtime Environment:
 OS Name:     rhel
 OS Version:  8
 OS Platform: Linux
 RID:         rhel.8-ppc64le
 Base Path:   /usr/lib64/dotnet/sdk/7.0.100/

Host:
  Version:      7.0.0
  Architecture: ppc64le
  Commit:       d099f075e4

.NET SDKs installed:
  7.0.100 [/usr/lib64/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.0 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.0 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/usr/lib64/dotnet]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Other information

No response

Activity

  1. ghost added
    untriaged
    on Nov 18, 2022
  2. added
    os-linux
    on Nov 19, 2022
  3. akoeplinger commented on Nov 21, 2022

    @akoeplinger
    Member

    The eng/common/cross changes are unrelated, those are for native code. I think the root cause is something else.

    The MSBuild::GetTargetPlatformIdentifier() should work I think though at this point the architecture shouldn't matter ("platform" in this case means OS i.e. Windows/Unix/etc). And since you're using the package from NuGet it should pull down the binary built by Microsoft so it doesn't matter.

  4. akoeplinger commented on Nov 21, 2022

    @akoeplinger
    Member

    Can you please record a binlog and share it? I think it is somehow picking the wrong assembly from the nuget.

  5. Sapana-Khemkar commented on Nov 21, 2022

    @Sapana-Khemkar
    Contributor

    Can you please record a binlog and share it? I think it is somehow picking the wrong assembly from the nuget.

    will share bin logs tomorrow.

  6. Sapana-Khemkar commented on Nov 22, 2022

    @Sapana-Khemkar
    Contributor

    @akoeplinger I could not record binlog for dotnet run but executed dotnet run --verbosity diag
    Attached is output log file.
    odbc_sample_run.log
    This did not help much.
    Below is my database setup

    [root@dotnet-validator-ghatwala odbc_sample]# mysql --version
    mysql  Ver 8.0.30 for Linux on ppc64le (Source distribution)
    [root@dotnet-validator-ghatwala odbc_sample]# systemctl status mysqld
    ● mysqld.service - MySQL 8.0 database server
       Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
       Active: active (running) since Tue 2022-11-22 05:42:57 EST; 37min ago
     Main PID: 3288700 (mysqld)
       Status: "Server is operational"
        Tasks: 39 (limit: 201691)
       Memory: 483.8M
       CGroup: /system.slice/mysqld.service
               └─3288700 /usr/libexec/mysqld --basedir=/usr
    
    Nov 22 05:42:52 dotnet-validator-ghatwala systemd[1]: Starting MySQL 8.0 database server...
    Nov 22 05:42:52 dotnet-validator-ghatwala mysql-prepare-db-dir[3288613]: Initializing MySQL database
    Nov 22 05:42:57 dotnet-validator-ghatwala systemd[1]: Started MySQL 8.0 database server.
    
    [root@dotnet-validator-ghatwala odbc_sample]# odbcinst -q -d -n MySQL
    [MySQL]
    Description=ODBC for MySQL
    Driver=/usr/lib/libmyodbc5.so
    Setup=/usr/lib/libodbcmyS.so
    Driver64=/usr/lib64/libmyodbc5.so
    Setup64=/usr/lib64/libodbcmyS.so
    FileUsage=1
    
    [root@dotnet-validator-ghatwala odbc_sample]# dnf list | grep unixODBC
    Errors during downloading metadata for repository 'copr:copr.fedorainfracloud.org:james:centpkg':
      - Status code: 404 for https://download.copr.fedorainfracloud.org/results/james/centpkg/epel-8-ppc64le/repodata/repomd.xml (IP: 13.226.139.35)
    Error: Failed to download metadata for repo 'copr:copr.fedorainfracloud.org:james:centpkg': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
    Ignoring repositories: copr:copr.fedorainfracloud.org:james:centpkg
    unixODBC.ppc64le                                                  2.3.7-1.el8                                                 @rhel-8-for-ppc64le-appstream-rpms
    unixODBC-devel.ppc64le                                            2.3.7-1.el8                                                 @rhel-8-for-ppc64le-appstream-rpms
    freeradius-unixODBC.ppc64le                                       3.0.20-12.module+el8.6.0+13617+542eca26                     rhel-8-for-ppc64le-appstream-rpms
    unixODBC.x86_64                                                   2.3.7-1.rh                                                  packages-microsoft-com-prod
    unixODBC-debuginfo.x86_64                                         2.3.7-1.rh                                                  packages-microsoft-com-prod
    unixODBC-devel.x86_64                                             2.3.7-1.rh                                                  packages-microsoft-com-prod
    

    Below is my System.Data.Odbc package

    [root@dotnet-validator-ghatwala ~]# ll ~/.nuget/packages/system.data.odbc/7.0.0/lib/net7.0/
    total 120
    -rwxr--r--. 1 root root 100992 Oct 18 12:24 System.Data.Odbc.dll
    -rwxr--r--. 1 root root  18408 Oct 18 12:24 System.Data.Odbc.xml
    

    Am I missing something?

  7. Sapana-Khemkar commented on Nov 22, 2022

    @Sapana-Khemkar
    Contributor

    Just an update, after enabling trace I getting below logs

    
    [root@dotnet-validator-ghatwala odbc_sample]# export set  MONO_ENV_OPTIONS="--trace=N:System.Data.Odbc"
    [root@dotnet-validator-ghatwala odbc_sample]# dotnet run
    [0x7fffbd215090:] EXCEPTION handling: System.IO.FileNotFoundException:
    [0x7fffbd215090:] EXCEPTION handling: System.IO.FileNotFoundException:
    [0x7fff832ff150:] EXCEPTION handling: System.IO.FileNotFoundException:
    [0x7fffb1a651e0: 0.00000 0] ENTER:c System.Data.Odbc.OdbcConnection:.ctor (string)(this:0x7fffa3801e00[System.Data.Odbc.OdbcConnection odbc_sample.dll], [STRING:0x7fffa1a60430:DRIVER={MySQL}; SERVER=(local); DATABASE=TestDB; UID=root; PWD=;TrustServerCertificate=yes; ])
    [0x7fffb1a651e0:] EXCEPTION handling: System.PlatformNotSupportedException: System.Data.ODBC is not supported on this platform.
    
    Unhandled Exception:
    System.PlatformNotSupportedException: System.Data.ODBC is not supported on this platform.
       at System.Data.Odbc.OdbcConnection..ctor(String connectionString)
       at ConsoleApplication1.Program.Main(String[] args) in /root/samples/odbc_sample/Program.cs:line 19
    [ERROR] FATAL UNHANDLED EXCEPTION: System.PlatformNotSupportedException: System.Data.ODBC is not supported on this platform.
       at System.Data.Odbc.OdbcConnection..ctor(String connectionString)
       at ConsoleApplication1.Program.Main(String[] args) in /root/samples/odbc_sample/Program.cs:line 19
    [root@dotnet-validator-ghatwala odbc_sample]#
    
    
    [root@dotnet-validator-ghatwala sqliteodbc-0.9998]# odbcinst -q -d -n MySQL
    [MySQL]
    Description=ODBC for MySQL
    Driver=/usr/lib/libmyodbc5.so
    Setup=/usr/lib/libodbcmyS.so
    Driver64=/usr/lib64/libmyodbc5.so
    Setup64=/usr/lib64/libodbcmyS.so
    FileUsage=1
    
    

    /usr/lib64/libmyodbc5.so this file is not there on my machine. Further investigation is in progress

  8. omajid commented on Nov 30, 2022

    @omajid
    Member

    Adding some information based on what @janani66 and @uweigand shared with me over the last few days.

    The issue seems to be down to the missing runtimes section in Microsoft.NETCore.App.deps.json. Without that runtimes section, the host seems to load lib/net7.0/System.Data.Odbc.dll (which throws) instead of runtimes/linux/lib/net7.0/System.Data.Odbc.dll.

    On s390x (and similar on ppc64le, I assume) a Microsoft.NETCore.App.deps.json as part of the portable build has this section, but a non-portable build is missing that section completely:

    $ build.sh 
    $ tail runtime-portable/artifacts/obj/Microsoft.NETCore.App.Runtime/Debug/net7.0/linux-s390x/Microsoft.NETCore.App.deps.json
        ],
        "linux-s390x": [
          "linux",
          "unix-s390x",
          "unix",
          "any",
          "base"
        ]
      }
    ...
    
    $ build.sh --portablebuild false 
    ...
    $ tail runtime-non-portable/artifacts/obj/Microsoft.NETCore.App.Runtime/Debug/net7.0/rhel.8-s390x/Microsoft.NETCore.App.deps.json
      },
      "libraries": {
        "Microsoft.NETCore.App.Runtime.rhel.8-s390x/7.0.0": {
          "type": "package",
          "serviceable": true,
          "sha512": "",
          "path": "microsoft.netcore.app.runtime.rhel.8-s390x/7.0.0"
        }
      }
    
    
  9. uweigand commented on Nov 30, 2022

    @uweigand
    Contributor

    Hmm. I can reproduce this on my Ubuntu system when building upstream runtime as well.

    However, on the same system, when I build the source-build tree (which also uses the non-portable RID), I get instead:

    uweigand@m8345019:~/source-build-tarball$ tail -20 ./src/runtime/artifacts/source-build/self/src/artifacts/obj/Microsoft.NETCore.App.Runtime/Release/net7.0/ubuntu.20.04-s390x/Microsoft.NETCore.App.deps.json 
          "sha512": "",
          "path": "microsoft.netcore.app.runtime.ubuntu.20.04-s390x/7.0.0-rtm.22507.1"
        }
      },
      "runtimes": {
        "ubuntu.20.04-s390x": [
          "ubuntu.20.04",
          "ubuntu-s390x",
          "ubuntu",
          "debian-s390x",
          "debian",
          "linux-s390x",
          "linux",
          "unix-s390x",
          "unix",
          "any",
          "base"
        ]
      }
    }
    

    It appears to me the difference is which input RID fallback graph is being used to generate the deps.json file. This happens in Microsoft.DotNet.SharedFramework.Sdk here:

        <GenerateSharedFrameworkDepsFile TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
                                         RuntimeIdentifier="$(RuntimeIdentifier)"
                                         SharedFrameworkName="$(SharedFrameworkName)"
                                         SharedFrameworkPackName="$(PackageId)"
                                         Version="$(Version)"
                                         Files="@(_FilesForDepsFile)"
                                         IntermediateOutputPath="$(IntermediateOutputPath)"
                                         SharedFrameworkDepsNameOverride="$(SharedFrameworkHostFileNameOverride)"
                                         RuntimeIdentifierGraph="$(BundledRuntimeIdentifierGraphFile)"
                                         IncludeFallbacksInDepsFile="$(IncludeFallbacksInDepsFile)">
    

    where BundledRuntimeIdentifierGraphFile seems to be set in the runtime in eng/liveBuilds.target:

      <PropertyGroup>
        <!-- Keep in sync with outputs defined in Microsoft.NETCore.Platforms.csproj. -->
        <BundledRuntimeIdentifierGraphFile>$([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'Microsoft.NETCore.Platforms', 'runtime.json'))</BundledRuntimeIdentifierGraphFile>
        <BundledRuntimeIdentifierGraphFile Condition="!Exists('$(BundledRuntimeIdentifierGraphFile)')">$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Microsoft.NETCore.Platforms', 'src', 'runtime.json'))</BundledRuntimeIdentifierGraphFile>
      </PropertyGroup>
    

    Now, when building runtime by itself, the above code uses the file src/libraries/Microsoft.NETCore.Platforms/src/runtime.json, which does not mention ubuntu20.04-s390x (or rhel.8-s390x for that matter) at all, only linux-s390x. However, during source-build, the file artifacts/bin/Microsoft.NETCore.Platforms/runtime.json is used, which does contain ubuntu20.04-s390x (but not rhel.8-s390x -- which is presumably because it only adds the relevant RIDs for the host system).

    This is turn seems to be because of this line in src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj:

        <!-- When building from source, ensure the RID we're building for is part of the RID graph -->
        <AdditionalRuntimeIdentifiers Condition="'$(DotNetBuildFromSource)' == 'true'">$(AdditionalRuntimeIdentifiers);$(OutputRID)</AdditionalRuntimeIdentifiers>
    

    which causes the runtime.json file to be rebuilt only in source-build mode.

    Now, this makes me wonder if this is correct condition: maybe instead of checking for source-build mode, we should add the identifier whenever building in non-portable mode here?

    However, even so, this still doesn't explain why this does not work correctly in the RHEL RPM build, which does use source-build ...

  10. omajid commented on Nov 30, 2022

    @omajid
    Member

    cc @tmds who recently touched BundledRuntimeIdentifierGraphFile. Tom, does this look like anything you are already aware of?

  11. tmds commented on Nov 30, 2022

    @tmds
    Member

    I expect the runtimes section to be present in the Microsoft.NETCore.App.deps.json file that ships with our source-built sdks. Can you check the file at <DOTNET_ROOT>/shared/Microsoft.NETCore.App/7.0.0/Microsoft.NETCore.App.deps.json?

  12. omajid commented on Nov 30, 2022

    @omajid
    Member

    It's not there:

    $ uname -m
    s390x
    $ grep runtime /usr/lib64/dotnet/shared/Microsoft.NETCore.App/7.0.0/Microsoft.NETCore.App.deps.json 
      "runtimeTarget": {
            "runtime": {
          "path": "microsoft.netcore.app.runtime.rhel.8-s390x/7.0.0"
    
  13. omajid commented on Nov 30, 2022

    @omajid
    Member

    My current thinking is that 7.0.0 was missing #78395, which means the runtime.json graph didn't contain the target build RID for s390x/ppc64le and so arcade would filter through runtime.json and produce an empty runtime graph?

  14. 2 remaining items

  15. uweigand commented on Nov 30, 2022

    @uweigand
    Contributor

    My current thinking is that 7.0.0 was missing #78395, which means the runtime.json graph didn't contain the target build RID for s390x/ppc64le and so arcade would filter through runtime.json and produce an empty runtime graph?

    Looks like the .NET 6 RPMs also completely lack the "runtimes" section in Microsoft.NETCore.App.deps.json - we apparently never noticed this problem earlier.

  16. tmds commented on Dec 1, 2022

    @tmds
    Member

    Looks like the .NET 6 RPMs also completely lack the "runtimes" section in Microsoft.NETCore.App.deps.json - we apparently never noticed this problem earlier.

    Often rids are used to contain architecture specific artifacts, which wouldn't be available for s390x anyway.
    In this case, the rid graph is used to fall back to the non-architecture specific linux rid.

    The changes that are in #78395 were backported by @ayakael to 6.0.
    The runtimes section should also appear on the next build of 6.0.

  17. uweigand commented on Dec 1, 2022

    @uweigand
    Contributor

    The changes that are in #78395 were backported by @ayakael to 6.0. The runtimes section should also appear on the next build of 6.0.

    Excellent, thanks!

  18. omajid commented on Dec 1, 2022

    @omajid
    Member

    To confirm that missing RIDs in the graph were the root cause of the issue, I manually added rhel.8-ppc64le and rhel.8-s390x RIDs to the rid graph and now the generated runtimes section looks okay:

    $ jq '.runtimes' /usr/lib64/dotnet/shared/Microsoft.NETCore.App/7.0.0/Microsoft.NETCore.App.deps.json 
    {
      "centos.8-s390x": [
        "centos.8",
        "centos-s390x",
        "rhel.8-s390x",
        "centos",
        "rhel.8",
        "rhel-s390x",
        "rhel",
        "linux-s390x",
        "linux",
        "unix-s390x",
        "unix",
        "any",
        "base"
      ],
      "rhel.8-s390x": [
        "rhel.8",
        "rhel-s390x",
        "rhel",
        "linux-s390x",
        "linux",
        "unix-s390x",
        "unix",
        "any",
        "base"
      ],
      "rhel.8.0-s390x": [
        "rhel.8.0",
        "rhel.8-s390x",
        "rhel.8",
        "rhel-s390x",
        "rhel",
        "linux-s390x",
        "linux",
        "unix-s390x",
        "unix",
        "any",
        "base"
      ],
      "rhel.8.1-s390x": [
        "rhel.8.1",
        "rhel.8.0-s390x",
        "rhel.8.0",
        "rhel.8-s390x",
        "rhel.8",
        "rhel-s390x",
        "rhel",
        "linux-s390x",
        "linux",
        "unix-s390x",
        "unix",
        "any",
        "base"
      ]
    }
    
  19. omajid commented on Dec 1, 2022

    @omajid
    Member

    I am trying to apply #78395 on top of 7.0.0 (along with the other patch files at https://gitlab.com/redhat/centos-stream/rpms/dotnet7.0/), and running into a build issue while building runtime as part of source-build. runtime-portable builds fine, it's just runtime that fails.

      Running command:
        /builddir/build/BUILD/dotnet-v7.0.100/src/runtime/build.sh  --ci --configuration Release --restore --build --pack --publish -bl /p:ArcadeBuildFromSource=true /p:CopyWipIntoInnerSourceBuildRepo=true /p:DotNetBuildOffline=true /p:CopySrcInsteadOfClone=true /p:DotNetPackageVersionPropsPath="/builddir/build/BUILD/dotnet-v7.0.100/artifacts/obj/x64/Release/PackageVersions.props" /p:AdditionalSourceBuiltNupkgCacheDir="/builddir/build/BUILD/dotnet-v7.0.100/artifacts/obj/x64/Release/blob-feed/packages/" /p:ReferencePackageNupkgCacheDir="/builddir/build/BUILD/dotnet-v7.0.100/packages/reference/" /p:PreviouslySourceBuiltNupkgCacheDir="/builddir/build/BUILD/dotnet-v7.0.100/packages/previously-source-built/" /p:SourceBuildUseMonoRuntime=false /p:TargetRid=rhel.8-x64 /p:SourceBuildNonPortable=true  /p:DotNetPackageVersionPropsPath=/builddir/build/BUILD/dotnet-v7.0.100/artifacts/obj/x64/Release/PackageVersions.props /p:DotNetRestoreSourcePropsPath=/builddir/build/BUILD/dotnet-v7.0.100/artifacts/obj/x64/Release/RestoreSources.props /p:DotNetBuildOffline=true
        Log: /builddir/build/BUILD/dotnet-v7.0.100/artifacts/logs/runtime.log
        With Environment Variables:
          DotNetBuildFromSource=true
          DotNetBuildFromSourceFlavor=Product
          DotNetPackageVersionPropsPath=/builddir/build/BUILD/dotnet-v7.0.100/artifacts/obj/x64/Release/PackageVersions.props
          DotNetRestorePackagesPath=/builddir/build/BUILD/dotnet-v7.0.100/packages/restored/
          DotNetBuildOffline=true
          AddDotnetfeedProjectSource=false
          DOTNET_INSTALL_DIR=/builddir/build/BUILD/dotnet-v7.0.100/previously-built-dotnet/
          DOTNET_PATH=/builddir/build/BUILD/dotnet-v7.0.100/previously-built-dotnet/
          DOTNET_HOST_PATH=/builddir/build/BUILD/dotnet-v7.0.100/previously-built-dotnet/dotnet
          _InitializeDotNetCli=/builddir/build/BUILD/dotnet-v7.0.100/previously-built-dotnet/
          _DotNetInstallDir=/builddir/build/BUILD/dotnet-v7.0.100/previously-built-dotnet/
          _InitializeToolset=/builddir/build/BUILD/dotnet-v7.0.100/Tools/source-built/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj
          _OverrideArcadeInitializeBuildToolFramework=net7.0
          DotNetUseShippingVersions=true
          PreReleaseVersionLabel=
          PackageVersionStamp=
          PB_VersionStamp=
          ContinuousIntegrationBuild=true
          MSBUILDDISABLENODEREUSE=1
          OfficialBuildId=20221022.1
          BUILD_BUILDNUMBER=20221022.1
          GitCommitCount=
          GitCommitHash=d099f075e45d2aa6007a22b71b45a08758559f80
          GitInfoCommitHash=d099f075e45d2aa6007a22b71b45a08758559f80
          SourceRevisionId=d099f075e45d2aa6007a22b71b45a08758559f80
          RepositoryCommit=d099f075e45d2aa6007a22b71b45a08758559f80
          COMMIT_SHA=d099f075e45d2aa6007a22b71b45a08758559f80
          GIT_COMMIT=d099f075e45d2aa6007a22b71b45a08758559f80
          RepositoryType=Git
          DeterministicSourcePaths=true
          SourceRoot=/builddir/build/BUILD/dotnet-v7.0.100/src/runtime/
          BuildInParallel=false
          LatestCommit=d099f075e45d2aa6007a22b71b45a08758559f80
          SOURCE_BUILT_SDK_ID_ARCADE=Microsoft.DotNet.Arcade.Sdk
          SOURCE_BUILT_SDK_ID_ARCADE_PACKAGING=Microsoft.DotNet.Build.Tasks.Packaging
          SOURCE_BUILT_SDK_ID_ARCADE_TGT_FX=Microsoft.DotNet.Build.Tasks.TargetFramework
          SOURCE_BUILT_SDK_ID_ARCADE_SHARED_FX_SDK=Microsoft.DotNet.SharedFramework.Sdk
          SOURCE_BUILT_SDK_VERSION_ARCADE=7.0.0-beta.22513.4
          SOURCE_BUILT_SDK_VERSION_ARCADE_PACKAGING=7.0.0-beta.22513.4
          SOURCE_BUILT_SDK_VERSION_ARCADE_TGT_FX=7.0.0-beta.22513.4
          SOURCE_BUILT_SDK_VERSION_ARCADE_SHARED_FX_SDK=7.0.0-beta.22513.4
          SOURCE_BUILT_SDK_DIR_ARCADE=/builddir/build/BUILD/dotnet-v7.0.100/Tools/source-built/Microsoft.DotNet.Arcade.Sdk/
          SOURCE_BUILT_SDK_DIR_ARCADE_PACKAGING=/builddir/build/BUILD/dotnet-v7.0.100/Tools/source-built/Microsoft.DotNet.Build.Tasks.Packaging/
          SOURCE_BUILT_SDK_DIR_ARCADE_TGT_FX=/builddir/build/BUILD/dotnet-v7.0.100/Tools/source-built/Microsoft.DotNet.Build.Tasks.TargetFramework/
          SOURCE_BUILT_SDK_DIR_ARCADE_SHARED_FX_SDK=/builddir/build/BUILD/dotnet-v7.0.100/Tools/source-built/Microsoft.DotNet.SharedFramework.Sdk/
    RepoBuild:
      /builddir/build/BUILD/dotnet-v7.0.100/src/runtime/build.sh  --ci --configuration Release --restore --build --pack --publish -bl /p:ArcadeBuildFromSource=true /p:CopyWipIntoInnerSourceBuildRepo=true /p:DotNetBuildOffline=true /p:CopySrcInsteadOfClone=true /p:DotNetPackageVersionPropsPath="/builddir/build/BUILD/dotnet-v7.0.100/artifacts/obj/x64/Release/PackageVersions.props" /p:AdditionalSourceBuiltNupkgCacheDir="/builddir/build/BUILD/dotnet-v7.0.100/artifacts/obj/x64/Release/blob-feed/packages/" /p:ReferencePackageNupkgCacheDir="/builddir/build/BUILD/dotnet-v7.0.100/packages/reference/" /p:PreviouslySourceBuiltNupkgCacheDir="/builddir/build/BUILD/dotnet-v7.0.100/packages/previously-source-built/" /p:SourceBuildUseMonoRuntime=false /p:TargetRid=rhel.8-x64 /p:SourceBuildNonPortable=true  /p:DotNetPackageVersionPropsPath=/builddir/build/BUILD/dotnet-v7.0.100/artifacts/obj/x64/Release/PackageVersions.props /p:DotNetRestoreSourcePropsPath=/builddir/build/BUILD/dotnet-v7.0.100/artifacts/obj/x64/Release/RestoreSources.props /p:DotNetBuildOffline=true 
      __DistroRid: linux-x64
      ##vso[task.setvariable variable=Artifacts;isSecret=false;isOutput=true]/builddir/build/BUILD/dotnet-v7.0.100/src/runtime/artifacts
      ##vso[task.setvariable variable=Artifacts.Toolset;isSecret=false;isOutput=true]/builddir/build/BUILD/dotnet-v7.0.100/src/runtime/artifacts/toolset
      ##vso[task.setvariable variable=Artifacts.Log;isSecret=false;isOutput=true]/builddir/build/BUILD/dotnet-v7.0.100/src/runtime/artifacts/log/Release
      ##vso[task.setvariable variable=Temp;isSecret=false;isOutput=true]/builddir/build/BUILD/dotnet-v7.0.100/src/runtime/artifacts/tmp/Release
      ##vso[task.setvariable variable=TMP;isSecret=false;isOutput=true]/builddir/build/BUILD/dotnet-v7.0.100/src/runtime/artifacts/tmp/Release
      ##vso[task.setvariable variable=NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS;isSecret=false;isOutput=true]20
      ##vso[task.setvariable variable=NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS;isSecret=false;isOutput=true]20
      ##vso[task.setvariable variable=NUGET_ENABLE_EXPERIMENTAL_HTTP_RETRY;isSecret=false;isOutput=true]true
      ##vso[task.setvariable variable=NUGET_EXPERIMENTAL_MAX_NETWORK_TRY_COUNT;isSecret=false;isOutput=true]6
      ##vso[task.setvariable variable=NUGET_EXPERIMENTAL_NETWORK_RETRY_DELAY_MILLISECONDS;isSecret=false;isOutput=true]1000
      /builddir/build/BUILD/dotnet-v7.0.100/previously-built-dotnet/sdk/7.0.100/MSBuild.dll /nologo -logger:/builddir/build/BUILD/dotnet-v7.0.100/Tools/source-built/Microsoft.DotNet.Arcade.Sdk/tools/net7.0/Microsoft.DotNet.ArcadeLogging.dll -maxcpucount /m -verbosity:m /v:minimal /bl:/builddir/build/BUILD/dotnet-v7.0.100/src/runtime/artifacts/log/Release/Build.binlog /clp:Summary /nr:false /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=true /p:Configuration=Release /p:RepoRoot=/builddir/build/BUILD/dotnet-v7.0.100/src/runtime// /p:Restore=true /p:Build=true /p:ArcadeBuildFromSource=false /p:Rebuild=false /p:Test=false /p:Pack=true /p:IntegrationTest=false /p:PerformanceTest=false /p:Sign=false /p:Publish=true /p:TargetArchitecture=x64 /p:BuildArchitecture=x64 /p:CMakeArgs= /p:ArcadeBuildFromSource=true /p:CopyWipIntoInnerSourceBuildRepo=true /p:DotNetBuildOffline=true /p:CopySrcInsteadOfClone=true /p:DotNetPackageVersionPropsPath=/builddir/build/BUILD/dotnet-v7.0.100/artifacts/obj/x64/Release/PackageVersions.props /p:AdditionalSourceBuiltNupkgCacheDir=/builddir/build/BUILD/dotnet-v7.0.100/artifacts/obj/x64/Release/blob-feed/packages/ /p:ReferencePackageNupkgCacheDir=/builddir/build/BUILD/dotnet-v7.0.100/packages/reference/ /p:PreviouslySourceBuiltNupkgCacheDir=/builddir/build/BUILD/dotnet-v7.0.100/packages/previously-source-built/ /p:SourceBuildUseMonoRuntime=false /p:TargetRid=rhel.8-x64 /p:SourceBuildNonPortable=true /p:DotNetPackageVersionPropsPath=/builddir/build/BUILD/dotnet-v7.0.100/artifacts/obj/x64/Release/PackageVersions.props /p:DotNetRestoreSourcePropsPath=/builddir/build/BUILD/dotnet-v7.0.100/artifacts/obj/x64/Release/RestoreSources.props /p:DotNetBuildOffline=true /warnaserror /builddir/build/BUILD/dotnet-v7.0.100/Tools/source-built/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj
        __DistroRid: rhel.8-x64
    ...
         Optimizing assemblies for size. This process might take a while.
        /builddir/build/BUILD/dotnet-v7.0.100/previously-built-dotnet/sdk/7.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(301,5): error NETSDK1095: Optimizing assemblies for performance is not supported for the selected target platform or architecture. Please verify you are using a supported runtime identifier, or set the PublishReadyToRun property to false. [/builddir/build/BUILD/dotnet-v7.0.100/src/runtime/artifacts/source-build/self/src/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj]
    

    Any ideas @tmds ? Am I missing another fix in 7.0?

    If I can't backport the PR itself, I suppose we will have to wait until a future 7.0 release to pick up the fix?

  20. tmds commented on Dec 1, 2022

    @tmds
    Member

    You need the complete set of patches which is the list here: dotnet/installer#14549 (comment). All of these have been backported to 7.0 for the next release.

    And two PRs for installer which have not been backported yet to 7.0: dotnet/installer#14549 and dotnet/installer#14938.

  21. akoeplinger commented on Dec 6, 2022

    @akoeplinger
    Member

    It looks like the issue is not related to System.Data.Odbc and we can close the issue right?

  22. janani66 commented on Dec 6, 2022

    @janani66
    Author

    Yes we can close this issue

  23. ghost removed
    untriaged
    on Dec 6, 2022
  24. ghost locked as resolved and limited conversation to collaborators on Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Dataos-linux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions