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

Debian packaging should not be satisfied by Java 9

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            rarabaolaza 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 Daniel Beck?

            Show
            rarabaolaza 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 Daniel Beck ?
            Hide
            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.

            Show
            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.
            Hide
            rarabaolaza Raul Arabaolaza added a comment -

            Daniel Beck 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.

            Show
            rarabaolaza Raul Arabaolaza added a comment - Daniel Beck 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.
            Hide
            danielbeck Daniel Beck added a comment -

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

            Show
            danielbeck Daniel Beck added a comment - Preinst might be a bit much; doesn't the service script look for a compatible JRE?
            Hide
            rarabaolaza 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

            Show
            rarabaolaza 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
            Hide
            danielbeck 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.

            Show
            danielbeck 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.
            Hide
            rarabaolaza Raul Arabaolaza added a comment - - edited

            Daniel Beck 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?

            Show
            rarabaolaza Raul Arabaolaza added a comment - - edited Daniel Beck 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?
            Hide
            rarabaolaza Raul Arabaolaza added a comment -

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

            Show
            rarabaolaza Raul Arabaolaza added a comment - I have created a PR implementing my proposal, is linked to the issue
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            scm_issue_link 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`

            Show
            scm_issue_link 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`
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

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

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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: