Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NETBEANS-1671] Donation 3 - Include installer sources #1052

Merged
merged 38 commits into from
May 2, 2019

Conversation

rtaneja1
Copy link
Contributor

@rtaneja1 rtaneja1 commented Dec 18, 2018

This includes installer sources from http://bits.netbeans.org/download/apache-donation/ApacheNetBeansDonation3.zip
Also contains support for creating NetBeans-JDK (11.0.1) bundle.

Sample sh file for creating JDK bundle:


BASE_DIR=pwd
NB_ALL=$BASE_DIR
export BASE_DIR NB_ALL

DIST=$BASE_DIR/dist
export DIST

if [ -d $DIST ] ; then
rm -rf $DIST
fi

mkdir -p $DIST/zip/moduleclusters
mkdir -p $DIST/logs
cp /incubating-netbeans-10.0-vc3-bin.zip $DIST/zip/moduleclusters
NB_BUILD_NUMBER=
BASENAME_PREFIX=incubating-netbeans-10.0-vc3-bin
BUILD_DESC=$BASENAME_PREFIX
BUILDNUMBER=
DATESTAMP=$BUILDNUMBER
export BUILDNUMBER BASENAME_PREFIX NB_BUILD_NUMBER DATESTAMP BUILD_DESC
LOCALES=ja,zh_CN,pt_BR,ru
export LOCALES
#l10n repo not yet present in Apache github, part of Donation 3 zip
#cd ${BASE_DIR}
#if [ ! -d l10n ] ; then
#hg clone -r release82 http://hg.netbeans.org/releases/l10n
#else
#cd l10n
#hg pull -u -r release82
#fi
#JDK build location https://java.se.oracle.com/artifactory/re-release-local/jdk/11.0.1/13/bundles/
JDK11_BUILDS_PATH=artifactory/re-release-local/jdk/11.0.1/13/bundles/
export JDK7_BUILDS_PATH JDK8_BUILDS_PATH JDK11_BUILDS_PATH

#Bundled jvm hosted location, required for Linux and Windows bundles
BINARY_CACHE_HOST=
WTK_BUILDS_HOST=$BINARY_CACHE_HOST

export BINARY_CACHE_HOST
export WTK_BUILDS_HOST

MAC_SIGN_CLIENT=
MAC_SIGN_USER=
MAC_SIGN_GUID=
CODESIGNBUREAU_CREDFILE=

export MAC_SIGN_CLIENT
export MAC_SIGN_USER
export MAC_SIGN_GUID
export CODESIGNBUREAU_CREDFILE

NATIVE_MAC_MACHINE=@
MAC_PATH=
#uncomment for creating mac build on above machost
#export NATIVE_MAC_MACHINE
#export MAC_PATH

MAC_LOG_NEW=$DIST/logs/native_mac-$BUILDNUMBER.log
export MAC_LOG_NEW

BUILD_NETBEANS=0
BUILD_NBJDK6=0
BUILD_NBJDK7=0
BUILD_NBJDK8=0
BUILD_NBJDK11=1

export BUILD_NETBEANS
export BUILD_NBJDK6 BUILD_NBJDK7 BUILD_NBJDK8 BUILD_NBJDK11

#if it's empty => will be set windows,linux as default
BUNDLE_JDK_PLATFORM=
export BUNDLE_JDK_PLATFORM

OUTPUT_DIR=${NB_ALL}/dist/installers
export OUTPUT_DIR
DONT_SIGN_INSTALLER=y
export DONT_SIGN_INSTALLER
bash -x $NB_ALL/nbbuild/newbuild/build-nbi.sh


@geertjanw
Copy link
Member

Can you provide instructions for creating an installer without including a JDK, is that possible with this PR?

@rtaneja1
Copy link
Contributor Author

I think this will require some changes. It didn't work out of the box by just setting env property BUILD_NBJDK11=0. I will be able to investigate after I'm back next week.

@geertjanw
Copy link
Member

That would be excellent, thanks.

@dulaman
Copy link

dulaman commented Jan 1, 2019

Will be possible to create installer with AdoptOpenJDK builds?

@geertjanw
Copy link
Member

Good question. What's the license of AdoptOpenJDK? Well, here you can see it is based on OpenJDK, which is GPL, so no, it cannot be distributed from Apache in a bundle with NetBeans (though, I believe, it could bundle NetBeans with itself and distribute it): https://adoptopenjdk.net/about.html

@rtaneja1
Copy link
Contributor Author

rtaneja1 commented Feb 5, 2019

BASE_DIR=pwd`
NB_ALL=$BASE_DIR
export BASE_DIR NB_ALL

DIST=$BASE_DIR/dist
export DIST

if [ -d $DIST ] ; then
rm -rf $DIST
fi

mkdir -p $DIST/zip/moduleclusters
mkdir -p $DIST/logs

cp /scratch/downloads/NetBeans-dev-incubator-netbeans-linux-996-on-20190203-release.zip $DIST/zip/moduleclusters

NB_BUILD_NUMBER=2019
BASENAME_PREFIX=Apache-NetBeans-11.0-bin
BUILD_DESC=$BASENAME_PREFIX
BUILDNUMBER=2019
DATESTAMP=$BUILDNUMBER

export BUILDNUMBER BASENAME_PREFIX NB_BUILD_NUMBER DATESTAMP BUILD_DESC

LOCALES=ja,zh_CN,pt_BR,ru
export LOCALES
JDK11_BUILDS_PATH=artifactory/re-release-local/jdk/11.0.1/13/bundles/
export JDK7_BUILDS_PATH JDK8_BUILDS_PATH JDK11_BUILDS_PATH

MAC_SIGN_CLIENT=
MAC_SIGN_USER=
MAC_SIGN_GUID=
CODESIGNBUREAU_CREDFILE=

export MAC_SIGN_CLIENT
export MAC_SIGN_USER
export MAC_SIGN_GUID
export CODESIGNBUREAU_CREDFILE

NATIVE_MAC_MACHINE=reemataneja@
MAC_PATH=/Users/reemataneja/installer/
export NATIVE_MAC_MACHINE
export MAC_PATH

MAC_LOG_NEW=$DIST/logs/native_mac-$BUILDNUMBER.log
export MAC_LOG_NEW
BUILD_NB=1
BUILD_NETBEANS=0
BUILD_NBJDK6=0
BUILD_NBJDK7=0
BUILD_NBJDK8=0
BUILD_NBJDK11=0

export BUILD_NETBEANS BUILD_NB
export BUILD_NBJDK6 BUILD_NBJDK7 BUILD_NBJDK8 BUILD_NBJDK11
BUNDLE_JDK_PLATFORM=
export BUNDLE_JDK_PLATFORM

OUTPUT_DIR=${NB_ALL}/dist/installers
export OUTPUT_DIR

DONT_SIGN_INSTALLER=y
export DONT_SIGN_INSTALLER

bash -x $NB_ALL/nbbuild/newbuild/build-nbi.sh

@rtaneja1
Copy link
Contributor Author

rtaneja1 commented Feb 5, 2019

Above script can be run to create Apache NetBeans installers for Windows, Linux and Mac OSX

@geertjanw
Copy link
Member

I suggest this be moved into the 'nbbuild' folder, rather than being a top level 'installer' folder, once that's done, I'm in favor of approving this.

@rtaneja1
Copy link
Contributor Author

Build failures seem to be because of rat related issues, looking into these.

@geertjanw
Copy link
Member

Any reason not to merge this at this stage? Everything will be within a new folder 'installer' in the 'nbbuild' folder. Instructions for using it are above. We'll be able to produce installers for Apache NetBeans 11 and deliver them as convenience binaries together with the ZIP that provides the convenience binary. No JRE or JDK is bundled with this installer, they are expected to be available on the user's machine and the installer fails with a message if they're not available.

@rtaneja1
Copy link
Contributor Author

Temporarily closing this while I'm making changes to make installer build job pass.

@rtaneja1 rtaneja1 reopened this Mar 8, 2019
@rtaneja1
Copy link
Contributor Author

rtaneja1 commented Mar 8, 2019

Installer build job for Linux and Windows installers:
https://builds.apache.org/job/netbeans-installer-test/

No option to select Mac host for building Mac OSX installer from Jenkins job. Same script can be used to build Mac installer on local Mac.

Windows installer exe and Mac installer need to be signed. Awaiting Code Signing service account for signing exe. Mac installer signing under testing. Ref bug INFRA-17946.

@geertjanw
Copy link
Member

Wow, this is awesome.

@rtaneja1
Copy link
Contributor Author

Steps to build installers are here:
https://cwiki.apache.org/confluence/display/NETBEANS/Installer+Build+Steps

As of now I think I don't have any more pending items for this PR.
This PR has entire installers code for Donation 3 from NetBeans Hg repository. I have added support for building NetBeans installers using current artifact(binary zip). Haven't removed old code which may not be useful now. This cleanup exercise can be taken up separately in another transaction.

@geertjanw
Copy link
Member

Excellent, many thanks. Can you estimate the percentage of the code that needs to be removed?

@rtaneja1
Copy link
Contributor Author

Some of this code I can see is historical from older installer implementations and not used in 8.2 installer as well, so that can be removed. There's also code that is for installers from cluster level binaries as in 8.2 release. If we plan to continue having one integrated release binary as since 9.0 release, this code is also not required. Then we have JDK bundles related code, with older JDKs support still present. We were also likely bundling GlassFish, Tomcat, WLS (https://github.com/rtaneja1/incubator-netbeans/tree/rtaneja-donation3-installer/nbbuild/installer/components/products). These may also be removed. So this all maybe around 35 - 40 percent of code.

@Zian
Copy link

Zian commented Apr 7, 2019

Good question. What's the license of AdoptOpenJDK? Well, here you can see it is based on OpenJDK, which is GPL, so no, it cannot be distributed from Apache in a bundle with NetBeans (though, I believe, it could bundle NetBeans with itself and distribute it): https://adoptopenjdk.net/about.html

The installer fails to install on systems with OpenJDK installed from AdoptOpenJDK. When the installer is run from Windows Explorer, the following message is displayed (please excuse typos from having to OCR the popup text):

Java SE Developinerd lOt (JDK) was not fcxnd on this co.nptter
JDK 8 or newer is required for installing the Net Beans IDE. Make sure that the JDK is
property installed and run installer again. You can specify valid JDK location using
-javahome installer argument.
To download the JDK. visit http://www.oracIecomAechnetworkÍjava,avase/downloads

image

I tried using "--javahome" as documented at http://wiki.netbeans.org/FaqInstallJavahome but the installer still failed.

Example command prompt input:

Apache-NetBeans-11.0-bin-windows-x64.exe --javahome "C:\Program Files\jdk-11.0.2+9\bin"

Resulting Installer Pop Up:

Java Rizihme Envirunmer (J RE) was not f oixid
There is no JRE at the specthed location C:\Program FilesNdk-1 1 .O.2+9.bin

image

In case you're wondering if Java is installed correctly, here's the output of "java --version":

openjdk 11.0.2 2019-01-15
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.2+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.2+9, mixed mode)

Finally, this bug report would be a lot more intelligible if the pop ups supported copy and paste like normal Windows pop ups.

@geertjanw
Copy link
Member

This is the wrong place to report issues, but maybe this helps: https://www.youtube.com/watch?v=B7nZWPxZkg8

@geertjanw
Copy link
Member

I propose to merge this and, unless there are reasons not to do so, that we do the merge 24 hours from now, leaving time for anyone to suggest why we should not merge this.

@geertjanw geertjanw merged commit 7078efd into apache:master May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants