Uploaded image for project: 'NPanday'
  1. NPanday
  2. NPANDAY-409

Executable path ignored during command execution while building NPanday on Linux

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4-incubating
    • 1.5.0-incubating
    • Maven Plugins

    Description

      Checked out NPanday trunk r1095141 on Linux and applied the following patches.
      o NPANDAY-400
      o NPANDAY-402
      o NPANDAY-407 (new)

      The ~/.m2/npanday-settings.xml file looks like this:

      <npandaySettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <operatingSystem>linux 2.6.35-28-generic</operatingSystem>
        <defaultSetup>
          <vendorName>MONO</vendorName>
          <vendorVersion>2.0.50727</vendorVersion>
          <frameworkVersion>2.0.50727</frameworkVersion>
        </defaultSetup>
        <vendors>
          <vendor>
            <vendorName>MONO</vendorName>
            <vendorVersion>2.0.50727</vendorVersion>
            <frameworks>
              <framework>
                <frameworkVersion>2.0.50727</frameworkVersion>
                <installRoot>/usr/lib/mono/2.0</installRoot>
              </framework>
            </frameworks>
          </vendor>
        </vendors>
      </npandaySettings>
      

      When attempting to build on Linux, the error trace below is displayed trying to execute "xsd" and the build fails.

      [INFO] NPANDAY-070-003: Found executable path for xsd: /usr/lib/mono/2.0
      [INFO] Cannot open assembly '/usr/lib/mono/1.0/xsd.exe': No such file or directory.
      [DEBUG] NPANDAY-040-000: Executed command: Commandline = /bin/sh -c cd /usr/lib/mono/2.0 && xsd /home/jfallows/Workspaces/npanday-trunk/dotnet/assemblies/NPanday.Model.Pom/Pom.xsd /o:/home/jfallows/Workspaces/npanday-trunk/dotnet/assemblies/NPanday.Model.Pom/target/build-sources /classes /language:CS /namespace:NPanday.Model.Pom, Result = 2
      [INFO] NPANDAY-070-003: Found executable path for xsd: /usr/lib/mono/2.0
      [INFO] NPANDAY-070-003: Found executable path for xsd: /usr/lib/mono/2.0
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] NPANDAY-1400-000: Unable to execute xsd: Vendor null, frameworkVersion = 2.0.50727, Profile = XSD:SCHEMA

      Embedded error: NPANDAY-070-000: Execution Path = /usr/lib/mono/2.0, Command = [/home/jfallows/Workspaces/npanday-trunk/dotnet/assemblies/NPanday.Model.Pom/Pom.xsd, /o:/home/jfallows/Workspaces/npanday-trunk/dotnet/assemblies/NPanday.Model.Pom/target/build-sources, /classes, /language:CS, /namespace:NPanday.Model.Pom]
      NPANDAY-040-001: Could not execute: Command = /bin/sh -c cd /usr/lib/mono/2.0 && xsd /home/jfallows/Workspaces/npanday-trunk/dotnet/assemblies/NPanday.Model.Pom/Pom.xsd /o:/home/jfallows/Workspaces/npanday-trunk/dotnet/assemblies/NPanday.Model.Pom/target/build-sources /classes /language:CS /namespace:NPanday.Model.Pom, Result = 2

      The executable that should be used is /usr/lib/mono/2.0/xsd.exe, and it is correctly located in the executable paths.

      Notice that the shell commands "cd /usr/lib/mono/2.0 && xsd" would not execute /usr/lib/mono/2.0/xsd.exe on Linux.

      Conversely, on Windows, the current directory is searched first on the path by default, and the .exe extension can be omitted, which is why this has not shown up as an issue thus far on Windows. On Linux, the default path contains executables such as /usr/bin/gmcs which force a specific version of the Mono runtime to be used, such as 2.0 shown below.

      #!/bin/sh
      exec /usr/bin/mono $MONO_OPTIONS /usr/lib/mono/2.0/gmcs.exe "$@"

      In this case, my /usr/bin/xsd was pointing explicitly at Mono 1.0 unexpectedly, leading to the discovery of this issue.

      If the intent is to support targeting multiple different Mono runtimes for different projects by using executable paths in npanday-settings.xml, then it is necessary to use the fully qualified path complete with .exe extension on Linux.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jfallows John Robert Fallows
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: