Opened 6 years ago

Closed 5 years ago

#4846 closed defect (wontfix)

Make sure the Jenkins build script can patch itself

Reported by: Itms Owned by: Itms
Priority: Should Have Milestone:
Component: Build & Packages Keywords:
Cc: Patch:

Description (last modified by Itms)

Case in point: building Phab:D1026 failed with

build/jenkins/build-patch.sh: 69: cd: can't cd to build/workspaces/gcc

meaning that the unpatched version of the script was still being executed. As far as I know a script that modifies itself keeps track of the current position in the file, so I have to assume the issue comes from the patched code being higher in the file (line 69) than the place where the patching happens (line 102).

I don't see an obvious way to fix this so I'm opening this ticket for tracking future improvements. Suggestions are welcome as well :-)

Change History (5)

comment:1 by Itms, 6 years ago

Description: modified (diff)

comment:2 by leper, 6 years ago

As far as I know a script that modifies itself keeps track of the current position in the file

Bash tries somewhat hard to do that, however self-modifying code is just confusing and creating issues.

One could probably split that file into a few, then only load them when something is actually used. I wouldn't try to make the thing work when it is modified itself, that's just asking for pain.

The alternative would be to manually do the patching in such cases.

comment:3 by Itms, 6 years ago

In 20635:

Use premake5 during automated testing, after a few weeks of use in production.
Refs #4846.

comment:4 by Krinkle, 5 years ago

Is this still needed? I'm unable to find where the script tries to modify itself, or why that would be easier or needed to do something in CI.

in reply to:  4 comment:5 by Itms, 5 years ago

Cc: leper removed
Milestone: Backlog
Resolution: wontfix
Status: assignedclosed

Replying to Krinkle:

Is this still needed? I'm unable to find where the script tries to modify itself, or why that would be easier or needed to do something in CI.

No, I will close this as wontfix. What I am doing since I manage the CI is that I modify CI scripts manually and version them separately. By the way, I will soon update Phab:D1910 with the latest improvements to the CI.

Note: See TracTickets for help on using tickets.