cannot build source on debian 10

Asked by Thierry Vilmart on 2020-06-15

I cannot build from source on Debian 10 buster, because the package depends on itself in a strange way.
I can fix the g++ dependency I am worried more about the openjdk-8-jdk that depends ona package of same name.

I created a new chroot.
reconfigured the locales
and now I get this error:

Code: Select all
    apt build-dep openjdk-8-jdk
    Reading package lists... Done
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
     builddeps:openjdk-8-jdk : Depends: g++-9 but it is not installable
                               Depends: openjdk-8-jdk but it is not installable or
                                        openjdk-7-jdk but it is not installable
    E: Unable to correct problems, you have held broken packages.

This is how I created the chroot.

3642 [2020-06-15 13:40:04] sudo mkdir /stable-chroot
3643 [2020-06-15 13:40:13] sudo debootstrap stable /stable-chroot http://deb.debian.org/debian/
3653 [2020-06-15 13:41:30] cd /stable-chroot/
3654 [2020-06-15 13:41:30] sudo mount -t proc proc proc/
3655 [2020-06-15 13:41:30] sudo mount --rbind /sys sys/
3656 [2020-06-15 13:41:31] sudo mount --rbind /dev dev/
sudo chroot /stable-chroot/ /bin/bash

then dpkg-reconfigure locales which worked well

Here are my sources.list and preferences:

deb http://deb.debian.org/debian stable main
deb-src http://deb.debian.org/debian stable main

# stretch-backports, pinned 100 by default so that it does not install by default
deb http://ftp.debian.org/debian stretch-backports main contrib non-free

# Testing repository - main, contrib and non-free branches
deb http://ftp.se.debian.org/debian testing main contrib non-free
deb-src http://ftp.se.debian.org/debian testing main contrib non-free

# Testing security updates repository
deb http://security.debian.org/ testing-security main contrib non-free
deb-src http://security.debian.org/ testing-security main contrib non-free

# Unstable repo main, contrib and non-free branches, no security updates here
deb http://ftp.se.debian.org/debian unstable main non-free contrib
deb-src http://ftp.se.debian.org/debian unstable main non-free contrib

preferences;

#backports are pinnined at 100 by default
# if this is not negative, a dist-upgrade can move too many packages to the backports versions
Package: *
Pin: release a=stretch-backports
Pin-Priority: -4

Package: *
Pin: release a=testing
Pin-Priority: -5

Package: *
Pin: release a=unstable
Pin-Priority: -10

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu openjdk-8 Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
2020-06-16
Last query:
2020-06-16
Last reply:
2020-06-16
Manfred Hampl (m-hampl) said : #1

This is support only for Ubuntu, and not for Debian or other related operating systems.

Please see https://www.debian.org/support or http://forums.debian.net/ for Debian support

Thierry Vilmart (magicpoulp) said : #2

But Ubuntu is based on debian, and the repository is stored here, and they package it to debian for future Ubuntu releases.

Maybe this circular dependency should be explained or corrected.

Manfred Hampl (m-hampl) said : #4

This is a Debian problem, and not an Ubuntu one.
A similar request would be "I want to build openjdk-8 on Windows from the Ubuntu source, but I fail"

What is the output of
apt-cache policy openjdk-8-jdk g++-9 openjdk-7-jdk
(if such command exists on Debian)

Why don't you take the source from the Debian repositories (for stretch or sid) https://packages.debian.org/source/sid/openjdk-8

Manfred Hampl (m-hampl) said : #5

You are misunderstanding the link https://code.launchpad.net/~openjdk/openjdk/openjdk8
This has nothing to do with Ubuntu, but belongs to the "OpenJDK team" https://launchpad.net/~openjdk that also used the launchpad servers (the same server systems as Ubuntu does).

Thierry Vilmart (magicpoulp) said : #6

Since openjdk-8 lies in the ubuntu repo, you cannot get this error since the build-dep will get openjdk itself.
The package has a dependency to itself. And it is bad. Even for Ubuntu, packages have to respect structure.

just open the source, go in debian/rules, and you will see the bd_bootstrap += \ openjdk-8-djk

here is the cache policy:
openjdk-8-jdk:
  Installerad: (ingen)
  Kandidat: (ingen)
  Versionstabell:
     8u252-b09-1 -10
        -10 http://ftp.se.debian.org/debian unstable/main amd64 Packages
g++-9:
  Installerad: (ingen)
  Kandidat: (ingen)
  Versionstabell:
     9.3.0-13 -10
        -10 http://ftp.se.debian.org/debian unstable/main amd64 Packages
openjdk-7-jdk:
  Installerad: (ingen)
  Kandidat: (ingen)
  Versionstabell:

Best Manfred Hampl (m-hampl) said : #7

"... Since openjdk-8 lies in the ubuntu repo ..."

http://bazaar.launchpad.net/~openjdk/openjdk/openjdk8 is not the Ubuntu repo, or do you see the string "Ubuntu" somewhere in this URL?

Thierry Vilmart (magicpoulp) said : #8

Here lies the package in the Ubuntu repo:

https://packages.ubuntu.com/xenial/openjdk-8-jdk

Thierry Vilmart (magicpoulp) said : #9

Here lies the package in the Ubuntu repo:

https://packages.ubuntu.com/xenial/openjdk-8-jdk

the sources.list still contain things called repositories.

Thierry Vilmart (magicpoulp) said : #10

And this is why build-dep will not see the problem with a circular dependency on Ubuntu

Manfred Hampl (m-hampl) said : #11

The cyclical dependency (even if it is only with an "or" clasue) should be reported to the provider of the software, i.e. https://launchpad.net/~openjdk

Manfred Hampl (m-hampl) said : #12

And by the wy, it is the same for the version in Debian, e.g. https://packages.debian.org/source/sid/openjdk-8

Thierry Vilmart (magicpoulp) said : #13

ok thanks I will report it to the right place since I see here is more for Ubuntu support.

But since Ubuntu is made from debian usntable, it is always good to help each other.

Thierry Vilmart (magicpoulp) said : #14

And in fact I was wrong, building Java 8 requires a boot JDK that can only be provided by the rule dapendency taht java8 or 7 is installed