RE: Building Liferay Portal from source code

thumbnail
Himanshu Bhandari, modified 5 Years ago. Regular Member Posts: 148 Join Date: 5/9/14 Recent Posts
Hello, I am trying to build Liferay portal from source on Windows 10 and following this tutorial at liferay.dev Portlal source I have cloned into D:\github\liferay\liferay-portal
Please find my queries:
  1. As mentioned I should clone liferay-binaries-cache-2017, but what I found on Liferay github repo is liferay-binaries-cache-2020 is also available. Should I go for 2020 or 2017 is still relevant? 
  2. Unable to execute command git checkout `cat ../bundles/.githash` -b my-custom-change, I am familiar with checkout but what `cat ../bundles/.githash` is trying to achieve is I am not sure.  I am able compile and get the folder 'bundles' and the file .githash as wellPS D:\github\liferay\liferay-portal> git checkout `cat ../bundles/.githash` -b my-custom-change
  3.               fatal: ../bundles/.githash -b: '../bundles/.githash -b' is outside repository
    Please let me know what can I do to resolve it.
    Thank you!
thumbnail
David H Nebinger, modified 5 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
The most important thing, this is NOT the way to customize Liferay. Whatever you are doing, I can guarantee 100% that you are doing it wrong, you are going to cost your company/client a lot of money because of this thing you are trying to do.

Hopefully there is someone on your team that will read this and realize that you are really, really on an incorrect path and has time to reign you in before this rolling train wreck gets totally out of control.

You should never be building from Master because it represents a work in progress. In the current case, it is in progress towards the 7.3 GA3 build, but it is not yet final so you absolutely will be dealing with a build that is not ready for production.

The cat on the githash is trying to check out a specific git revision as a branch named my-custom-change. You're failing because, for whatever reason (likely due to release or permissions or something) that git revision is not available to you.
thumbnail
Himanshu Bhandari, modified 5 Years ago. Regular Member Posts: 148 Join Date: 5/9/14 Recent Posts
Hi David,

Thanks for replying back, and I think you took me wrong. I didn't mean to build Liferay (that too master branch) to use in production, and I never said that in my question. My purpose was to contribute back to Liferay and wanted to (or at least try) to resolve some issues/bugs.

Thanks & Regards,

Himanshu
thumbnail
David H Nebinger, modified 5 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
As far as which cache to use, I have them both. The builds will go after the ones they want whether you are on 7.0 or 7.3 or any in between.

The whole checkout line is attempting to checkout a specific git commit as a new branch, my-custom-change. Your command is failing because the whole backtick thing with the cat command is not a windows-level command. Extract the hash from the file manually and insert it into the script in place of the `cat ...` part.
thumbnail
Himanshu Bhandari, modified 5 Years ago. Regular Member Posts: 148 Join Date: 5/9/14 Recent Posts
Thanks for help David, it is much clear now.