Restream / reindexer

Embeddable, in-memory, document-oriented database with a high-level Query builder interface.
https://reindexer.io
Apache License 2.0
763 stars 64 forks source link

build error on download swagger-ui #74

Closed beho1der closed 2 years ago

beho1der commented 2 years ago

I use master branch on git, when use cmake: cmake -DCMAKE_BUILD_TYPE=Release .. Get Error:

-- Downloading swagger html assets...
CMake Error at cpp_src/server/CMakeLists.txt:82 (message):
  Could not prepare 'swagger' files.  Reason: Error copying directory from
  "/root/reindexer/build/cpp_src/server/swagger-ui-2.x/dist" to
  "/root/reindexer/build/cpp_src/server/swagger".

  CMake Error at cpp_src/server/make_swagger.cmake:17 (message):

    Could not copy directory
    '/root/reindexer/build/cpp_src/server/swagger-ui-2.x/dist'
-- Configuring incomplete, errors occurred!
graveart commented 2 years ago

Hi! Just checked build on my laptop with ubuntu 20.04. Unable to reproduce this issue.

Make sure, that you have internet connection and proper directory permission during build. Also check if swagger download URL is available from your build machine (via curl: curl https://codeload.github.com/swagger-api/swagger-ui/tar.gz/2.x --output swagger.tgz)

beho1der commented 2 years ago

I download with curl on this host curl https://codeload.github.com/swagger-api/swagger-ui/tar.gz/2.x --output swagger.tgz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1368k 100 1368k 0 0 1045k 0 0:00:01 0:00:01 --:--:-- 1045k

File OK

permission during build

I am build on root user

cmake -DCMAKE_BUILD_TYPE=Release ..

`-- Downloading swagger html assets... CMake Error at cpp_src/server/CMakeLists.txt:82 (message): Could not prepare 'swagger' files. Reason: Error copying directory from "/root/reindexer/build/cpp_src/server/swagger-ui-2.x/dist" to "/root/reindexer/build/cpp_src/server/swagger".

CMake Error at cpp_src/server/make_swagger.cmake:17 (message):

Could not copy directory
'/root/reindexer/build/cpp_src/server/swagger-ui-2.x/dist'

-- Configuring incomplete, errors occurred! See also "/root/reindexer/build/CMakeFiles/CMakeOutput.log". See also "/root/reindexer/build/CMakeFiles/CMakeError.log". ` In CMakeOutput.log and CMakeError.log file nothin nothing about swagger

graveart commented 2 years ago

That's strange. The only way I managed to get the same error was the disabling of my internet connection.

Ok. Check the contents of build/cpp_src/server directory. Does it contains any swagger-related files or directories?

beho1der commented 2 years ago

ls -la cpp_src/server total 28 drwxr-xr-x 4 root root 4096 Jul 21 07:12 . drwxr-xr-x 5 root root 4096 Jul 21 07:12 .. drwxr-xr-x 2 root root 4096 Jul 21 07:12 CMakeFiles drwxr-xr-x 3 root root 4096 Jul 21 07:12 contrib -rw-r--r-- 1 root root 760 Jul 21 07:24 make_face.cmake -rw-r--r-- 1 root root 1654 Jul 21 07:24 make_swagger.cmake -rw-r--r-- 1 root root 0 Jul 21 07:24 swagger.tar.gz -rw-r--r-- 1 root root 267 Jul 21 07:24 swagger_replace.cmake

swagger.tar.gz - 0 byte

graveart commented 2 years ago

So the swagger archive was not actually downloaded. It could be caused either by some network configuration peculiarities or by some kind of local cmake configs. You can try to investigate make_swagger.cmake - it contains cmake's build instructions and actual download URL. Maybe it will help you to find solution.

Also there are some possible workarounds, which you could try: 1) Build without swagger (comment out lines from 75 to 83 here). But in this case you will probably get the same error, when Cmake will try to download reindexer-face 2) Download swagger.tar.gz and manually put it into build directory. Then you will have to comment out swagger download line in cmake: https://github.com/Restream/reindexer/blob/master/cpp_src/server/CMakeLists.txt#L19. Probably reindexer face will require the same changes here 3) Use reindexer as prebuilt package from repo (or as docker container)

beho1der commented 2 years ago

I build on my notebook without problem. Seems to be a problem witch CMake on server. Make close Issues