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

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • packaging
    • debian/ubuntu

      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.

          [JENKINS-51253] jenkins_2.107.3_all.deb depends on java being installed but no longer has this explicit dependency

          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.

          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.

          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.

          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.

          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.

          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.

          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.

          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.

          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. 

          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. 

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

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

          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.

          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.

          Daniel Beck added a comment -

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

          Hasn't since 2.54.

          Daniel Beck added a comment - But I don't know if Jenkins runs on OpenJDK 7 Hasn't since 2.54.

          Mostyn Bramley-Moore added a comment - Updated https://github.com/jenkinsci/packaging/pull/107

          Mark Waite added a comment -

          Won't fix this

          Mark Waite added a comment - Won't fix this

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

              Created:
              Updated:
              Resolved: