Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-2461

Daemon fails on < Win 7 if PATH env var is not set

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3-rc-1

      Description

      The daemon forces the PATH env var to be set. The following is an indicative trace:

      Caused by: org.gradle.internal.nativeplatform.NativeIntegrationException: Could not set environment variable 'PATH'. errno: 203
          at org.gradle.internal.nativeplatform.jna.WindowsProcessEnvironment.setNativeEnvironmentVariable(WindowsProcessEnvironment.java:33)
          at org.gradle.internal.nativeplatform.jna.WindowsProcessEnvironment.removeNativeEnvironmentVariable(WindowsProcessEnvironment.java:38)
          at org.gradle.internal.nativeplatform.jna.AbstractProcessEnvironment.removeEnvironmentVariable(AbstractProcessEnvironment.java:43)
          at org.gradle.internal.nativeplatform.jna.AbstractProcessEnvironment.maybeSetEnvironment(AbstractProcessEnvironment.java:34)
          at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:56)
          at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
      

      The line in question is:

      boolean retval = kernel32.SetEnvironmentVariable(name, value == null ? null : value);
      

      The problem appears to be that on early windows versions, passing a null value to this for an env var that is not set causing a 203 error code (ERROR_ENVVAR_NOT_FOUND) to be returned.

      I found this issue reported in the ruby project: http://bugs.ruby-lang.org/issues/3825

      Their solution was to ignore this particular error code when returned by this method.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            forums Gradle Forums
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: