Skip to content

[JENKINS-25783] very long build directory paths are created by Matrix project, and difficult directcory names #593

Closed

Description

@jenkins-infra-bot

Originally reported by rickybobpat, imported from: very long build directory paths are created by Matrix project, and difficult directcory names
  • status: Resolved
  • priority: Minor
  • component(s): matrix-project-plugin
  • label(s): jenkins, plugin
  • resolution: Duplicate
  • resolved: 2017-06-09T14:12:43+00:00
  • votes: 5
  • watchers: 5
  • imported: 2025-12-06
  • environment: Jenkins 1.576, Matrix Plugin: 1.4, windows, Unix.

Activity

  1. jenkins-infra-bot commented on Nov 25, 2014

    @jenkins-infra-bot
    Author
    danielbeck:
    • Comment link
    • Original comment link (no redirect)
    • Raw content of original comment:

      (note to self: read first, then comment )

    (note to self: read first, then comment )

  2. jenkins-infra-bot commented on Feb 28, 2015

    @jenkins-infra-bot
    Author
    spikerjenk2:
    • Comment link
    • Original comment link (no redirect)
    • Raw content of original comment:

      Label expression axis can also create bad paths. If I have "label1&&label2" expression, the path then include /job/label1&&label2/...

      This makes for some nasty workarounds in shell scripts.

    Label expression axis can also create bad paths. If I have "label1&&label2" expression, the path then include /job/label1&&label2/...

    This makes for some nasty workarounds in shell scripts.

  3. jenkins-infra-bot commented on Feb 28, 2015

    @jenkins-infra-bot
    Author
    danielbeck:
    • Comment link
    • Original comment link (no redirect)
    • Raw content of original comment:

      spikerjenk2: Wouldn't it suffice to just consistently double-quote references to the folder? What specifically breaks?

    spikerjenk2: Wouldn't it suffice to just consistently double-quote references to the folder? What specifically breaks?

  4. jenkins-infra-bot commented on Feb 28, 2015

    @jenkins-infra-bot
    Author
    bachp:
    • Comment link
    • Original comment link (no redirect)
    • Raw content of original comment:

      You are right if the path was quoted correctly everywhere there would be no issue. However if you build a whole linux distribution with hundreds of third party packages it is very likely that some components get it wrong. To fix this is a huge effort and not possible to fix in the short term. So I also would appreciate an option that would allow to get more "standard" paths.

    You are right if the path was quoted correctly everywhere there would be no issue. However if you build a whole linux distribution with hundreds of third party packages it is very likely that some components get it wrong. To fix this is a huge effort and not possible to fix in the short term.
    So I also would appreciate an option that would allow to get more "standard" paths.

  5. jenkins-infra-bot commented on Feb 28, 2015

    @jenkins-infra-bot
    Author
    spikerjenk2:
    • Comment link
    • Original comment link (no redirect)
    • Raw content of original comment:

      @Daniel @Pascal

      The worst offender is python virtualenv. Wrapper scripts insert the shebang of the interpreter, which is in the workspace. So "myProg.py" would have

      #!/path/to/my/job/label1&&label2/venv/bin/python
      ...
      

      I unfortunately have to wrap everything in a shell script to re-write the shebang.

      I'd also like to add (most) linux kernels limit the shebang line to 127 characters, which is easily outdone with big matrix jobs.

    @​Daniel @​Pascal

    The worst offender is python virtualenv. Wrapper scripts insert the shebang of the interpreter, which is in the workspace. So "myProg.py" would have

    #!/path/to/my/job/label1&&label2/venv/bin/python
    ...
    

    I unfortunately have to wrap everything in a shell script to re-write the shebang.

    I'd also like to add (most) linux kernels limit the shebang line to 127 characters, which is easily outdone with big matrix jobs.

  6. jenkins-infra-bot commented on Feb 28, 2015

    @jenkins-infra-bot
    Author
    danielbeck:

    FWIW there's a global (Jenkins-wide) option to use short sub-workspace paths for matrix projects: hudson.matrix.MatrixConfiguration.useShortWorkspaceName

    More information on:
    https://wiki.jenkins-ci.org/display/JENKINS/Features+controlled+by+system+properties

  7. jenkins-infra-bot commented on Mar 7, 2015

    @jenkins-infra-bot
    Author
    ringerc:
    • Comment link
    • Original comment link (no redirect)
    • Raw content of original comment:

      Daniel, very useful hint. Thankyou. The applicability of that property sure isn't limited to Cygwin.

      Some Windows kernels have bugs relating to deep paths (well short of the official path limit). I've had to abbreviate all my labels to get things to work, and even then it's troublesome.

      On *nix, label expressions containing shell metacharacters are "fun". Yes, everything should be carefully quoted. It's a pain when you're working with things like third party shell script snippets in configure scripts though.

      Some form of mapping would be very helpful. Or at least exposing this as an advanced matrix build option instead of a system property.

    Daniel, very useful hint. Thankyou. The applicability of that property sure isn't limited to Cygwin.

    Some Windows kernels have bugs relating to deep paths (well short of the official path limit). I've had to abbreviate all my labels to get things to work, and even then it's troublesome.

    On *nix, label expressions containing shell metacharacters are "fun". Yes, everything should be carefully quoted. It's a pain when you're working with things like third party shell script snippets in configure scripts though.

    Some form of mapping would be very helpful. Or at least exposing this as an advanced matrix build option instead of a system property.

  8. jenkins-infra-bot commented on Jun 9, 2017

    @jenkins-infra-bot
    Author
    jglick:

    Better solved more generically, as in JENKINS-30148.

  9. jenkins-infra-bot commented on Dec 6, 2025

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-30148]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions