mono/CppSharp

build/scripts/Utils.lua:108: SSL peer certificate or SSH remote key was not OK Cert verify failed: BADCERT_NOT_TRUSTED

Martinfx opened this issue · 11 comments

Brief Description

Hi, i tried build cppsharpfor freebsd and I cannot download llvm.

./build.sh clone_llvm
/home/maxfx/Documents/CppSharp/build/premake/premake5
LLVM release: 6eb36aed86ea276695697093eb8136554c29286b
Downloading: https://github.com/llvm/llvm-project/archive/6eb36aed86ea276695697093eb8136554c29286b.tar.gz
Error: /usr/home/maxfx/Documents/CppSharp/build/scripts/Utils.lua:108: SSL peer certificate or SSH remote key was not OK
Cert verify failed: BADCERT_NOT_TRUSTED

OS: Windows / OS X / Linux (include version and/or distro)
uname -a
FreeBSD hades 13.3-RELEASE-p1 FreeBSD 13.3-RELEASE-p1 GENERIC amd64

Used headers
Used settings

Target: MSVC/GCC/Clang

Other settings

Stack trace or incompilable generated code
tritao commented

We use Premake http.download to download, looks like it has a bug on FreeBSD.

Think it would be good if you can confirm the bug with just a simple Premake script and report upstream if this is the case.

And as workaround, you can change the download code here: https://github.com/mono/CppSharp/blob/main/build/scripts/Utils.lua#L99

To just call curl or wget instead with execute/os.execute function.

I changed function but on end is error 0 and nothing do and ./build llvm_build donwlaod again llvm

function download(url, file, try)
  print("Downloading: " .. url)
  local prev = 0
  local cmd = "wget " ..  url
  local res = execute(cmd)
--  local res, code = http.download(url, file, function(total, curr)
--    http.progress(total, prev, curr)
--    prev = curr
--  end)

  if res ~= "OK" then
    os.remove(file)

    if not try then
      error(res)
    end
  end

  return res, code
end



/home/maxfx/Documents/CppSharp/build/premake/premake5
LLVM/Clang directory does not exist, cloning...
LLVM release: 6eb36aed86ea276695697093eb8136554c29286b
Downloading: https://github.com/llvm/llvm-project/archive/6eb36aed86ea276695697093eb8136554c29286b.tar.gz
wget https://github.com/llvm/llvm-project/archive/6eb36aed86ea276695697093eb8136554c29286b.tar.gz
--2024-06-03 14:29:00--  https://github.com/llvm/llvm-project/archive/6eb36aed86ea276695697093eb8136554c29286b.tar.gz
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/llvm/llvm-project/tar.gz/6eb36aed86ea276695697093eb8136554c29286b [following]
--2024-06-03 14:29:01--  https://codeload.github.com/llvm/llvm-project/tar.gz/6eb36aed86ea276695697093eb8136554c29286b
Resolving codeload.github.com (codeload.github.com)... 140.82.121.10
Connecting to codeload.github.com (codeload.github.com)|140.82.121.10|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘6eb36aed86ea276695697093eb8136554c29286b.tar.gz.1’

6eb36aed86ea276695697093eb8136554c29286b.tar.gz.1               [                            <=>                                                                                                           ] 187.09M  3.67MB/s    in 50s     

2024-06-03 14:29:52 (3.76 MB/s) - ‘6eb36aed86ea276695697093eb8136554c29286b.tar.gz.1’ saved [196177099]

Error: 0

tritao commented

Try returning "OK".

Try returning "OK".

./build.sh build_llvm
/home/maxfx/Documents/CppSharp/build/premake/premake5
LLVM/Clang directory does not exist, cloning...
LLVM release: 6eb36aed86ea276695697093eb8136554c29286b
Downloading: https://github.com/llvm/llvm-project/archive/6eb36aed86ea276695697093eb8136554c29286b.tar.gz
wget https://github.com/llvm/llvm-project/archive/6eb36aed86ea276695697093eb8136554c29286b.tar.gz
--2024-06-03 14:47:12-- https://github.com/llvm/llvm-project/archive/6eb36aed86ea276695697093eb8136554c29286b.tar.gz
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/llvm/llvm-project/tar.gz/6eb36aed86ea276695697093eb8136554c29286b [following]
--2024-06-03 14:47:12-- https://codeload.github.com/llvm/llvm-project/tar.gz/6eb36aed86ea276695697093eb8136554c29286b
Resolving codeload.github.com (codeload.github.com)... 140.82.121.10
Connecting to codeload.github.com (codeload.github.com)|140.82.121.10|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘6eb36aed86ea276695697093eb8136554c29286b.tar.gz’

6eb36aed86ea276695697093eb8136554c29286b.tar.gz [ <=> ] 187.09M 3.87MB/s in 50s

2024-06-03 14:48:03 (3.75 MB/s) - ‘6eb36aed86ea276695697093eb8136554c29286b.tar.gz’ saved [196177099]

Error: 0

tritao commented

Check the code here: https://github.com/mono/CppSharp/blob/main/build/llvm/LLVM.lua#L198

Add some print if necessary. Looks like a simple issue to figure out whats going on.

Check the code here: https://github.com/mono/CppSharp/blob/main/build/llvm/LLVM.lua#L198

Add some print if necessary. Looks like a simple issue to figure out whats going on.

  print("base" .. base)
  print("archive" .. archive)
  msg, code = download(base .. archive, archive, true)
  print(msg)
  print(code)

 ./build.sh build_llvm
/home/maxfx/Documents/CppSharp/build/premake/premake5
LLVM/Clang directory does not exist, cloning...
LLVM release: 6eb36aed86ea276695697093eb8136554c29286b
Downloading: https://github.com/llvm/llvm-project/archive/6eb36aed86ea276695697093eb8136554c29286b.tar.gz
wget https://github.com/llvm/llvm-project/archive/6eb36aed86ea276695697093eb8136554c29286b.tar.gz
--2024-06-03 15:40:37--  https://github.com/llvm/llvm-project/archive/6eb36aed86ea276695697093eb8136554c29286b.tar.gz
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/llvm/llvm-project/tar.gz/6eb36aed86ea276695697093eb8136554c29286b [following]
--2024-06-03 15:40:37--  https://codeload.github.com/llvm/llvm-project/tar.gz/6eb36aed86ea276695697093eb8136554c29286b
Resolving codeload.github.com (codeload.github.com)... 140.82.121.9
Connecting to codeload.github.com (codeload.github.com)|140.82.121.9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘6eb36aed86ea276695697093eb8136554c29286b.tar.gz’

6eb36aed86ea276695697093eb8136554c29286b.tar.gz                 [                                                                   <=>                                                                    ] 187.09M  1.49MB/s    in 1m 40s  

2024-06-03 15:42:18 (1.88 MB/s) - ‘6eb36aed86ea276695697093eb8136554c29286b.tar.gz’ saved [196177099]

Error: 0

Check around here: https://github.com/mono/CppSharp/blob/main/build/llvm/LLVM.lua#L39

I dont know why cannot open archive. But in engrampa is ok.

 ./build.sh build_llvm
/home/maxfx/Documents/CppSharp/build/premake/premake5
LLVM/Clang directory does not exist, cloning...
LLVM release: 6eb36aed86ea276695697093eb8136554c29286b
llvm-6eb36aed86ea276695697093eb8136554c29286b.tar.gz
mkdir -p .
tar xvf llvm-6eb36aed86ea276695697093eb8136554c29286b.tar.gz -C .
Error: /usr/home/maxfx/Documents/CppSharp/build/scripts/Utils.lua:35: Error executing shell command, aborting...

Check around here: https://github.com/mono/CppSharp/blob/main/build/llvm/LLVM.lua#L39

I dont know why cannot open archive. But in engrampa is ok.

 ./build.sh build_llvm
/home/maxfx/Documents/CppSharp/build/premake/premake5
LLVM/Clang directory does not exist, cloning...
LLVM release: 6eb36aed86ea276695697093eb8136554c29286b
llvm-6eb36aed86ea276695697093eb8136554c29286b.tar.gz
mkdir -p .
tar xvf llvm-6eb36aed86ea276695697093eb8136554c29286b.tar.gz -C .
Error: /usr/home/maxfx/Documents/CppSharp/build/scripts/Utils.lua:35: Error executing shell command, aborting...

Why is there this error ^ ? Because tar xvf llvm-6eb36aed86ea276695697093eb8136554c29286b.tar.gz -C .
he cannot extract then I looked for to llvm folder and name si 6eb36aed86ea276695697093eb8136554c29286b.tar.gz
Why is open archive set to llvm-......?
This project is soo buggy. I have cloned project and he cannot detect llvm-project folder.

tritao commented

Check around here: https://github.com/mono/CppSharp/blob/main/build/llvm/LLVM.lua#L39

I dont know why cannot open archive. But in engrampa is ok.

 ./build.sh build_llvm
/home/maxfx/Documents/CppSharp/build/premake/premake5
LLVM/Clang directory does not exist, cloning...
LLVM release: 6eb36aed86ea276695697093eb8136554c29286b
llvm-6eb36aed86ea276695697093eb8136554c29286b.tar.gz
mkdir -p .
tar xvf llvm-6eb36aed86ea276695697093eb8136554c29286b.tar.gz -C .
Error: /usr/home/maxfx/Documents/CppSharp/build/scripts/Utils.lua:35: Error executing shell command, aborting...

Why is there this error ^ ? Because tar xvf llvm-6eb36aed86ea276695697093eb8136554c29286b.tar.gz -C . he cannot extract then I looked for to llvm folder and name si 6eb36aed86ea276695697093eb8136554c29286b.tar.gz Why is open archive set to llvm-......? This project is soo buggy. I have cloned project and he cannot detect llvm-project folder.

First of all you are using an unsupported platform. And looks like at the same time you struggling to figure out what's going wrong by what appears to be a relatively simple issue. Maybe try using a supported platform to have a better experience.

Check around here: https://github.com/mono/CppSharp/blob/main/build/llvm/LLVM.lua#L39

I dont know why cannot open archive. But in engrampa is ok.

 ./build.sh build_llvm
/home/maxfx/Documents/CppSharp/build/premake/premake5
LLVM/Clang directory does not exist, cloning...
LLVM release: 6eb36aed86ea276695697093eb8136554c29286b
llvm-6eb36aed86ea276695697093eb8136554c29286b.tar.gz
mkdir -p .
tar xvf llvm-6eb36aed86ea276695697093eb8136554c29286b.tar.gz -C .
Error: /usr/home/maxfx/Documents/CppSharp/build/scripts/Utils.lua:35: Error executing shell command, aborting...

Why is there this error ^ ? Because tar xvf llvm-6eb36aed86ea276695697093eb8136554c29286b.tar.gz -C . he cannot extract then I looked for to llvm folder and name si 6eb36aed86ea276695697093eb8136554c29286b.tar.gz Why is open archive set to llvm-......? This project is soo buggy. I have cloned project and he cannot detect llvm-project folder.

First of all you are using an unsupported platform. And looks like at the same time you struggling to figure out what's going wrong by what appears to be a relatively simple issue. Maybe try using a supported platform to have a better experience.

ok