#67147 closed defect (fixed)

maxima-devel @ 5.46-dev-20221029_5 +xmaxima: Git clone failed - certificate has expired

Reported by: dotnetCarpenter (Jon Ege Ronnenberg) Owned by: catap (Kirill A. Korinsky)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc: KubaO (Kuba Ober), dotnetCarpenter (Jon Ege Ronnenberg)
Port: maxima-devel

Description

I just tried to install maxima-devel but got the following error:

:info:fetch Cloning into '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_maxima/maxima-devel/work/maxima-5.46-dev-20221029'...
:info:fetch fatal: unable to access 'https://git.code.sf.net/p/maxima/code/': SSL certificate problem: certificate has expired
:info:fetch Command failed: /usr/bin/git clone --progress https://git.code.sf.net/p/maxima/code /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_maxima/maxima-devel/work/maxima-5.46-dev-20221029 2>&1
:info:fetch Exit code: 128
:error:fetch Failed to fetch maxima-devel: Git clone failed
:debug:fetch Error code: NONE
:debug:fetch Backtrace: Git clone failed
:debug:fetch     while executing
:debug:fetch "gitfetch"
:debug:fetch     (procedure "portfetch::fetch_main" line 14)
:debug:fetch     invoked from within
:debug:fetch "$procedure $targetname"
:error:fetch See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_maxima/maxima-devel/main.log for details.

Attachments (2)

main.log.zip (11.4 KB) - added by dotnetCarpenter (Jon Ege Ronnenberg) 20 months ago.
main.log on macOS 10.13.6
Screen Shot 2023-03-26 at 01.14.58.png (21.5 KB) - added by dotnetCarpenter (Jon Ege Ronnenberg) 20 months ago.
ISRG Root X1

Download all attachments as: .zip

Change History (15)

Changed 20 months ago by dotnetCarpenter (Jon Ege Ronnenberg)

Attachment: main.log.zip added

main.log on macOS 10.13.6

comment:1 Changed 20 months ago by dotnetCarpenter (Jon Ege Ronnenberg)

Cc: dotnetCarpenter added

comment:2 in reply to:  description ; Changed 20 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to dotnetCarpenter:

:info:fetch fatal: unable to access 'https://git.code.sf.net/p/maxima/code/': SSL certificate problem: certificate has expired

I accessed that URL in Safari on macOS Monterey and it says the certificate is valid until June 9, 2023.

It also shows the certificate was issued by Let's Encrypt. Have you followed the steps in ProblemHotlist#letsencrypt?

comment:3 in reply to:  2 ; Changed 20 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign:

It also shows the certificate was issued by Let's Encrypt. Have you followed the steps in ProblemHotlist#letsencrypt?

Reviewing those instructions (it's been awhile since I wrote them), I guess there aren't any steps to be performed on macOS 10.13.

You shouldn't even have been able to get to the point of being able to try to install maxima-devel since its dependency sbcl doesn't build on 10.13 (#66002).

comment:4 in reply to:  3 ; Changed 20 months ago by dotnetCarpenter (Jon Ege Ronnenberg)

Replying to ryandesign:

Replying to ryandesign:

It also shows the certificate was issued by Let's Encrypt. Have you followed the steps in ProblemHotlist#letsencrypt?

Reviewing those instructions (it's been awhile since I wrote them), I guess there aren't any steps to be performed on macOS 10.13.

You shouldn't even have been able to get to the point of being able to try to install maxima-devel since its dependency sbcl doesn't build on 10.13 (#66002).

Well, your built bot is lying: https://build.macports.org/builders/ports-10.13_x86_64-builder/builds/182650 As the stats also show: https://ports.macports.org/port/sbcl/stats/ there are plenty of successful installs on 10.13 and below.

I have successfully installed https://ports.macports.org/port/maxima/details/ and are using maxima now. So it appears that 7 others are (according to stats).

I will try your guide for letsencrypt tomorrow. I vaguely remember having this issue before and fixed it by updating my root certificates from curl: https://curl.se/docs/caextract.html. Perhaps it is time to do that again.

Last edited 20 months ago by dotnetCarpenter (Jon Ege Ronnenberg) (previous) (diff)

Changed 20 months ago by dotnetCarpenter (Jon Ege Ronnenberg)

ISRG Root X1

comment:5 in reply to:  3 Changed 20 months ago by dotnetCarpenter (Jon Ege Ronnenberg)

Replying to ryandesign:

Reviewing those instructions (it's been awhile since I wrote them), I guess there aren't any steps to be performed on macOS 10.13.

https://trac.macports.org/raw-attachment/ticket/67147/Screen%20Shot%202023-03-26%20at%2001.14.58.png

Is there anything more to do for the root certificate? It seems that it is marked as trusted for all users.

comment:6 Changed 20 months ago by dotnetCarpenter (Jon Ege Ronnenberg)

I can clone https://git.code.sf.net/p/maxima/code/ with my macports version of git but not the /usr/bin/git version that macports is using!

$ which git
/opt/local/bin/git

$ git --version                                                                                                                                                                                  
git version 2.40.0

$ /usr/bin/git --version                                                                                                                                                                         
git version 2.17.2 (Apple Git-113)
$ git clone --depth=1 https://git.code.sf.net/p/maxima/code maxima-test1                                                                                                                         
Cloning into 'maxima-test1'...
remote: Enumerating objects: 5085, done.
remote: Counting objects: 100% (5085/5085), done.
remote: Compressing objects: 100% (4416/4416), done.
Receiving objects:  36% (1845/5085), 21.11 MiB | 955.00 KiB/s

$ /usr/bin/git clone --depth=1 https://git.code.sf.net/p/maxima/code maxima-test2                                                                                                                
Cloning into 'maxima-test2'...
fatal: unable to access 'https://git.code.sf.net/p/maxima/code/': SSL certificate problem: certificate has expired

comment:7 in reply to:  4 ; Changed 20 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to dotnetCarpenter:

Replying to ryandesign: Well, your built bot is lying: https://build.macports.org/builders/ports-10.13_x86_64-builder/builds/182650 As the stats also show: https://ports.macports.org/port/sbcl/stats/ there are plenty of successful installs on 10.13 and below.

Ok, good to know. It's not a lie: the buildbot did fail to build the port. The fact that it works on some user systems could point to code that is making assumptions about processor capabilities that are true on some user systems but false on our buildbot workers (which run on Xserves) or a difference in Xcode version.

Last edited 20 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:8 in reply to:  7 Changed 20 months ago by dotnetCarpenter (Jon Ege Ronnenberg)

Replying to ryandesign:

Replying to dotnetCarpenter:

Replying to ryandesign: Well, your built bot is lying: https://build.macports.org/builders/ports-10.13_x86_64-builder/builds/182650 As the stats also show: https://ports.macports.org/port/sbcl/stats/ there are plenty of successful installs on 10.13 and below.

Ok, good to know. It's not a lie: the buildbot did fail to build the port. The fact that it works on some user systems could point to code that is making assumptions about processor capabilities that are true on some user systems but false on our buildbot workers (which run on Xserves) or a difference in Xcode version.

Sorry - I didn't mean to say that it builds successfully on your buildbot - only that it is not true that many of macports packages does not built on macOS 10.13.6. But perhaps my setup is atypical. Though I haven't done anything but installed the latest supported xcode version (10.1) from App Store.

I don't really understand the error given from sbcl. I'm not a C/C++/Objective-C developer...

/usr/bin/clang -I../src/runtime     avx2.c   -o avx2
avx2.c:2:3: error: use of unknown builtin '__builtin_cpu_init' [-Wimplicit-function-declaration]
  __builtin_cpu_init();
  ^
1 error generated.
make: *** [avx2] Error 1
Command failed: SBCL_MACOSX_VERSION_MIN=10.13 CC=/usr/bin/clang CXX=/usr/bin/clang++ CPP=/usr/bin/cpp sh ./make.sh --fancy --prefix=/opt/local --xc-host="/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_sbcl/sbcl/work/sbcl-2.2.9-x86-64-darwin/src/runtime/sbcl --core /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_sbcl/sbcl/work/sbcl-2.2.9-x86-64-darwin/output/sbcl.core --disable-debugger --sysinit /dev/null --userinit /dev/null" 
Exit code: 2

https://build.macports.org/builders/ports-10.13_x86_64-builder/builds/182650/steps/install-port/logs/stdio

comment:9 Changed 20 months ago by dotnetCarpenter (Jon Ege Ronnenberg)

Couldn't the maxima-devel package use and depend on macports' git instead of /usr/bin/git?

comment:10 Changed 20 months ago by tomio-arisaka (Tomio Arisaka)

I don't really understand the error given from sbcl. I'm not a C/C++/Objective-C developer...

Earlier versions of clang don't know __builtin_cpu_init.
So I think the simple solution is to use MacPorts clang or GCC. (e.g. clang-14, gcc12)


Couldn't the maxima-devel package use and depend on macports' git instead of /usr/bin/git?

For example, you can apply the next patch:

--- Portfile.orig	2023-02-28 17:28:51.000000000 +0900
+++ Portfile	2023-03-30 02:00:00.000000000 +0900
@@ -44,6 +44,17 @@
     git.url     https://git.code.sf.net/p/maxima/code
     git.branch  5b42cccfd9eee54d0458d8f4e63e6b44c55d48a1
 
+    # On High-Sierra, fix SSL certificate problem: certificate has expired
+    if {${os.major} < 19} {
+        depends_build-append    path:bin/git:git
+
+        worksrcdir  ${name}-${version}
+        fetch {
+            system -W ${workpath} "git clone --progress ${git.url} ${worksrcdir} 2>&1"
+            system -W ${worksrcpath} "git checkout -q ${git.branch} 2>&1"
+        }
+    }
+
     use_autoreconf  yes
 
     livecheck.type  none

comment:11 in reply to:  10 ; Changed 20 months ago by dotnetCarpenter (Jon Ege Ronnenberg)

Replying to tomio-arisaka:

Thank you @tomio-arisaka for your insights. But perhaps these comments are getting a little side-tracked from the issue.

  1. __builtin_cpu_init is only an issue on the buildbot and not on my machine, where ​sbcl does build successfully.
  2. This issue is about maxima-devel which does not build, neither on the buildbot or on my machine but for two different reasons.
    1. On my machine because it uses the system git and not MacPorts git.
    2. On the buildbot because the sbcl package, which is a dependency for maxima-devel, does not build due to the __builtin_cpu_init issue.

My machine is running macOS: 10.13.6 with XCode: 10.1

My workaround for maxima-devel is to use maxima which does build, on my machine and the buildbot.

I even forget why I needed maxima-devel in the first place but thought that it would be useful to create an issue about the system git issue on macOS 10.13.6. I haven't tried your patch but I can test it, if you want?

Regardless, the sbcl issue is specific to the buildbot running macOS 10.13.6 and the system git issue, is specific to the maxima-devel package on my machine.

Perhaps it would be better to create a new issue for sbcl not building on the buildbot for macOS 10.13?

Last edited 20 months ago by dotnetCarpenter (Jon Ege Ronnenberg) (previous) (diff)

comment:12 in reply to:  11 Changed 20 months ago by tomio-arisaka (Tomio Arisaka)

Replying to dotnetCarpenter:

I haven't tried your patch but I can test it, if you want?

You don't need to apply my patch if you don't like to do. Because it has already been verified on macOS High Sierra.

Anyway, maxima-devel is provided to try to use a current development version of Maxima. Now, over 1800 commits are applied to the development version of Maxima after Maxima 5.46.0.


  1. __builtin_cpu_init is only an issue on the buildbot and not on my machine, where ​sbcl does build successfully.

The issue depends on the version of Apple clang. So the resolution is to use a suitable version of clang or GCC in order to compile SBCL.

avx2.c is a file copied from SBCL. This is to check AVX2 instruction set of x86_64.

$ cat ./avx2.c
int main () {
  __builtin_cpu_init();
  return __builtin_cpu_supports("avx2") != 0;
}

__builtin_cpu_init and __builtin_cpu_supports are built-in functions of GCC and clang. But they are not available on the earlier versions of Apple clang (included in Xcode 9.4.1 and earlier)

$ xcodebuild -version
Xcode 9.4.1
Build version 9F2000
$ 
$ clang --version
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ 
$ clang ./avx2.c -o ./avx2
./avx2.c:2:3: error: use of unknown builtin '__builtin_cpu_init'
      [-Wimplicit-function-declaration]
  __builtin_cpu_init();
  ^
1 error generated.
$ 
$ /Library/Developer/CommandLineTools/usr/bin/clang --version
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
$ 
$ /Library/Developer/CommandLineTools/usr/bin/clang ./avx2.c -o ./avx2
$ 
$ echo $?
0
$ 

MacPorts clang also has __builtin_cpu_init and __builtin_cpu_supports:

$ port installed 'clang*'
The following ports are currently installed:
  clang-14 @14.0.6_0+analyzer+libstdcxx (active)
  clang-15 @15.0.7_1+analyzer+libstdcxx (active)
  clang_select @2.2_1 (active)
$ 
$ clang-mp-15 --version
clang version 15.0.7
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-15/bin
$ 
$ clang-mp-15 ./avx2.c -o ./avx2
$ 
$ echo $?
0
$ 

So you can change the value of CC referred to the port-file of SBCL in order to use clang-mp-15 to compile SBCL. For example, next command works expectedly:

$ sudo port install sbcl configure.cc=/opt/local/bin/clang-mp-15 

It seems that the port-file of SBCL should be modified to use MacPorts clang instead of Apple clang. Because Xcode 10.1 is not available on the earlier versions of macOS than macOS High Sierra.(e.g. macOS Sierra, OSX El Capitan)


By the way, since SBCL 2.3.3, upstream has changed how to check AVX2 in order to avoid causing an error when compiling avx2.c. (AVX2 is used in SB-SIMD module)

An extract from the differences between SBCL 2.3.2 and SBCL 2.3.3:

$ diff -u SBCL-2.3.2-git/sbcl-code/make-config.sh SBCL-2.3.3-git/sbcl-code/make-config.sh 
--- SBCL-2.3.2-git/sbcl-code/make-config.sh	2023-02-27 13:48:26.000000000 +0900
+++ SBCL-2.3.3-git/sbcl-code/make-config.sh	2023-03-29 16:52:31.000000000 +0900
...
...
@@ -655,8 +652,7 @@
   x86-64)
     printf ' :sb-simd-pack :sb-simd-pack-256 :avx2' >> $ltf # not mandatory
 
-    $GNUMAKE -C tools-for-build avx2
-    if tools-for-build/avx2; then
+    if ! $GNUMAKE -C tools-for-build avx2 2> /dev/null || tools-for-build/avx2 ; then
        SBCL_CONTRIB_BLOCKLIST="$SBCL_CONTRIB_BLOCKLIST sb-simd"
     fi
 

The change shows that building SBCL does not stop if clang fails to compile avx2.c, and if so, SB-SIMD module is not built at the same time. So we should use a suitable version of clang or GCC in order to compile SBCL.

Last edited 20 months ago by tomio-arisaka (Tomio Arisaka) (previous) (diff)

comment:13 Changed 16 months ago by catap (Kirill A. Korinsky)

Owner: set to catap
Resolution: fixed
Status: newclosed

In 1aeed33113686d8dff80919689b098b516c0d49b/macports-ports (master):

maxima: update to 5.47.0maxima-devel: update to 5.47-dev-20230730

Also add myself as maintainer and closes number of issues.

Closes: #48427
Closes: #53926
Closes: #55362
Closes: #63813
Closes: #66034
Closes: #67147
Closes: #67778
Closes: #67801

Note: See TracTickets for help on using tickets.