-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
sage-download-file: Fix certificate problems with https downloads from upstream_url when sage-system-python is XCode's python3 on macOS #29418
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:6
that's why I suggested not to bother with MacOS/Xcode's python(3). New commits:
|
Commit: |
This comment has been minimized.
This comment has been minimized.
Changed commit from |
Changed branch from u/mkoeppe/sage_download_file__fix_certificate_problems_with_https_downloads_on_macos_python3 to none |
Author: Matthias Koeppe |
comment:8
Replying to @dimpase:
Please... the idea is to make Sage installation easier, not harder. |
comment:9
One often runs into these certificate errors also with random Linux images when I run them on Docker. So this workaround is valuable for the automatic testing in any case. |
Commit: |
comment:11
Testing this at https://github.com/mkoeppe/sage/actions/runs/65346154 New commits:
|
comment:12
Replying to @mkoeppe:
well, it seems that using system's python would make a slighly cryptographically |
comment:14
And, of course, the present ticket is about |
comment:15
oy gevalt, pythons everywhere! |
comment:17
Replying to @dimpase:
This will be addressed in #45678 "switch Sage from Python to Julia" |
comment:19
Rebased, needs review |
comment:23
Okay, I'm really confused, or my Sage installation is broken, or both. If I use
If instead I run So: why does |
comment:24
|
comment:25
Could you try if the problem goes away if you run |
This comment has been minimized.
This comment has been minimized.
comment:27
If I run
and then if I search my terminal window for
I don't think I tested #29113 well enough when I was reviewing it. |
comment:28
This fixes it for me: diff --git a/src/bin/sage b/src/bin/sage
index 10acddcd96..6ccff3789c 100755
--- a/src/bin/sage
+++ b/src/bin/sage
@@ -404,7 +404,7 @@ if [ "$1" = '-i' ]; then
# 'CC=gcc -Wall' '--enable-e_antic'
CONFIG_CMD="./configure $(./config.status --config) $ENABLE_ARGS"
echo >&2 "running $CONFIG_CMD"
- bash -c "$CONFIG_CMD" && $MAKE all-build
+ bash -c "$CONFIG_CMD" && $MAKE $PACKAGES
else
echo "New packages may have been installed."
echo "Re-running configure and make in case any dependent packages need updating." (or maybe it could be By the way, I still don't understand the goal of this ticket. |
comment:29
Let's please take the issues with |
This comment has been minimized.
This comment has been minimized.
comment:31
Replying to @jhpalmieri:
Reworked the ticket description, please take a look |
comment:32
Replying to @mkoeppe:
Sorry, I wasn't clear enough. What system configuration and commands lead to the problem in the description? I can't reproduce the problem, so I can't tell if the solution here works. |
comment:33
From what I understand this is a problem that only occurs when one has python3 from Xcode. This doesn't ship certify and never will (at least Apple doesn't have any intentions). So it is really difficult to establish an ssl connection with that. Do you have successfully tested this ticket? Do I understand correctly that the problem occurring could be theoretically fixed by manually downloading the correct packages into the upstream folder? (Yes this is not a good approach for testing environments.) Also this flag would never be needed for a normal user as long as the sage mirrors don't use ssl? |
comment:34
Replying to @kliem:
That's a correct description for macOS. But the problem also appears on Linux distributions if one does not install ca-certificates, or those are outdated.
Yes, I have been using this as part of #29417 since end of March.
That's correct for the macOS tests using
That's right, normal users would not use the |
Reviewer: Jonathan Kliem |
comment:35
LGTM. Btw, I have been using this ticket to test my tickets, e.g. here: https://github.com/kliem/sage-test-27122/actions/runs/72102779 |
comment:36
Thank you! |
comment:38
Follow up: #30950 |
Changed commit from |
#26351 added an optional
upstream_url
field tobuild/pkgs/*/checksums.ini
. It streamlines the procedure for testing upgrade tickets: Developers or automatic testing facilities can pass an extra flag-o
tosage-spkg
to allow downloading from upstream rather than from Sage mirrors (where the updated ticket will be made available later only).Many upstream package URLs use the
https
protocol - in contrast to thehttp
protocol used when downloading from the Sage mirrors. The downloading is done viabuild/bin/sage-download-file
, which uses theurllib
module. It supports the https protocol.However, SSL certificate problems are common on test systems. For example, if one uses XCode's
python3
as the system python, thenurllib
does not automatically uses the standard system certificates. (This is apparently a known issue -- which is considered "wontfix" by Apple as reported here:HandBrake/HandBrake#2216 (comment))
We add an option
--no-check-certificate
tosage-download-file
, disabling certificate checking (https://stackoverflow.com/questions/36600583/python-3-urllib-ignore-ssl-certificate-verification).Developers can set this option using the environment variable SAGE_DOWNLOAD_FILE_OPTIONS when installing packages (either by
make
or by usingsage -i
).We note that even with SSL certificates disabled, there is still cryptographic protection because of the checksums recorded in
checksums.ini
.Other possible workarounds considered:
As of #29090 (sage-system-python fixup) prefers
/usr/bin/python3
over/usr/bin/python
, leading to:(see https://github.com/mkoeppe/sage/runs/538432620)
CC: @vbraun @dimpase @kiwifb @jhpalmieri @videlec @fchapoton @kliem
Component: build
Author: Matthias Koeppe
Branch:
90ea00b
Reviewer: Jonathan Kliem
Issue created by migration from https://trac.sagemath.org/ticket/29418
The text was updated successfully, but these errors were encountered: