fortran-lang / http-client

http-client offers a user-friendly, high-level API to make HTTP requests in Fortran.
https://http-client.fortran-lang.org/
MIT License
60 stars 8 forks source link

Tests fail on Apple Silicon #58

Closed certik closed 1 year ago

certik commented 1 year ago

Steps to reproduce:

$ git clone https://github.com/fortran-lang/http-client.git
$ cd http-client
$ fpm build
 + mkdir -p build/dependencies
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint:   git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint:   git branch -m <name>
Initialized empty Git repository in /Users/ondrej/repos/fortran-lang/http-client/build/dependencies/fortran-curl/.git/
remote: Enumerating objects: 29, done.
remote: Counting objects: 100% (29/29), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 29 (delta 4), reused 13 (delta 0), pack-reused 0
Unpacking objects: 100% (29/29), 22.49 KiB | 1.12 MiB/s, done.
From https://github.com/interkosmos/fortran-curl
 * tag               0.5.0      -> FETCH_HEAD
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint:   git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint:   git branch -m <name>
Initialized empty Git repository in /Users/ondrej/repos/fortran-lang/http-client/build/dependencies/test-drive/.git/
remote: Enumerating objects: 31, done.
remote: Counting objects: 100% (31/31), done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 31 (delta 5), reused 8 (delta 0), pack-reused 0
Unpacking objects: 100% (31/31), 31.43 KiB | 1.31 MiB/s, done.
From https://github.com/fortran-lang/test-drive
 * tag               v0.4.0     -> FETCH_HEAD
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint:   git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint:   git branch -m <name>
Initialized empty Git repository in /Users/ondrej/repos/fortran-lang/http-client/build/dependencies/stdlib/.git/
remote: Enumerating objects: 351, done.
remote: Counting objects: 100% (351/351), done.
remote: Compressing objects: 100% (307/307), done.
remote: Total 351 (delta 54), reused 132 (delta 43), pack-reused 0
Receiving objects: 100% (351/351), 333.99 KiB | 1.39 MiB/s, done.
Resolving deltas: 100% (54/54), done.
From https://github.com/fortran-lang/stdlib
 * branch            stdlib-fpm -> FETCH_HEAD
http_version.f90                       done.
curl_macro.c                           done.
curl.f90                               done.
stdlib_kinds.f90                       done.
stdlib_ascii.f90                       done.
stdlib_optval.f90                      done.
http_pair.f90                          done.
stdlib_error.f90                       done.
stdlib_string_type.f90                 done.
http_request.f90                       done.
http_response.f90                      done.
stdlib_io.f90                          done.
stdlib_strings.f90                     done.
f08estop.f90                           done.
http_client.f90                        done.
stdlib_strings_to_string.f90           done.
stdlib_string_type_constructor.f90     done.
http.f90                               done.
libhttp.a                              done.
response_header.f90                    done.
post_form_data.f90                     done.
basic_auth.f90                         done.
post_file.f90                          done.
timeout.f90                            done.
get.f90                                done.
post.f90                               done.
download_file.f90                      done.
response_header                        done.
post_form_data                         done.
basic_auth                             done.
post_file                              done.
timeout                                done.
get                                    done.
post                                   done.
download_file                          done.
[100%] Project compiled successfully.
$ fpm test
test_delete.f90                        done.
test_auth.f90                          done.
test_header.f90                        done.
test_post.f90                          done.
test_get.f90                           done.
test_patch.f90                         done.
test_head.f90                          done.
test_put.f90                           done.
test_timeout.f90                       done.
test_delete                            done.
test_auth                              done.
test_header                            done.
test_post                              done.
test_get                               done.
test_patch                             done.
test_head                              done.
test_put                               done.
test_timeout                           done.
[100%] Project compiled successfully.
test_delete: URL using bad/illegal format or missing URL
ERROR STOP 1

Error termination. Backtrace:
#0  0x1032b3c07
#1  0x1032b47a7
#2  0x1032b5b03
#3  0x102e94b97
#4  0x102e9526b
test_auth: URL using bad/illegal format or missing URL
ERROR STOP 1

Error termination. Backtrace:
#0  0x10539bc07
#1  0x10539c7a7
#2  0x10539db03
#3  0x104f78e73
#4  0x104f7949b
test_header: All tests passed.
test_post: URL using bad/illegal format or missing URL
ERROR STOP 1

Error termination. Backtrace:
#0  0x100f53c07
#1  0x100f547a7
#2  0x100f55b03
#3  0x100ba0cdb
#4  0x100ba13b3
test_get: URL using bad/illegal format or missing URL
ERROR STOP 1

Error termination. Backtrace:
#0  0x104fd3c07
#1  0x104fd47a7
#2  0x104fd5b03
#3  0x104b1f683
#4  0x104b1ff17
test_patch: URL using bad/illegal format or missing URL
ERROR STOP 1

Error termination. Backtrace:
#0  0x10264bc07
#1  0x10264c7a7
#2  0x10264db03
#3  0x102158b73
#4  0x10215924b
test_head: URL using bad/illegal format or missing URL
ERROR STOP 1

Error termination. Backtrace:
#0  0x102c6fc07
#1  0x102c707a7
#2  0x102c71b03
#3  0x10271cf33
#4  0x10271d4bb
test_put: URL using bad/illegal format or missing URL
ERROR STOP 1

Error termination. Backtrace:
#0  0x100753c07
#1  0x1007547a7
#2  0x100755b03
#3  0x1001f8b73
#4  0x1001f924b
Failed : Timeout not reached
Failed : Status Code Validation
test_timeout: Test Case Failed
ERROR STOP 1

Error termination. Backtrace:
#0  0x1025b3c07
#1  0x1025b47a7
#2  0x1025b5b03
#3  0x1021fd1fb
#4  0x1021fd493
<ERROR> Execution for object " test_delete " returned exit code  1
<ERROR> Execution for object " test_auth " returned exit code  1
<ERROR> Execution for object " test_post " returned exit code  1
<ERROR> Execution for object " test_get " returned exit code  1
<ERROR> Execution for object " test_patch " returned exit code  1
<ERROR> Execution for object " test_head " returned exit code  1
<ERROR> Execution for object " test_put " returned exit code  1
<ERROR> Execution for object " test_timeout " returned exit code  1
<ERROR> *cmd_run*:stopping due to failed executions
STOP 1

I am using:

$ fpm --version 
Version:     0.9.0, alpha
Program:     fpm(1)
Description: A Fortran package manager and build system
Home Page:   https://github.com/fortran-lang/fpm
License:     MIT
OS Type:     macOS
$ gfortran --version
GNU Fortran (Spack GCC) 11.3.0
rajkumardongre commented 1 year ago

Thank you @certik, I will look into it

milancurcic commented 1 year ago

For reference, some progress and discussion here: https://github.com/interkosmos/fortran-curl/issues/11

HenkPoley commented 1 year ago

With fortran-curl.git set to the master branch, it now works again on macOS ARM64.

diff --git a/fpm.toml b/fpm.toml
index 5eff75d..302a265 100644
--- a/fpm.toml
+++ b/fpm.toml
@@ -19,5 +19,5 @@ implicit-external = false
 source-form = "free"

 [dependencies]
-fortran-curl = {git = "https://github.com/interkosmos/fortran-curl.git", tag = "0.5.0"}
-stdlib = "*"
\ No newline at end of file
+fortran-curl = {git = "https://github.com/interkosmos/fortran-curl.git", tag = "master"}
+stdlib = "*"

Just waiting for a release version I guess.

milancurcic commented 1 year ago

@interkosmos if you'd like to release fortran-curl-0.5.1 (assuming no API changes in master since 0.5.0), I think it'd be better to point to that rather than the master branch. Alternatively, we can point to the specific commit we need.

interkosmos commented 1 year ago

@milancurcic The version 0.6.0 has been released, including the latest fixes.