Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1 #88158

Closed
shreyanavigyan mannequin opened this issue Apr 30, 2021 · 12 comments
Closed

Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1 #88158

shreyanavigyan mannequin opened this issue Apr 30, 2021 · 12 comments

Comments

@shreyanavigyan
Copy link
Mannequin

shreyanavigyan mannequin commented Apr 30, 2021

BPO 43992
Nosy @tiran, @ned-deily, @merwok, @erlend-aasland, @shreyanavigyan

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2021-05-08.18:31:12.731>
created_at = <Date 2021-04-30.18:53:40.367>
labels = []
title = 'Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1'
updated_at = <Date 2021-05-08.18:33:08.908>
user = 'https://github.com/shreyanavigyan'

bugs.python.org fields:

activity = <Date 2021-05-08.18:33:08.908>
actor = 'shreyanavigyan'
assignee = 'none'
closed = True
closed_date = <Date 2021-05-08.18:31:12.731>
closer = 'christian.heimes'
components = []
creation = <Date 2021-04-30.18:53:40.367>
creator = 'shreyanavigyan'
dependencies = []
files = []
hgrepos = []
issue_num = 43992
keywords = []
message_count = 12.0
messages = ['392500', '392573', '393215', '393216', '393246', '393249', '393264', '393272', '393273', '393274', '393275', '393277']
nosy_count = 5.0
nosy_names = ['christian.heimes', 'ned.deily', 'eric.araujo', 'erlendaasland', 'shreyanavigyan']
pr_nums = []
priority = 'normal'
resolution = 'third party'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue43992'
versions = []

@shreyanavigyan
Copy link
Mannequin Author

shreyanavigyan mannequin commented Apr 30, 2021

I'm trying to build CPython on Ubuntu but I can't get the external dependencies. Running this command :-

$ sudo apt-get build-dep python3

gives the output :-

Reading package lists... Done
E: You must put some 'deb-src' URIs in your sources.list

What is the exact string to add to /etc/apt/sources.list?

System Info: Ubuntu 20.04.1 (Focal Fossa)
Architecture: x64
GCC version: 9.3.0

(I've posted the problem in this issue tracker because Google and Stack Overflow doesn't seem to have an answer. I'm sorry for posting this here but no one seem to have the answer to this apart from core or experienced developers.)

@shreyanavigyan
Copy link
Mannequin Author

shreyanavigyan mannequin commented May 1, 2021

I've tweaked some of my settings and was able to get the dependencies but they are out of date. I tried upgrading them but not working.

(I'm not new to Ubuntu but I'm also not excellent at Ubuntu. A little bit of explanation would be helpful.)

@merwok
Copy link
Member

merwok commented May 7, 2021

apt build-dep (or aptitude build-dep) is a command used to get build-time dependencies for the system package, which are not always the same as the upstream in-development version of Python.

As the error message told you, you need deb-src lines in your sources.list to have this work. An example is here, it may not be up-to-date (refers to ubuntu bionic and python3.6) but hopefully you can adapt it: https://devguide.python.org/setup/#build-dependencies

I think more explanations should come from ubuntu documentation or forums, not Python docs; Python can’t document every facility from every OS.

@shreyanavigyan
Copy link
Mannequin Author

shreyanavigyan mannequin commented May 8, 2021

I know the deb-src problem and I've added that a long time ago. The problem is that I don't know which repository has the unstable source. I'm on Ubuntu Focal Fossa. I successfully can fetch sources but they are not up-to-date. I can't figure out the repository and the component.

@shreyanavigyan
Copy link
Mannequin Author

shreyanavigyan mannequin commented May 8, 2021

It's also pretty problematic that Python depends on the system header code rather than fetched source code like we do in OS X or Windows. I would like to suggest that we fetch source code and then use that instead of system header files. This wouldn't be a problem to implement since OS X and Linux behave in the same way because both share the same UNIX kernel and it wouldn't break any code out there. In fact it would improve the code. This would reduce all the setup we have to do beforehand on Linux especially Debian distributions.

@shreyanavigyan
Copy link
Mannequin Author

shreyanavigyan mannequin commented May 8, 2021

This problem doesn't exist in RPM Linux. Therefore creating a new DebianBuild directory (like there is PCBuild, Mac) just for Debian Linux. (I haven't tested RPM Linux and can't access any right now therefore I don't know if the problem exists there or not. But I'm gonna guess not for now.)

@erlend-aasland
Copy link
Contributor

Here's a trick I often recommend:
Do as the CI; use the posix-deps-apt.sh script!

You'll find it in your CPython git repo:
$ cd cpython.git # change working dir to the CPython git repo
$ cat .github/workflows/posix-deps-apt.sh
#!/bin/sh
apt-get update

apt-get -yq install \
build-essential \
ccache \
gdb \
lcov \
libbz2-dev \
libffi-dev \
libgdbm-dev \
liblzma-dev \
libncurses5-dev \
libreadline6-dev \
libsqlite3-dev \
libssl-dev \
lzma \
lzma-dev \
tk-dev \
uuid-dev \
xvfb \
zlib1g-dev

Should work well on all Debian based Linux distros (that includes Ubuntu).

@shreyanavigyan
Copy link
Mannequin Author

shreyanavigyan mannequin commented May 8, 2021

I figured out the commands. The problem is they are not upgraded.

@ned-deily
Copy link
Member

This isn't a bug with Python, it is a development environment issue. The discussion would be more appropriate in help forums, like on discuss.python.org or Stackoverflow. And, if there si some deficiency in the devguide, there is a tracker for issues with it: https://github.com/python/devguide/issues

@tiran
Copy link
Member

tiran commented May 8, 2021

I have been following this issue for a while. I feel it's getting increasingly offtopic for Python bug tracker. Any concerns or problems with your distro are better suited for the help and discussion forums of your distribution.

Ah, Ned just closed the issue while I was typing.

@tiran tiran reopened this May 8, 2021
@tiran tiran removed the invalid label May 8, 2021
@tiran tiran closed this as completed May 8, 2021
@shreyanavigyan
Copy link
Mannequin Author

shreyanavigyan mannequin commented May 8, 2021

I never said this was a bug. But what I'm saying is there should be a different build for Debian because Debian has a reputation of using outdated packages.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants