Pipeline issue trying to integrate unreal engine source in a p4 repository

Let me add context first:

We are trying to add the engine source to the project repository in P4. We were trying to set it up like explained in Setting up an Unreal Engine Studio the Epic Way | Tutorial as shown in the image below.

As we understand, the purpose of this is to have a child stream with the unaltered official engine code. We are supposed to drop the new engine version there, then copy to the merge branch, merge from main to merge branch, resovle the conflicts, and copy back to main. That would get us an updated engine version in main. Is this understanding correct?

The issue now:

Say we have an engine modified file in main, when we merge to merge branch it will conflict with the one copied from engine which we can resolve. However, if this changes were already resolved in the last engine update, and the files havn’t been touched further since, there will not be any conflict, thus letting the new engine version copy upwards without resolution, deleting our old changes.

How is this issue to be dealt with?

if this changes were already resolved in the last engine update, and the files havn’t been touched further since, there will not be any conflict, thus letting the new engine version copy upwards without resolution

I don’t think there is any problem here, it is designed like this, and your process also conforms to their pipeline.

That’s it.

Maybe I didn’t explain myself properly in the last part. Say we update to engine version 5.5 and we resolver a conflict where we had custom code in EngineCodeExample.cpp. Thats fine. Now we want to update to version 5.6, which 5.6 changed EnginceCodeExample.cpp again. However we haven’t made any new custom modifications to it since we upgraded to 5.5. Because there is no new modifications, there will be no conflict in the merge branch and 5.6 version will be copied upwards deleting all the custom modifications we added before updating to 5.5. I don’t believe this is the intended behavior. The whole point of the merge branch is to bring the newer engine version and merging it with the custom changes to the engine on the project.

Make sure your .uproject file and Engine source paths are correctly mapped in Perforce. Also, ensure file types like .uprojectdirs are not excluded by P4 ignore settings.

hi @acesanji ! I think I know your key point now.

A file is modified, then merged after resolving conflicts, and then overwritten by the official new file. This really shouldn’t be correct.

When you merge, you should choose merge instead of copy or integrate. Also, you cannot choose accept theirs (-at) when there is a conflict.

In short, if you have the specific commands or steps for your operation, it will be more helpful in solving the problem.

Hey @LeonCrazy thanks for the reply. If the file should never be overwritten by the official file, am I maybe misinterpreting how the setup explained in the added link is meant to function? As far as I understand from the epic guide and diagram, the official engine is meant to go on the last child stream, overwritten any time you bring a new version, then copied upwards towards the middle stream where it is merged with the actual project version engine. But this results in the explained issue. Is this not how the official engine part works? are we meant to handle any interaction differently?

There really isn’t any project specific details I can add here to make it more understandable since we are basically trying to mimic the epic guide setup 1 to 1 as to make it work.

I think we can understand it in another way. Maybe I don’t understand it correctly :sweat_smile:

I said the file should never be overwritten by the official file before , because I think that after the first merge, the official file should not overwrite the merged file the second time. But I want to correct this now. This process can be repeated. The key is Main stream is always there.

Let’s sort out the steps.

First the official file (dev_unreal_upstream) covers the dev_unreal_merge stream.
Then merge the Main into the dev_unreal_merge stream. The dev_unreal_merge stream contains both.
Finally copy up the dev_unreal_merge branch back to the main stream.

Hope this helps a little.