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

jenkins_2.107.3_all.deb depends on java being installed but no longer has this explicit dependency

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      It seems that jenkins_2.107.3_all.deb no longer has an explicit dependency on default-jre-headless or java8-runtime-headless, which means jenkins installations are easily broken if "apt-get autoremove" is run (and it's generally good practice for debian/ubuntu admins to run this command periodically).

      jenkins_2.107.2_all.deb and earlier had the correct dependency.

      There is a comment on https://pkg.jenkins.io/debian/ which suggests that this is intentional:

      You will need to explicitly install a Java runtime environment, because Jenkins does not work with Java 9, this is the safest way to ensure your system ends properly configured. Adding an explicit dependency requirement on Java could force installation of undesired versions of the JVM. Check JENKINS-40689 for more details about Jenkins and Java 9 compatibility.

       ...but this seems wrong- the package should just depend on java8 packages specifically.

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            FYI Daniel Beck Oliver Gondža Kohsuke Kawaguchi . Likely this is a regression due to the packaging issue

            Show
            oleg_nenashev Oleg Nenashev added a comment - FYI Daniel Beck Oliver Gondža Kohsuke Kawaguchi . Likely this is a regression due to the packaging issue
            Hide
            olivergondza Oliver Gondža added a comment -

            Am I correct to understand this does not affects updating users as long as they do not call apt-get autoremove and for new installs this will require users to install (correct) java versions manually?

            Show
            olivergondza Oliver Gondža added a comment - Am I correct to understand this does not affects updating users as long as they do not call apt-get autoremove and for new installs this will require users to install (correct) java versions manually?
            Hide
            mbmop Mostyn Bramley-Moore added a comment -

            Oliver Gondža: correct.

            Show
            mbmop Mostyn Bramley-Moore added a comment - Oliver Gondža : correct.
            Hide
            danielbeck Daniel Beck added a comment -

            Caused by https://github.com/jenkinsci/packaging/commit/f5efeb3309a1f17193e05442201eeff01fb51e5b#diff-385242a38c7d9464b1f85b37f1753721 for JENKINS-45287 which has long been used, just not for the 2.107 line until 2.107.3.

            If there's a sane way to specify "only Java 8", ideally in a vendor independent manner (e.g. work on Ubuntu or whoever else uses debs), then this should be trivial to fix.

            Show
            danielbeck Daniel Beck added a comment - Caused by https://github.com/jenkinsci/packaging/commit/f5efeb3309a1f17193e05442201eeff01fb51e5b#diff-385242a38c7d9464b1f85b37f1753721 for JENKINS-45287 which has long been used, just not for the 2.107 line until 2.107.3. If there's a sane way to specify "only Java 8", ideally in a vendor independent manner (e.g. work on Ubuntu or whoever else uses debs), then this should be trivial to fix.
            Hide
            mbmop Mostyn Bramley-Moore added a comment -

            These dependencies was removed:

            default-jre-headless (>= 2:1.8) | java8-runtime-headless
            

            How about adding back something like this?

            java8-runtime-headless | openjdk-8-jre-headless
            

            Though perhaps only java8-runtime-headless is required.

            Show
            mbmop Mostyn Bramley-Moore added a comment - These dependencies was removed: default -jre-headless (>= 2:1.8) | java8-runtime-headless How about adding back something like this? java8-runtime-headless | openjdk-8-jre-headless Though perhaps only java8-runtime-headless is required.
            Hide
            danielbeck Daniel Beck added a comment -

            Mostyn Bramley-Moore Could you file a PR? CC Sam Van Oort who is the closest we have to a maintainer of packaging, I think.

            Show
            danielbeck Daniel Beck added a comment - Mostyn Bramley-Moore Could you file a PR? CC Sam Van Oort who is the closest we have to a maintainer of packaging, I think.
            Show
            mbmop Mostyn Bramley-Moore added a comment - Sure: https://github.com/jenkinsci/packaging/pull/107
            Hide
            vila vila added a comment -

            Commenting here since https://issues.jenkins-ci.org/browse/JENKINS-51226 has been closed (I didn't get notified for that :-/)

            Until this issue is fixed the jenkins package cannot be installed so this issue really is critical for newcomers.

            I'm currently using the following workaround:

            add-apt-repository 'deb http://pkg.jenkins.io/debian-stable binary/'
            apt-get update
            apt-get install jenkins=2.107.2 && apt-get install jenkins

            Since 2.107.2 is the last correct package, the dependencies are correctly installed, then the upgrade provides the latest LTS.

            Show
            vila vila added a comment - Commenting here since https://issues.jenkins-ci.org/browse/JENKINS-51226 has been closed (I didn't get notified for that :-/) Until this issue is fixed the jenkins package cannot be installed so this issue really is critical for newcomers. I'm currently using the following workaround: add-apt-repository 'deb http://pkg.jenkins.io/debian-stable binary/' apt-get update apt-get install jenkins=2.107.2 && apt-get install jenkins Since 2.107.2 is the last correct package, the dependencies are correctly installed, then the upgrade provides the latest LTS.
            Hide
            tonimueller Toni Müller added a comment -

            What would be wrong with generating different java dependencies for different versions of Jenkins and Debian?

            FWIW, in Stretch (current version of Debian) the dependencies should imho list openjdk-8-jre-headless, and probably openjdk-10-jre-headless for the next version of Debian, otherwise  openjdk-11-jre-headless. It most likely depends on when Debian will freeze for Buster.

            Show
            tonimueller Toni Müller added a comment - What would be wrong with generating different java dependencies for different versions of Jenkins and Debian? FWIW, in Stretch (current version of Debian) the dependencies should imho list openjdk-8-jre-headless, and probably openjdk-10-jre-headless for the next version of Debian, otherwise  openjdk-11-jre-headless. It most likely depends on when Debian will freeze for Buster.
            Hide
            danielbeck Daniel Beck added a comment -

            What would be wrong with generating different java dependencies for different versions of Jenkins and Debian?

            FWIW, in Stretch (current version of Debian) the dependencies should imho list openjdk-8-jre-headless, and probably openjdk-10-jre-headless for the next version of Debian, otherwise  openjdk-11-jre-headless. It most likely depends on when Debian will freeze for Buster.

            Please file a PR to the packaging repo to demonstrate what you mean.

            FWIW Jenkins does not run on Java 9+, so having such dependencies would be broken to begin with. Notably, some Java 9+ packages on a Linux distro (don't remember which) satisfied our old java dependency, and Jenkins didn't start. That was fun.

            Show
            danielbeck Daniel Beck added a comment - What would be wrong with generating different java dependencies for different versions of Jenkins and Debian? FWIW, in Stretch (current version of Debian) the dependencies should imho list openjdk-8-jre-headless, and probably openjdk-10-jre-headless for the next version of Debian, otherwise  openjdk-11-jre-headless. It most likely depends on when Debian will freeze for Buster. Please file a PR to the packaging repo to demonstrate what you mean. FWIW Jenkins does not run on Java 9+, so having such dependencies would be broken to begin with. Notably, some Java 9+ packages on a Linux distro (don't remember which) satisfied our old java dependency, and Jenkins didn't start. That was fun.
            Hide
            mbmop Mostyn Bramley-Moore added a comment -

            Debian/ubuntu openjdk-*-jre-headless packages specify all previous versions in the Provides field:

            $ apt-cache show openjdk-9-jre-headless | grep Provides
            Provides: java-runtime-headless, java2-runtime-headless, java5-runtime-headless, java6-runtime-headless, java7-runtime-headless, java8-runtime-headless, java9-runtime-headless
            

            So, what if we were to create a package with the following constraints:
            1) depends on java8-runtime-headless
            2) conflicts with java9-runtime-headless

            I guess this would technically be too strict- it would not be possible to have both openjdk-8-jre-headless and openjdk-9-jre-headless installed, even if jenkins was configured to use v8 at runtime.

            Show
            mbmop Mostyn Bramley-Moore added a comment - Debian/ubuntu openjdk-*-jre-headless packages specify all previous versions in the Provides field: $ apt-cache show openjdk-9-jre-headless | grep Provides Provides: java-runtime-headless, java2-runtime-headless, java5-runtime-headless, java6-runtime-headless, java7-runtime-headless, java8-runtime-headless, java9-runtime-headless So, what if we were to create a package with the following constraints: 1) depends on java8-runtime-headless 2) conflicts with java9-runtime-headless I guess this would technically be too strict- it would not be possible to have both openjdk-8-jre-headless and openjdk-9-jre-headless installed, even if jenkins was configured to use v8 at runtime.
            Hide
            tonimueller Toni Müller added a comment - - edited

            If you depend on java8-runtime-headless, than that's obviously too general. Therefore I suggested depending on openjdk-8-jre-headless for Debian/Stretch (don't know about Ubuntu), which will be OpenJDK 8 only, no other version. If you also want to accommodate other editions of Java, I don't know what to do, but I consider OpenJDK the go-to edition of Java on Debian. You then should not need to conflict with anything, just make sure you pick up the right version of Java if several versions are installed.

            I just checked, and it looks as if openjdk-8-jre-headless is still also in unstable, which would allow for this version being installed on the next version of Debian unless someone pulls it (but I don't see why). In future versions of Debian after Buster, it is at some point to be expected that they will only ship higher versions of OpenJDK, so at that point, which is several years in the future, Jenkins should run on, say, OpenJDK 11. 

            Show
            tonimueller Toni Müller added a comment - - edited If you depend on java8-runtime-headless, than that's obviously too general. Therefore I suggested depending on openjdk-8-jre-headless for Debian/Stretch (don't know about Ubuntu), which will be OpenJDK 8 only, no other version . If you also want to accommodate other editions of Java, I don't know what to do, but I consider OpenJDK the go-to edition of Java on Debian. You then should not need to conflict with anything, just make sure you pick up the right version of Java if several versions are installed. I just checked, and it looks as if openjdk-8-jre-headless is still also in unstable, which would allow for this version being installed on the next version of Debian unless someone pulls it (but I don't see why). In future versions of Debian after Buster, it is at some point to be expected that they will only ship higher versions of OpenJDK, so at that point, which is several years in the future, Jenkins should run on, say, OpenJDK 11. 
            Hide
            mbmop Mostyn Bramley-Moore added a comment -

            Then how about we depend upon "openjdk-8-jre-headless | <a similar version-specific oracle jre>" ?

            Show
            mbmop Mostyn Bramley-Moore added a comment - Then how about we depend upon "openjdk-8-jre-headless | <a similar version-specific oracle jre>" ?
            Hide
            tonimueller Toni Müller added a comment -

            That should imho do the trick for Debian Stretch and Buster, as far as I can see at the moment, and for Jessie users if they have backports enabled. If you can depend on 

            openjdk-8-jre-headless | openjdk-7-jre-headless | <similar oracle stuff>

            then you would cover all Debian versions back to Wheezy. But I don't know if Jenkins runs on OpenJDK 7. And, as said, I don't know what to depend on for Ubuntu & friends, although it might well be the very same stuff.

            Show
            tonimueller Toni Müller added a comment - That should imho do the trick for Debian Stretch and Buster, as far as I can see at the moment, and for Jessie users if they have backports enabled. If you can depend on  openjdk-8-jre-headless | openjdk-7-jre-headless | <similar oracle stuff> then you would cover all Debian versions back to Wheezy. But I don't know if Jenkins runs on OpenJDK 7. And, as said, I don't know what to depend on for Ubuntu & friends, although it might well be the very same stuff.
            Hide
            danielbeck Daniel Beck added a comment -

            But I don't know if Jenkins runs on OpenJDK 7

            Hasn't since 2.54.

            Show
            danielbeck Daniel Beck added a comment - But I don't know if Jenkins runs on OpenJDK 7 Hasn't since 2.54.
            Show
            mbmop Mostyn Bramley-Moore added a comment - Updated https://github.com/jenkinsci/packaging/pull/107

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              mbmop Mostyn Bramley-Moore
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated: