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

pyenv does not respect aria2.conf #1126

Closed
herrbischoff opened this issue Mar 21, 2018 · 8 comments
Closed

pyenv does not respect aria2.conf #1126

herrbischoff opened this issue Mar 21, 2018 · 8 comments

Comments

@herrbischoff
Copy link

Issue

On a FreeBSD server, I had the problem of installation via pyenv failing due to not being able to download the Python source code. I found out that the aria2c utility is used if it is installed. However, it does not use the settings in the config file, necessitating the following command line to successfully install:

env PYTHON_BUILD_ARIA2_OPTS="--ca-certificate=/etc/ssl/cert.pem" pyenv install 3.6.3

Solution

On FreeBSD, the SSL certificates are not located at /etc/ssl/certs/ca-certificates.crt, which is a Linuxism that should be avoided. This should be fixed in aria2c. However, pyenv should either respect the local config settings of aria2c or remove support for it. The reason for failure is not obvious and only visible when using the verbose flag (-v).

@joshfriend
Copy link
Member

seems like that is intentional #625

@herrbischoff
Copy link
Author

Thanks for the hint. But wow, this is kind of shortsighted. I can understand not using the user configuration. But since this can be problematic, using aria2c should really be optional, in a way that it requires to be explicitly enabled. Possibly through an env variable like PYTHON_BUILD_ARIA2_ENABLE. Both curl and wget are well-behaved and not affected by any of this.

@joshfriend
Copy link
Member

joshfriend commented Mar 21, 2018

If aria2 allows it's config file to override the -o command line flag, what else can we do?

aria2 offers features that wget and curl don't which is why it is the default if installed (#534)

@yyuu
Copy link
Contributor

yyuu commented Mar 22, 2018

With current implementation, it'll always pick up the first found preferred HTTP client on the system. And, aria2c is at the top.

https://github.com/pyenv/pyenv/blob/v1.2.2/plugins/python-build/bin/python-build#L331-L345

Introducing some new environment variable like PYTHON_BUILD_HTTP_CLIENT="curl" might help users to deal with the situation like aria2c on FreeBSD. As a happy side effect, it might help simplifying some bats tests of python-build for most cases.

https://github.com/pyenv/pyenv/blob/v1.2.2/plugins/python-build/test/build.bats#L11

@joshfriend
Copy link
Member

joshfriend commented Mar 22, 2018

I like the PYTHON_BUILD_HTTP_CLIENT idea 👍, but maybe name it PYENV_HTTP_CLIENT?

@herrbischoff
Copy link
Author

herrbischoff commented Mar 22, 2018

Sounds like a reasonable idea, although I’m not a fan of software that tries to be too clever for its own good.

If you support more than the basic two, there’s a case to be made to support every platform-specific download tool available. For FreeBSD, this would be fetch, which is part of the base system, unlike curl and wget, which need to be separately installed.

@yyuu
Copy link
Contributor

yyuu commented May 1, 2018

I've merged #1146 into master. With using the latest revision, now PYTHON_BUILD_HTTP_CLIENT=curl will let python-build to use the preferred HTTP client on your system.

@yyuu yyuu closed this as completed May 1, 2018
ipatch added a commit to ipatch/pyenv that referenced this issue May 14, 2018
* 'master' of github.com:pyenv/pyenv:
  CPython 3.7.0b4
  v1.2.4
  Add pypy-portable 6.0.0
  CPython 2.7.15
  Add pypy 6.0.0
  Refactor test code of python-build. Use curl during tests by default
  Import latest changes from https://github.com/rbenv/ruby-build as of v20180424
  Address pyenv#273 via a patch from python#21811
  Rewrite python-build tests with using `PYTHON_BUILD_HTTP_CLIENT`
  Allow overriding HTTP client type based on environment variable `PYTHON_BUILD_HTTP_CLIENT` (pyenv#1126)
  Add basic test for rehash wait
  Fix rehash test to give up sooner after lock file's presence
  Renamed variable; s/PYENV_REHASH_LOCK_TIMEOUT/PYENV_REHASH_TIMEOUT/
  Experimental implementation to wait rehash until acquiring lock
jasonkarns added a commit to nodenv/node-build that referenced this issue Nov 11, 2018
Primarily: rbenv/ruby-build#1226 rbenv/ruby-build#1198

* tag 'ruby-build/v20180822':
  ruby-build 20180822
  Document environment variables used for downloading
  Simplify detecting available HTTP client
  Allow `aria2c` to be found in PATH in tests
  Use quotes for consistency
  Rename the extracted directory if it is not the same as the package name
  Revert "Ensure extracted tarball matches the package name"
  Upgrade to OpenSSL 1.1.0i
  Upgrade to OpenSSL 1.0.2p
  Add definition for TruffleRuby 1.0.0-rc5
  Remove early check for LLVM when installing TruffleRuby
  Add definition for TruffleRuby 1.0.0 RC3
  Add mruby 1.4.1
  Add mruby 1.4.0
  Allow overriding HTTP client type based on environment variable `RUBY_BUILD_HTTP_CLIENT` (pyenv/pyenv#1126)
jasonkarns added a commit to nodenv/node-build that referenced this issue Nov 11, 2018
Primarily: rbenv/ruby-build#1226 rbenv/ruby-build#1198

* tag 'ruby-build/v20180822':
  ruby-build 20180822
  Document environment variables used for downloading
  Simplify detecting available HTTP client
  Allow `aria2c` to be found in PATH in tests
  Use quotes for consistency
  Rename the extracted directory if it is not the same as the package name
  Revert "Ensure extracted tarball matches the package name"
  Upgrade to OpenSSL 1.1.0i
  Upgrade to OpenSSL 1.0.2p
  Add definition for TruffleRuby 1.0.0-rc5
  Remove early check for LLVM when installing TruffleRuby
  Add definition for TruffleRuby 1.0.0 RC3
  Add mruby 1.4.1
  Add mruby 1.4.0
  Allow overriding HTTP client type based on environment variable `RUBY_BUILD_HTTP_CLIENT` (pyenv/pyenv#1126)
taqtiqa-mark pushed a commit to taqtiqa-mark/julia-build that referenced this issue Apr 25, 2019
* Fix install on Solaris / Illumos

  Install crashes on Solaris with an empty log file. Adding support
  for the proper Solaris getconf call in num_cpu_cores fixed it. Tested
  and working under OmniOS CE r151024.

* Rename the extracted directory if not the same as the package name

  - make_package() assumes the archive was extracted to $package_name.
  - fetch_tarball() does not check the name of the toplevel directory in
  the archive, so rename after if it's not exactly "$package_name".

* Consistent quoting

* Allow HTTP client from on `JULIA_BUILD_HTTP_CLIENT` (pyenv/pyenv#1126)

* Simpler detection of HTTP client

* Update EOL message for macOS > 10.9 Mavericks
taqtiqa-mark added a commit to taqtiqa/julia-build that referenced this issue Apr 25, 2019
* Fix Org references in README.md (#8)

Shell script examples should work when cut-n-paste.
Closes #8.

* Convert Ruby references to Julia

* Add versions 1.1.0 and 1.0.3

* Remove Ruby references

* Picked from rbenv parent repo

* Fix install on Solaris / Illumos

  Install crashes on Solaris with an empty log file. Adding support
  for the proper Solaris getconf call in num_cpu_cores fixed it. Tested
  and working under OmniOS CE r151024.

* Rename the extracted directory if not the same as the package name

  - make_package() assumes the archive was extracted to $package_name.
  - fetch_tarball() does not check the name of the toplevel directory in
  the archive, so rename after if it's not exactly "$package_name".

* Consistent quoting

* Allow HTTP client from on `JULIA_BUILD_HTTP_CLIENT` (pyenv/pyenv#1126)

* Simpler detection of HTTP client

* Update EOL message for macOS > 10.9 Mavericks
taqtiqa-mark added a commit to taqtiqa-mark/julia-build that referenced this issue Jul 2, 2019
* Fix Org references in README.md (taqtiqa#8)

Shell script examples should work when cut-n-paste.
Closes taqtiqa#8.

* Convert Ruby references to Julia

* Add versions 1.1.0 and 1.0.3

* Remove Ruby references

* Picked from rbenv parent repo

* Fix install on Solaris / Illumos

  Install crashes on Solaris with an empty log file. Adding support
  for the proper Solaris getconf call in num_cpu_cores fixed it. Tested
  and working under OmniOS CE r151024.

* Rename the extracted directory if not the same as the package name

  - make_package() assumes the archive was extracted to $package_name.
  - fetch_tarball() does not check the name of the toplevel directory in
  the archive, so rename after if it's not exactly "$package_name".

* Consistent quoting

* Allow HTTP client from on `JULIA_BUILD_HTTP_CLIENT` (pyenv/pyenv#1126)

* Simpler detection of HTTP client

* Update EOL message for macOS > 10.9 Mavericks
@salotz
Copy link

salotz commented Jun 30, 2020

This isn't documented anywhere. I was having issues with using curl needing to be configured to go through a proxy not working. wget does respect the config file.

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