Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-23134

Mixed separators fail for Linux paths

    Details

    • Similar Issues:

      Description

      Apparently a separator fix for latest version (2.11.1) broke how paths are built, and this leads to failed builds on Linux slaves.

      2.10:
      [android] Ensuring platform(s) are installed: [android-8, android-19]
      $ /home/jenkins/android-sdk-linux/tools/android list target

      2.11.1:
      [android] Ensuring platform(s) are installed: [android-8, android-19]
      $ /home/jenkins/android-sdk-linux\tools\android list target
      FATAL: Cannot run program "/home/jenkins/android-sdk-linux\tools\android": error=2, No such file or directory
      java.io.IOException: Cannot run program "/home/jenkins/android-sdk-linux\tools\android": error=2, No such file or directory

        Attachments

          Issue Links

            Activity

            cowst Diego Costantini created issue -
            Hide
            cowst Diego Costantini added a comment -

            Hi,
            any word on this?

            I am currently stuck because latest won't work on my linux slaves without this regression fixed, while the old version doesn't work anymore since Google introduced brackets in their image names :/
            id: 16 or "Google Inc.:Google APIs (x86 System Image):19"
            Name: Google APIs (x86 System Image)
            When creating a new image of course the file system doesn't allow brackets. Is new version able to cope with that btw?

            Show
            cowst Diego Costantini added a comment - Hi, any word on this? I am currently stuck because latest won't work on my linux slaves without this regression fixed, while the old version doesn't work anymore since Google introduced brackets in their image names :/ id: 16 or "Google Inc.:Google APIs (x86 System Image):19" Name: Google APIs (x86 System Image) When creating a new image of course the file system doesn't allow brackets. Is new version able to cope with that btw?
            Hide
            cowst Diego Costantini added a comment -

            I think the problem has been introduced long ago (short after 2.10 release) in this commit:
            https://github.com/jenkinsci/android-emulator-plugin/commit/d49096f96884b9ac405c988afa32f467de750d82

            Before, the slashes were hardcoded, now apparently somewhere File.separator returns backslashes, but I couldn't find where, and I don't have the environment to try to debug it myself.

            Show
            cowst Diego Costantini added a comment - I think the problem has been introduced long ago (short after 2.10 release) in this commit: https://github.com/jenkinsci/android-emulator-plugin/commit/d49096f96884b9ac405c988afa32f467de750d82 Before, the slashes were hardcoded, now apparently somewhere File.separator returns backslashes, but I couldn't find where, and I don't have the environment to try to debug it myself.
            Hide
            cowst Diego Costantini added a comment -

            I worked around the issue by rolling back some line to hardcoded slashes, but before doing that, I saw that tests (on the plugin code) with slashes on Windows fail.
            I supposed they were performed only on Linux (or Mac), nevertheless, I don't know why on my Linux slaves I get backslashes...

            Show
            cowst Diego Costantini added a comment - I worked around the issue by rolling back some line to hardcoded slashes, but before doing that, I saw that tests (on the plugin code) with slashes on Windows fail. I supposed they were performed only on Linux (or Mac), nevertheless, I don't know why on my Linux slaves I get backslashes...
            Hide
            barakwei Barak Weiss added a comment -

            I have the same problem. When I run the groovy script "println File.separator" it prints the correct slash. How's that possible?

            Show
            barakwei Barak Weiss added a comment - I have the same problem. When I run the groovy script "println File.separator" it prints the correct slash. How's that possible?
            Hide
            jhcohen Josh Cohen added a comment -

            Was anyone able to resolve this issue? This is a big problem for the tests running on my Linux slaves.

            Show
            jhcohen Josh Cohen added a comment - Was anyone able to resolve this issue? This is a big problem for the tests running on my Linux slaves.
            Hide
            orrc Christopher Orr added a comment -

            I haven't been able to reproduce this problem so far.

            For people having this issue, what OS is the master running on, and where are builds running? If on separate slaves, which OS are they using?

            Show
            orrc Christopher Orr added a comment - I haven't been able to reproduce this problem so far. For people having this issue, what OS is the master running on, and where are builds running? If on separate slaves, which OS are they using?
            Hide
            jhcohen Josh Cohen added a comment -

            The master is running Windows, and I have two slaves (one Linux and one Mac OSX) running builds.

            Show
            jhcohen Josh Cohen added a comment - The master is running Windows, and I have two slaves (one Linux and one Mac OSX) running builds.
            Hide
            cowst Diego Costantini added a comment -

            Windows master, 2 Ubuntu slaves.

            Show
            cowst Diego Costantini added a comment - Windows master, 2 Ubuntu slaves.
            Hide
            cowst Diego Costantini added a comment -

            I rebuilt with some ugly temporary fix just to get going.
            If you are interested until a proper fix is out, here they are:
            https://github.com/cowst/android-emulator-plugin/tree/slash-workaround

            Show
            cowst Diego Costantini added a comment - I rebuilt with some ugly temporary fix just to get going. If you are interested until a proper fix is out, here they are: https://github.com/cowst/android-emulator-plugin/tree/slash-workaround
            orrc Christopher Orr made changes -
            Field Original Value New Value
            Link This issue is duplicated by JENKINS-23346 [ JENKINS-23346 ]
            orrc Christopher Orr made changes -
            Link This issue is duplicated by JENKINS-24956 [ JENKINS-24956 ]
            Hide
            orrc Christopher Orr added a comment -

            Sorry for the delay everyone.

            I'll get my hands on a Windows machine this week and get this fixed.

            Show
            orrc Christopher Orr added a comment - Sorry for the delay everyone. I'll get my hands on a Windows machine this week and get this fixed.
            Hide
            xfreebird Nicolae Ghimbovschi added a comment -

            The same here with the latest Jenkins LTS version 1.580.1 and android-emulator-plugin version 2.12.
            It was fine with the previous version of android-emulator-plugin 2.10 and Jenkins LTS 1.565.1.
            The master is a windows and the slave is OS X.

            > git clean -fdx # timeout=10
            $ /opt/dailybuild/android/sdk\tools\android list target
            FATAL: Cannot run program "/opt/dailybuild/android/sdk\tools\android": error=2, No such file or directory
            java.io.IOException: Cannot run program "/opt/dailybuild/android/sdk\tools\android": error=2, No such file or directory

            Show
            xfreebird Nicolae Ghimbovschi added a comment - The same here with the latest Jenkins LTS version 1.580.1 and android-emulator-plugin version 2.12. It was fine with the previous version of android-emulator-plugin 2.10 and Jenkins LTS 1.565.1. The master is a windows and the slave is OS X. > git clean -fdx # timeout=10 $ /opt/dailybuild/android/sdk\tools\android list target FATAL: Cannot run program "/opt/dailybuild/android/sdk\tools\android": error=2, No such file or directory java.io.IOException: Cannot run program "/opt/dailybuild/android/sdk\tools\android": error=2, No such file or directory
            Hide
            xfreebird Nicolae Ghimbovschi added a comment - - edited

            Also, adb -s emulator-5834 shell getprop dev.bootcomplete does not work on OSX.
            It works only with adb connect localhost:5834

            Show
            xfreebird Nicolae Ghimbovschi added a comment - - edited Also, adb -s emulator-5834 shell getprop dev.bootcomplete does not work on OSX. It works only with adb connect localhost:5834
            Hide
            orrc Christopher Orr added a comment -

            So I did a terrible job of reviewing the code that caused this bug, and a terrible job of fixing it so far.

            I've been working on some other fixes and will do a release soon. So I will merge and test this pull request which should fix this issue: https://github.com/jenkinsci/android-emulator-plugin/pull/44

            Show
            orrc Christopher Orr added a comment - So I did a terrible job of reviewing the code that caused this bug, and a terrible job of fixing it so far. I've been working on some other fixes and will do a release soon. So I will merge and test this pull request which should fix this issue: https://github.com/jenkinsci/android-emulator-plugin/pull/44
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Dave Brown
            Path:
            src/main/java/hudson/plugins/android_emulator/sdk/DefaultToolLocator.java
            src/main/java/hudson/plugins/android_emulator/sdk/PlatformToolLocator.java
            http://jenkins-ci.org/commit/android-emulator-plugin/28f76bb7acfd96a16a1eb5626b2527ad9b96856f
            Log:
            JENKINS-23134 Replace File.separator with "/".

            When using this plugin on a Windows master delegating to a Unix slave
            File.separator resolves to "
            " resulting in erroneous paths.

            Signed-off-by: Dave Brown <d.brown@bigdavedev.com>

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Dave Brown Path: src/main/java/hudson/plugins/android_emulator/sdk/DefaultToolLocator.java src/main/java/hudson/plugins/android_emulator/sdk/PlatformToolLocator.java http://jenkins-ci.org/commit/android-emulator-plugin/28f76bb7acfd96a16a1eb5626b2527ad9b96856f Log: JENKINS-23134 Replace File.separator with "/". When using this plugin on a Windows master delegating to a Unix slave File.separator resolves to " " resulting in erroneous paths. Signed-off-by: Dave Brown <d.brown@bigdavedev.com>
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Christopher Orr
            Path:
            src/main/java/hudson/plugins/android_emulator/sdk/DefaultToolLocator.java
            src/main/java/hudson/plugins/android_emulator/sdk/PlatformToolLocator.java
            http://jenkins-ci.org/commit/android-emulator-plugin/98d2a53130cb7165b80e08b2496822ec20bbda68
            Log:
            Merge pull request #44 from bigdavedev/master

            [FIXED JENKINS-23134] Replace File.separator with "/".

            Fixes inability to launch Android tools on Unix slaves from a Windows master.

            Compare: https://github.com/jenkinsci/android-emulator-plugin/compare/a0589ce14556...98d2a53130cb

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christopher Orr Path: src/main/java/hudson/plugins/android_emulator/sdk/DefaultToolLocator.java src/main/java/hudson/plugins/android_emulator/sdk/PlatformToolLocator.java http://jenkins-ci.org/commit/android-emulator-plugin/98d2a53130cb7165b80e08b2496822ec20bbda68 Log: Merge pull request #44 from bigdavedev/master [FIXED JENKINS-23134] Replace File.separator with "/". Fixes inability to launch Android tools on Unix slaves from a Windows master. Compare: https://github.com/jenkinsci/android-emulator-plugin/compare/a0589ce14556...98d2a53130cb
            scm_issue_link SCM/JIRA link daemon made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            wearbif wearbif made changes -
            Link This issue is duplicated by JENKINS-27072 [ JENKINS-27072 ]
            Hide
            orrc Christopher Orr added a comment -

            Version 2.13 of the plugin has been released, which includes this fix.

            Show
            orrc Christopher Orr added a comment - Version 2.13 of the plugin has been released, which includes this fix.
            orrc Christopher Orr made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 155467 ] JNJira + In-Review [ 207728 ]

              People

              • Assignee:
                orrc Christopher Orr
                Reporter:
                cowst Diego Costantini
              • Votes:
                8 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: