Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-45287

Debian packaging should not be satisfied by Java 9

      The Debian package is the only one that still declares a Java dependency (https://github.com/jenkinsci/packaging/commit/188ffd36c2abd83ca9e572b6b1fb6d2f423685bc) but it declares ≥8.

      This can in some cases result in Java 9 installations when those appear to not work with Jenkins.

      If possible the dependency should be limited to exactly Java 8, or dropped altogether with corresponding explanation on the package listing page.

      Similarly, Java dependency documentation for Opensuse/Redhat should be reviewed to ensure we don't claim Java 9 compatibility.

          [JENKINS-45287] Debian packaging should not be satisfied by Java 9

          Raul Arabaolaza added a comment - - edited

          What does it mean limited to exactly Java 8? The current package just ensures that a Java 8 or higher is installed, but you can also have Java 7, 9 or any other version installed and configured as the default for the machine. So, if I set the dependency on exactly Java 8 that only means that among my set of installed packages I must have java 8, but it does not ensure I do not have Java 9 also installed and configured. I can force to not have any other version of Java installed but that looks a bit too much to me. Why should jenkins prevent me to install any versions of java in my server as long as I have the right one for jenkins itself? So, I would recommend to:

          • Drop the package's dependency on Java 8 and update the docs accordingly.
          • Create a preinst script that checks if java 8 is the one configured for the jenkins user and print a warning or abort installation if not.

          WDYT danielbeck?

          Raul Arabaolaza added a comment - - edited What does it mean limited to exactly Java 8 ? The current package just ensures that a Java 8 or higher is installed, but you can also have Java 7, 9 or any other version installed and configured as the default for the machine. So, if I set the dependency on exactly Java 8 that only means that among my set of installed packages I must have java 8, but it does not ensure I do not have Java 9 also installed and configured. I can force to not have any other version of Java installed but that looks a bit too much to me. Why should jenkins prevent me to install any versions of java in my server as long as I have the right one for jenkins itself? So, I would recommend to: Drop the package's dependency on Java 8 and update the docs accordingly. Create a preinst script that checks if java 8 is the one configured for the jenkins user and print a warning or abort installation if not. WDYT danielbeck ?

          Daniel Beck added a comment -

          Java 8 or higher

          As Jenkins doesn't work with Java 9, this is just wrong. ≥8 should be =8. You can have others installed, but Jenkins doesn't have its dependencies satisfied if you only have 7 and 9. It needs 8.

          Daniel Beck added a comment - Java 8 or higher As Jenkins doesn't work with Java 9, this is just wrong. ≥8 should be =8. You can have others installed, but Jenkins doesn't have its dependencies satisfied if you only have 7 and 9. It needs 8.

          danielbeck My point is that =8 alone doesn't really guarantees the installed jenkins to work, changing the >= 8 to =8 is feasible but IMHO a half backed solution that needs to be complemented by a preinst script by the resons specified above.

          Raul Arabaolaza added a comment - danielbeck My point is that =8 alone doesn't really guarantees the installed jenkins to work, changing the >= 8 to =8 is feasible but IMHO a half backed solution that needs to be complemented by a preinst script by the resons specified above.

          Daniel Beck added a comment -

          Preinst might be a bit much; doesn't the service script look for a compatible JRE?

          Daniel Beck added a comment - Preinst might be a bit much; doesn't the service script look for a compatible JRE?

          I can not find anything like that on the debian init script It seems there are some checks in the case of RPM but I have not found anything in the debian one. Also to be sure I have installed the deb package in a machine with java 9 installed and configured as default and the service starts without problems and jenkins also does the same... see attached screenshot

          Raul Arabaolaza added a comment - I can not find anything like that on the debian init script It seems there are some checks in the case of RPM but I have not found anything in the debian one. Also to be sure I have installed the deb package in a machine with java 9 installed and configured as default and the service starts without problems and jenkins also does the same... see attached screenshot

          Daniel Beck added a comment -

          Right, the deb hardcodes /usr/bin/java via https://github.com/jenkinsci/packaging/blob/master/deb/build/debian/jenkins.default#L7 – not sure this is desirable.

          Happy to take your guidance on this, but I've seen multiple reports from people who got Java 9 installed through this dependency (I think on ubuntu 14.04 with custom repos? Not sure) and that should not be happening.

          Daniel Beck added a comment - Right, the deb hardcodes /usr/bin/java via https://github.com/jenkinsci/packaging/blob/master/deb/build/debian/jenkins.default#L7 – not sure this is desirable. Happy to take your guidance on this, but I've seen multiple reports from people who got Java 9 installed through this dependency (I think on ubuntu 14.04 with custom repos? Not sure) and that should not be happening.

          Raul Arabaolaza added a comment - - edited

          danielbeck Yeah, In Ubuntu 14.04 you need a custom repo to install openjdk 8... To make things more interesting given that the "recommended" version of java in Ubuntu is 8 you can end with it installed when you install Java 9 in Ubuntu 16.04 so even strictly requirements on Java 8 may not be enough to guarantee nothing.

          So, I would recommend to follow the same logic than the RPM package, java dependency was dropped for similar issues but the startup script includes a facility to check for a valid java version. I have a first draft of a java 8 detection function (need to test on debian not only on ubuntu) that I can incorporate to the debian init script. This way

          • We make easy to install the package without forcing anyone to a concrete java configuration
            • We do not really should care about how java is installed as long as we can use it, I, for example, like to install it manually via tar.gz files and after that use update-alternatives, every time a package installs automatically openjdk packages or similar I have to redo my entire conf
          • We make sure the jenkins instance is only run with an appropriate java version
          • We can provide a meaningful error message if an invalid java version is used to run jenkins

          WDYT?

          Raul Arabaolaza added a comment - - edited danielbeck Yeah, In Ubuntu 14.04 you need a custom repo to install openjdk 8... To make things more interesting given that the "recommended" version of java in Ubuntu is 8 you can end with it installed when you install Java 9 in Ubuntu 16.04 so even strictly requirements on Java 8 may not be enough to guarantee nothing. So, I would recommend to follow the same logic than the RPM package, java dependency was dropped for similar issues but the startup script includes a facility to check for a valid java version. I have a first draft of a java 8 detection function (need to test on debian not only on ubuntu) that I can incorporate to the debian init script. This way We make easy to install the package without forcing anyone to a concrete java configuration We do not really should care about how java is installed as long as we can use it, I, for example, like to install it manually via tar.gz files and after that use update-alternatives, every time a package installs automatically openjdk packages or similar I have to redo my entire conf We make sure the jenkins instance is only run with an appropriate java version We can provide a meaningful error message if an invalid java version is used to run jenkins WDYT?

          I have created a PR implementing my proposal, is linked to the issue

          Raul Arabaolaza added a comment - I have created a PR implementing my proposal, is linked to the issue

          Code changed in jenkins
          User: Raul Arabaolaza
          Path:
          deb/build/debian/control
          http://jenkins-ci.org/commit/packaging/f5efeb3309a1f17193e05442201eeff01fb51e5b
          Log:
          JENKINS-45287 Drop specific java dependencies

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Arabaolaza Path: deb/build/debian/control http://jenkins-ci.org/commit/packaging/f5efeb3309a1f17193e05442201eeff01fb51e5b Log: JENKINS-45287 Drop specific java dependencies

          Code changed in jenkins
          User: Raul Arabaolaza
          Path:
          deb/build/debian/jenkins.default
          http://jenkins-ci.org/commit/packaging/35a903a88981cde4bdfc973e81b14af915f27e66
          Log:
          JENKINS-45287 Do not hardcode java path

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Arabaolaza Path: deb/build/debian/jenkins.default http://jenkins-ci.org/commit/packaging/35a903a88981cde4bdfc973e81b14af915f27e66 Log: JENKINS-45287 Do not hardcode java path

          Code changed in jenkins
          User: Raul Arabaolaza
          Path:
          deb/build/debian/jenkins.init
          http://jenkins-ci.org/commit/packaging/d076d292b5f95b70475cc7ba5c4a84a63695e4b9
          Log:
          JENKINS-45287 Modify deb init script to check if configured java is suitable

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Arabaolaza Path: deb/build/debian/jenkins.init http://jenkins-ci.org/commit/packaging/d076d292b5f95b70475cc7ba5c4a84a63695e4b9 Log: JENKINS-45287 Modify deb init script to check if configured java is suitable

          Code changed in jenkins
          User: Raul Arabaolaza
          Path:
          deb/build/debian/jenkins.init
          http://jenkins-ci.org/commit/packaging/1945c6fbe109c33d4d0d57d372082ce254da3519
          Log:
          JENKINS-45287 Include PATH info in no java found error message

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Arabaolaza Path: deb/build/debian/jenkins.init http://jenkins-ci.org/commit/packaging/1945c6fbe109c33d4d0d57d372082ce254da3519 Log: JENKINS-45287 Include PATH info in no java found error message

          Code changed in jenkins
          User: Raul Arabaolaza
          Path:
          deb/publish/gen.rb
          http://jenkins-ci.org/commit/packaging/cc184e1096aa07aa2f596cbe20fe7b0cbc0de74a
          Log:
          JENKINS-45287 Update gen site index to state the need to install Java 8

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Arabaolaza Path: deb/publish/gen.rb http://jenkins-ci.org/commit/packaging/cc184e1096aa07aa2f596cbe20fe7b0cbc0de74a Log: JENKINS-45287 Update gen site index to state the need to install Java 8

          Code changed in jenkins
          User: Raul Arabaolaza
          Path:
          deb/build/debian/jenkins.default
          deb/build/debian/jenkins.init
          http://jenkins-ci.org/commit/packaging/df59db86ca3af93e8e6b3141387432f2173ae69d
          Log:
          JENKINS-45287 Use `type -p java` instead of `which java`

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Arabaolaza Path: deb/build/debian/jenkins.default deb/build/debian/jenkins.init http://jenkins-ci.org/commit/packaging/df59db86ca3af93e8e6b3141387432f2173ae69d Log: JENKINS-45287 Use `type -p java` instead of `which java`

          Code changed in jenkins
          User: Raul Arabaolaza
          Path:
          deb/build/debian/jenkins.init
          http://jenkins-ci.org/commit/packaging/3971d30305b10977fcdab3a2a65c85fb03c7be4f
          Log:
          JENKINS-45287 Adapt the Java not found error message

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Arabaolaza Path: deb/build/debian/jenkins.init http://jenkins-ci.org/commit/packaging/3971d30305b10977fcdab3a2a65c85fb03c7be4f Log: JENKINS-45287 Adapt the Java not found error message

          Code changed in jenkins
          User: Raul Arabaolaza
          Path:
          deb/publish/gen.rb
          http://jenkins-ci.org/commit/packaging/7a95e407ff58e9133fe80c3441d48bd988990df6
          Log:
          JENKINS-45287 Fix misleading documentation

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Arabaolaza Path: deb/publish/gen.rb http://jenkins-ci.org/commit/packaging/7a95e407ff58e9133fe80c3441d48bd988990df6 Log: JENKINS-45287 Fix misleading documentation

          Code changed in jenkins
          User: Raul Arabaolaza
          Path:
          deb/publish/gen.rb
          http://jenkins-ci.org/commit/packaging/7d942177002e861ff22ec53df42a3dc2815d3f0c
          Log:
          JENKINS-45287 Make the java 9 issue bold in documentation

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Arabaolaza Path: deb/publish/gen.rb http://jenkins-ci.org/commit/packaging/7d942177002e861ff22ec53df42a3dc2815d3f0c Log: JENKINS-45287 Make the java 9 issue bold in documentation

          Code changed in jenkins
          User: Raul Arabaolaza
          Path:
          deb/publish/gen.rb
          http://jenkins-ci.org/commit/packaging/d3f21f575eb0a9f3aa24fb31466f463dc28da5ce
          Log:
          JENKINS-45287 Add link to jenkins issue regarding Java 9 compatibility

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Arabaolaza Path: deb/publish/gen.rb http://jenkins-ci.org/commit/packaging/d3f21f575eb0a9f3aa24fb31466f463dc28da5ce Log: JENKINS-45287 Add link to jenkins issue regarding Java 9 compatibility

          Code changed in jenkins
          User: Sam Van Oort
          Path:
          deb/build/debian/control
          deb/build/debian/jenkins.default
          deb/build/debian/jenkins.init
          deb/publish/gen.rb
          http://jenkins-ci.org/commit/packaging/e3ddccea97cac6649b8136e8bc574583f5df6fca
          Log:
          Merge pull request #101 from raul-arabaolaza/JENKINS-45287

          JENKINS-45287 Debian packaging should not be satisfied by Java 9

          Compare: https://github.com/jenkinsci/packaging/compare/3835c07d1a14...e3ddccea97ca

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Sam Van Oort Path: deb/build/debian/control deb/build/debian/jenkins.default deb/build/debian/jenkins.init deb/publish/gen.rb http://jenkins-ci.org/commit/packaging/e3ddccea97cac6649b8136e8bc574583f5df6fca Log: Merge pull request #101 from raul-arabaolaza/ JENKINS-45287 JENKINS-45287 Debian packaging should not be satisfied by Java 9 Compare: https://github.com/jenkinsci/packaging/compare/3835c07d1a14...e3ddccea97ca

          Oleg Nenashev added a comment -

          As we discussed in the PR, it should not be backported into 2.60.3

          Oleg Nenashev added a comment - As we discussed in the PR, it should not be backported into 2.60.3

            rarabaolaza Raul Arabaolaza
            danielbeck Daniel Beck
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: