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

Mercurial cache doesn't work if master and slave run on different OS

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • mercurial-plugin
    • None
    • Mixed Linux/Windows

      To be able to use Mercurial caching, one has to define a Mercurial installation and enable caching there. In case master and slave use a different OS, creating the cache clone on the master fails, simply because it's Linux and can't find C:\Program Files\TortoiseHg\hg.exe.

      Therefor, enabling caching shouldn't be bound to specific mercurial installations. Instead, it should be a global option, maybe overridable at job level.

          [JENKINS-17649] Mercurial cache doesn't work if master and slave run on different OS

          Jesse Glick added a comment -

          I think the way around this is to not define the Mercurial location in the installation itself, but as a node property, so that the actual path varies according to what computer is running the command. Have not prototyped that to confirm it but IIRC this should work.

          The better solution in the longer term is to add automatic installers that download well-known ports according to local platform (OS/arch/etc.). This is mainly hampered by the complexity of interaction with Python ports and native extensions. I have not looked recently at whether Jython has matured to the point where it can (efficiently) run Mercurial, which would be by the far the most convenient option.

          Jesse Glick added a comment - I think the way around this is to not define the Mercurial location in the installation itself, but as a node property, so that the actual path varies according to what computer is running the command. Have not prototyped that to confirm it but IIRC this should work. The better solution in the longer term is to add automatic installers that download well-known ports according to local platform (OS/arch/etc.). This is mainly hampered by the complexity of interaction with Python ports and native extensions. I have not looked recently at whether Jython has matured to the point where it can (efficiently) run Mercurial, which would be by the far the most convenient option.

          Dirk Heinrichs added a comment - - edited

          Workaround works fine.

          Just curious: Why is the cache created on the master AND the slave(s)? Wouldn't it be sufficient to have it only on the master?

          Dirk Heinrichs added a comment - - edited Workaround works fine. Just curious: Why is the cache created on the master AND the slave(s)? Wouldn't it be sufficient to have it only on the master?

          Jesse Glick added a comment -

          The cache is copied to slaves in case multiple workspaces on a given slave are based off the same repository, as can happen for parallelizable builds or simply when you are building lots of branches of a project. Otherwise they could not share storage.

          Jesse Glick added a comment - The cache is copied to slaves in case multiple workspaces on a given slave are based off the same repository, as can happen for parallelizable builds or simply when you are building lots of branches of a project. Otherwise they could not share storage.

          Ah, OK. Thank you for the clarification.

          Dirk Heinrichs added a comment - Ah, OK. Thank you for the clarification.

            jglick Jesse Glick
            dhs Dirk Heinrichs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: