how can I publish cpp project

I'd like to ty to create a bot on dpp, installed from vcpkg how can I set a docker file, to build and run that bot on railway ? as main questions: 1. how & wich compile I must use, as I suggest I can't use VS build tools 2. how can I install and use vcpkg to install dpp from vcpkg 3. how can I cpecify -DCMAKE_TOOLCHAIN_FILE with vcpkg includes
68 Replies
Percy
Percy2y ago
Project ID: N/A
Satan1c
Satan1cOP2y ago
HuTaoThink
root
root2y ago
If you're using CMake, you can just use Ninja + Clang If you send your code, I could try to whip up a dockerfile for you Are you using CMake?
Satan1c
Satan1cOP2y ago
yep
cmake_minimum_required(VERSION 3.25)
project(TestBot)

set(CMAKE_CXX_STANDARD 17)

add_executable(${PROJECT_NAME} src/main.cpp)

set(OS_NAME "x64-linux")
if(WIN32)
set(OS_NAME "x64-windows")
endif()

find_package(dpp CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE dpp::dpp)

target_include_directories(${PROJECT_NAME} PRIVATE $ENV{VCPKG_PATH}/installed/${OS_NAME}/include)
cmake_minimum_required(VERSION 3.25)
project(TestBot)

set(CMAKE_CXX_STANDARD 17)

add_executable(${PROJECT_NAME} src/main.cpp)

set(OS_NAME "x64-linux")
if(WIN32)
set(OS_NAME "x64-windows")
endif()

find_package(dpp CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE dpp::dpp)

target_include_directories(${PROJECT_NAME} PRIVATE $ENV{VCPKG_PATH}/installed/${OS_NAME}/include)
my message just disapeared, lol)
root
root2y ago
Try this:
FROM ubuntu:lunar
RUN apt-get update
RUN apt-get install build-essential git tar curl zip unzip cmake ninja-build
WORKDIR /vcpkg-boot
RUN git clone https://github.com/microsoft/vcpkg
RUN ./vcpkg/bootstrap-vcpkg.sh
RUN ./vcpkg/vcpkg install dpp
WORKDIR /app
ADD . /app
RUN cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake
RUN cmake --build /out
ENTRYPOINT ["/out/TestBot"]
FROM ubuntu:lunar
RUN apt-get update
RUN apt-get install build-essential git tar curl zip unzip cmake ninja-build
WORKDIR /vcpkg-boot
RUN git clone https://github.com/microsoft/vcpkg
RUN ./vcpkg/bootstrap-vcpkg.sh
RUN ./vcpkg/vcpkg install dpp
WORKDIR /app
ADD . /app
RUN cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake
RUN cmake --build /out
ENTRYPOINT ["/out/TestBot"]
(put that in Dockerfile) Yeah, I see it in the mod channels, there's a new automod feature that's slightly buggy right now, sorry
Satan1c
Satan1cOP2y ago
-------------------
2 |
3 | RUN apt-get update
4 | >>> RUN apt-get install build-essential git tar curl zip unzip cmake ninja-build
5 |
6 | WORKDIR /vcpkg-boot
-------------------
ERROR: failed to solve: process "/bin/sh -c apt-get install build-essential git tar curl zip unzip cmake ninja-build" did not complete successfully: exit code: 1
-------------------
2 |
3 | RUN apt-get update
4 | >>> RUN apt-get install build-essential git tar curl zip unzip cmake ninja-build
5 |
6 | WORKDIR /vcpkg-boot
-------------------
ERROR: failed to solve: process "/bin/sh -c apt-get install build-essential git tar curl zip unzip cmake ninja-build" did not complete successfully: exit code: 1
root
root2y ago
Is there an error message above that?
Satan1c
Satan1cOP2y ago
as I see, only that:
#7 ERROR: process "/bin/sh -c apt-get install build-essential git tar curl zip unzip cmake ninja-build" did not complete successfully: exit code: 1
-----
> [ 3/11] RUN apt-get install build-essential git tar curl zip unzip cmake ninja-build:
#7 2.041 libtirpc-common libtirpc-dev libtirpc3 libtsan2 libubsan1 libuv1 libwebp7
#7 2.041 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxml2 libxmuu1
#7 2.041 libxpm4 linux-libc-dev lto-disabled-list make manpages manpages-dev netbase
#7 2.041 ninja-build openssh-client openssl patch perl perl-modules-5.36
#7 2.042 pinentry-curses publicsuffix readline-common rpcsvc-proto unzip xauth
#7 2.042 xz-utils zip
#7 2.051 0 upgraded, 147 newly installed, 0 to remove and 0 not upgraded.
#7 2.051 Need to get 123 MB of archives.
#7 2.051 After this operation, 457 MB of additional disk space will be used.
#7 2.051 Do you want to continue? [Y/n] Abort.
-----
#7 ERROR: process "/bin/sh -c apt-get install build-essential git tar curl zip unzip cmake ninja-build" did not complete successfully: exit code: 1
-----
> [ 3/11] RUN apt-get install build-essential git tar curl zip unzip cmake ninja-build:
#7 2.041 libtirpc-common libtirpc-dev libtirpc3 libtsan2 libubsan1 libuv1 libwebp7
#7 2.041 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxml2 libxmuu1
#7 2.041 libxpm4 linux-libc-dev lto-disabled-list make manpages manpages-dev netbase
#7 2.041 ninja-build openssh-client openssl patch perl perl-modules-5.36
#7 2.042 pinentry-curses publicsuffix readline-common rpcsvc-proto unzip xauth
#7 2.042 xz-utils zip
#7 2.051 0 upgraded, 147 newly installed, 0 to remove and 0 not upgraded.
#7 2.051 Need to get 123 MB of archives.
#7 2.051 After this operation, 457 MB of additional disk space will be used.
#7 2.051 Do you want to continue? [Y/n] Abort.
-----
root
root2y ago
oop try replacing apt-get install with apt-get install -y
Satan1c
Satan1cOP2y ago
k, sec
#11 14.05 CMake Error at scripts/cmake/vcpkg_find_acquire_program.cmake:163 (message):
#11 14.05 Could not find pkg-config. Please install it via your package manager:
#11 14.05
#11 14.05 sudo apt-get install pkg-config
#11 14.05 Call Stack (most recent call first):
#11 14.05 scripts/cmake/vcpkg_fixup_pkgconfig.cmake:203 (vcpkg_find_acquire_program)
#11 14.05 ports/nlohmann-json/portfile.cmake:28 (vcpkg_fixup_pkgconfig)
#11 14.05 scripts/ports.cmake:147 (include)
#11 14.05
#11 14.05
#11 14.06 error: building nlohmann-json:x64-linux failed with: BUILD_FAILED
#11 14.06 Elapsed time to handle nlohmann-json:x64-linux: 1.5 s
#11 14.06 Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
#11 14.06 Then check for known issues at:
#11 14.06 https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+nlohmann-json
#11 14.06 You can submit a new issue at:
#11 14.06 https://github.com/microsoft/vcpkg/issues/new?title=[nlohmann-json]+Build+error&body=Copy+issue+body+from+%2Fvcpkg-boot%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md

#11 14.06

#11 ERROR: process "/bin/sh -c ./vcpkg/vcpkg install dpp" did not complete successfully: exit code: 1
-----
> [ 7/11] RUN ./vcpkg/vcpkg install dpp:
#11 14.05
#11 14.05
#11 14.06 error: building nlohmann-json:x64-linux failed with: BUILD_FAILED
#11 14.06 Elapsed time to handle nlohmann-json:x64-linux: 1.5 s
#11 14.06 Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
#11 14.06 Then check for known issues at:
#11 14.06 https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+nlohmann-json
#11 14.06 You can submit a new issue at:
#11 14.06 https://github.com/microsoft/vcpkg/issues/new?title=[nlohmann-json]+Build+error&body=Copy+issue+body+from+%2Fvcpkg-boot%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md
#11 14.06
-----

Dockerfile:10
-------------------
8 | RUN git clone https://github.com/microsoft/vcpkg
9 | RUN ./vcpkg/bootstrap-vcpkg.sh
10 | >>> RUN ./vcpkg/vcpkg install dpp
11 |
12 | WORKDIR /app
-------------------
ERROR: failed to solve: process "/bin/sh -c ./vcpkg/vcpkg install dpp" did not complete successfully: exit code: 1

#11 14.05 CMake Error at scripts/cmake/vcpkg_find_acquire_program.cmake:163 (message):
#11 14.05 Could not find pkg-config. Please install it via your package manager:
#11 14.05
#11 14.05 sudo apt-get install pkg-config
#11 14.05 Call Stack (most recent call first):
#11 14.05 scripts/cmake/vcpkg_fixup_pkgconfig.cmake:203 (vcpkg_find_acquire_program)
#11 14.05 ports/nlohmann-json/portfile.cmake:28 (vcpkg_fixup_pkgconfig)
#11 14.05 scripts/ports.cmake:147 (include)
#11 14.05
#11 14.05
#11 14.06 error: building nlohmann-json:x64-linux failed with: BUILD_FAILED
#11 14.06 Elapsed time to handle nlohmann-json:x64-linux: 1.5 s
#11 14.06 Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
#11 14.06 Then check for known issues at:
#11 14.06 https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+nlohmann-json
#11 14.06 You can submit a new issue at:
#11 14.06 https://github.com/microsoft/vcpkg/issues/new?title=[nlohmann-json]+Build+error&body=Copy+issue+body+from+%2Fvcpkg-boot%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md

#11 14.06

#11 ERROR: process "/bin/sh -c ./vcpkg/vcpkg install dpp" did not complete successfully: exit code: 1
-----
> [ 7/11] RUN ./vcpkg/vcpkg install dpp:
#11 14.05
#11 14.05
#11 14.06 error: building nlohmann-json:x64-linux failed with: BUILD_FAILED
#11 14.06 Elapsed time to handle nlohmann-json:x64-linux: 1.5 s
#11 14.06 Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
#11 14.06 Then check for known issues at:
#11 14.06 https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+nlohmann-json
#11 14.06 You can submit a new issue at:
#11 14.06 https://github.com/microsoft/vcpkg/issues/new?title=[nlohmann-json]+Build+error&body=Copy+issue+body+from+%2Fvcpkg-boot%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md
#11 14.06
-----

Dockerfile:10
-------------------
8 | RUN git clone https://github.com/microsoft/vcpkg
9 | RUN ./vcpkg/bootstrap-vcpkg.sh
10 | >>> RUN ./vcpkg/vcpkg install dpp
11 |
12 | WORKDIR /app
-------------------
ERROR: failed to solve: process "/bin/sh -c ./vcpkg/vcpkg install dpp" did not complete successfully: exit code: 1

HuTaoThink
Jack
Jack2y ago
FROM ubuntu:lunar
RUN apt-get update && apt-get install -y pkg-config
RUN apt-get install build-essential git tar curl zip unzip cmake ninja-build
WORKDIR /vcpkg-boot
RUN git clone https://github.com/microsoft/vcpkg
RUN ./vcpkg/bootstrap-vcpkg.sh
RUN ./vcpkg/vcpkg install dpp
WORKDIR /app
ADD . /app
RUN cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake
RUN cmake --build /out
ENTRYPOINT ["/out/TestBot"]
FROM ubuntu:lunar
RUN apt-get update && apt-get install -y pkg-config
RUN apt-get install build-essential git tar curl zip unzip cmake ninja-build
WORKDIR /vcpkg-boot
RUN git clone https://github.com/microsoft/vcpkg
RUN ./vcpkg/bootstrap-vcpkg.sh
RUN ./vcpkg/vcpkg install dpp
WORKDIR /app
ADD . /app
RUN cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake
RUN cmake --build /out
ENTRYPOINT ["/out/TestBot"]
root
root2y ago
Just add the -y and the pkg-config to the second install command that was already there
Satan1c
Satan1cOP2y ago
yep, now it builds, but it can't find dpp)
#15 [11/11] RUN cmake --build /out

#15 0.457 [ 50%] Building CXX object CMakeFiles/TestBot.dir/src/main.cpp.o
#15 0.467 /app/src/main.cpp:1:10: fatal error: dpp/dpp.h: No such file or directory
#15 0.467 1 | #include <dpp/dpp.h>
#15 0.467 | ^~~~~~~~~~~
#15 0.467 compilation terminated.
#15 0.469 gmake[2]: *** [CMakeFiles/TestBot.dir/build.make:76: CMakeFiles/TestBot.dir/src/main.cpp.o] Error 1
#15 0.469 gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TestBot.dir/all] Error 2
#15 0.470 gmake: *** [Makefile:91: all] Error 2
#15 ERROR: process "/bin/sh -c cmake --build /out" did not complete successfully: exit code: 2
-----

> [11/11] RUN cmake --build /out:
#15 0.457 [ 50%] Building CXX object CMakeFiles/TestBot.dir/src/main.cpp.o
#15 0.467 /app/src/main.cpp:1:10: fatal error: dpp/dpp.h: No such file or directory
#15 0.467 1 | #include <dpp/dpp.h>
#15 0.467 | ^~~~~~~~~~~
#15 0.467 compilation terminated.
#15 0.469 gmake[2]: *** [CMakeFiles/TestBot.dir/build.make:76: CMakeFiles/TestBot.dir/src/main.cpp.o] Error 1
#15 0.469 gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TestBot.dir/all] Error 2
#15 0.470 gmake: *** [Makefile:91: all] Error 2
-----
Dockerfile:17
-------------------
15 |
16 | RUN cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake
17 | >>> RUN cmake --build /out
18 |
19 | ENTRYPOINT ["/out/TestBot"]
-------------------
ERROR: failed to solve: process "/bin/sh -c cmake --build /out" did not complete successfully: exit code: 2

#15 [11/11] RUN cmake --build /out

#15 0.457 [ 50%] Building CXX object CMakeFiles/TestBot.dir/src/main.cpp.o
#15 0.467 /app/src/main.cpp:1:10: fatal error: dpp/dpp.h: No such file or directory
#15 0.467 1 | #include <dpp/dpp.h>
#15 0.467 | ^~~~~~~~~~~
#15 0.467 compilation terminated.
#15 0.469 gmake[2]: *** [CMakeFiles/TestBot.dir/build.make:76: CMakeFiles/TestBot.dir/src/main.cpp.o] Error 1
#15 0.469 gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TestBot.dir/all] Error 2
#15 0.470 gmake: *** [Makefile:91: all] Error 2
#15 ERROR: process "/bin/sh -c cmake --build /out" did not complete successfully: exit code: 2
-----

> [11/11] RUN cmake --build /out:
#15 0.457 [ 50%] Building CXX object CMakeFiles/TestBot.dir/src/main.cpp.o
#15 0.467 /app/src/main.cpp:1:10: fatal error: dpp/dpp.h: No such file or directory
#15 0.467 1 | #include <dpp/dpp.h>
#15 0.467 | ^~~~~~~~~~~
#15 0.467 compilation terminated.
#15 0.469 gmake[2]: *** [CMakeFiles/TestBot.dir/build.make:76: CMakeFiles/TestBot.dir/src/main.cpp.o] Error 1
#15 0.469 gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TestBot.dir/all] Error 2
#15 0.470 gmake: *** [Makefile:91: all] Error 2
-----
Dockerfile:17
-------------------
15 |
16 | RUN cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake
17 | >>> RUN cmake --build /out
18 |
19 | ENTRYPOINT ["/out/TestBot"]
-------------------
ERROR: failed to solve: process "/bin/sh -c cmake --build /out" did not complete successfully: exit code: 2

oh, that's cuz of vcpkg path, I guess I pass /vcpkg-boot/vcpkg or vcpkg-boot/vcpkg, but it still can't find dpp is there smth like /user/ . . . must be before it ?
root
root2y ago
nope just /vcpkg-boot/vcpkg OH Add an ENV VCPKG_PATH=/vcpkg-boot/vcpkg near the top of the Dockerfile.
Satan1c
Satan1cOP2y ago
is it necessary ? I can't just add it into a variables section ?
root
root2y ago
Oh, oops, you can
Satan1c
Satan1cOP2y ago
it can't find dpp, and idk where it searches as I suggest, it can't find dpp cuz of its path but idk where is vcpkg on host, and why cmake didn't find/include it
Jack
Jack2y ago
Do you have a dockerfile, CMakeLists.txt, or vcpkg.json file? @satan1c
Satan1c
Satan1cOP2y ago
Dockerfile & CMakeLists.txt for now I'll try to specify dpp triplet as dpp:x64-linux nah did nothing
Jack
Jack2y ago
Do you mind sending them here or sharing them with me?
Satan1c
Satan1cOP2y ago
shure sec meh again diappeared https://github.com/Satan1c/Geno/tree/dev
Jack
Jack17mo ago
Working on it, apologies for the delay.
Jack
Jack17mo ago
All fixed! Try this out and tell me if it works, fixed a few other things too but now the only deploy logs for you to worry about on your end include;
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string: construction from null is not valid
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string: construction from null is not valid
https://github.com/Satan1c/Geno/pull/35
Jack
Jack17mo ago
Odd, unsure what happened there.
Satan1c
Satan1cOP17mo ago
yep, I see the pr, I'll change some moments back, to use env vars
root
root17mo ago
Thank you, Jack
Satan1c
Satan1cOP17mo ago
now I can't run it localy)
LINK : fatal error LNK1181: cannot open input file 'sodium.lib'
but libsodium is installed
root
root17mo ago
I don't know much of anything about vcpkg or dpp
Jack
Jack17mo ago
Is it installed in a location where the linker can find it? and library search directories include the directory its located in?
Satan1c
Satan1cOP17mo ago
its installed in vcpkg, so target_link_directories(${PROJECT_NAME} PRIVATE $ENV{VCPKG_PATH}/installed/${OS_NAME}/lib) was as a fix, for drogon, but now idk why I see that removing target_link_libraries(${PROJECT_NAME} PRIVATE opus sodium) fix that on railway all works fine now
Jack
Jack17mo ago
include("$ENV{VCPKG_PATH}/scripts/buildsystems/vcpkg.cmake")
include("$ENV{VCPKG_PATH}/scripts/buildsystems/vcpkg.cmake")
replace:
target_link_directories(${PROJECT_NAME} PRIVATE $ENV{VCPKG_PATH}/installed/${OS_NAME}/lib)
target_link_directories(${PROJECT_NAME} PRIVATE $ENV{VCPKG_PATH}/installed/${OS_NAME}/lib)
with:
find_package(sodium REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE sodium)
find_package(sodium REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE sodium)
everything works?
root
root17mo ago
Why do you need opus and sodium anyway?
Satan1c
Satan1cOP17mo ago
on railway, not on my laptop :c
root
root17mo ago
iirc those are sound-related libraries
Jack
Jack17mo ago
did u try this https://discord.com/channels/713503345364697088/1127940136848592938/1128039769310502983 yur it required them had to install them so the build would complete so its prolly somewhere
Satan1c
Satan1cOP17mo ago
thats dpp dependency, for work with sound
root
root17mo ago
this isn't a music bot, is it?
Satan1c
Satan1cOP17mo ago
just a sec
CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:855 (_find_package):
By not providing "Findsodium.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "sodium", but
CMake did not find one.

Could not find a package configuration file provided by "sodium" with any
of the following names:

sodiumConfig.cmake
sodium-config.cmake

Add the installation prefix of "sodium" to CMAKE_PREFIX_PATH or set
"sodium_DIR" to a directory containing one of the above files. If "sodium"
provides a separate development package or SDK, be sure it has been
installed
CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:855 (_find_package):
By not providing "Findsodium.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "sodium", but
CMake did not find one.

Could not find a package configuration file provided by "sodium" with any
of the following names:

sodiumConfig.cmake
sodium-config.cmake

Add the installation prefix of "sodium" to CMAKE_PREFIX_PATH or set
"sodium_DIR" to a directory containing one of the above files. If "sodium"
provides a separate development package or SDK, be sure it has been
installed
pepecringe
Jack
Jack17mo ago
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_PATH}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") replace:
find_package(sodium REQUIRED)
find_package(sodium REQUIRED)
with:
find_package(sodium CONFIG REQUIRED)
find_package(sodium CONFIG REQUIRED)
Satan1c
Satan1cOP17mo ago
with that, I don't need to specify it in commands anymore ? k, I'll try
Jack
Jack17mo ago
should locate automatically hopefully 🤞
Satan1c
Satan1cOP17mo ago
nope, nothing
CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:855 (_find_package):
Could not find a package configuration file provided by "sodium" with any
of the following names:

sodiumConfig.cmake
sodium-config.cmake

Add the installation prefix of "sodium" to CMAKE_PREFIX_PATH or set
"sodium_DIR" to a directory containing one of the above files. If "sodium"
provides a separate development package or SDK, be sure it has been
installed.
CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:855 (_find_package):
Could not find a package configuration file provided by "sodium" with any
of the following names:

sodiumConfig.cmake
sodium-config.cmake

Add the installation prefix of "sodium" to CMAKE_PREFIX_PATH or set
"sodium_DIR" to a directory containing one of the above files. If "sodium"
provides a separate development package or SDK, be sure it has been
installed.
maybe it'll find by libsodium, not sodium nah, it didn't
Jack
Jack17mo ago
do u know the sodium installation path and when u run vcpkg list, its listed?
Satan1c
Satan1cOP17mo ago
Satan1c
Satan1cOP17mo ago
yep, in lib and include paths of vcpkg
Jack
Jack17mo ago
what if
set(CMAKE_PREFIX_PATH "/path/to/sodium" ${CMAKE_PREFIX_PATH})
set(CMAKE_PREFIX_PATH "/path/to/sodium" ${CMAKE_PREFIX_PATH})
Satan1c
Satan1cOP17mo ago
*also, without that bot starts fine maybe it'll be better to install lobsodium and etc with vcpkg manually in docker idk why on railway it's not installing them, like on my laptop
Jack
Jack17mo ago
only difficult part with dev env on railway is the first deployment or first few before the image caches
Satan1c
Satan1cOP17mo ago
*also opus and openssl
Jack
Jack17mo ago
¯\_(ツ)_/¯
Satan1c
Satan1cOP17mo ago
I just scroll logs, and see that may it be cuz railway is on ARM cpu, not x64/x86 ?
Satan1c
Satan1cOP17mo ago
What
Jack
Jack17mo ago
eh it should work tho, theres nothing in the code pathing out anything for an amd as opposed to anything else, no?
Satan1c
Satan1cOP17mo ago
and also, if that was the case, then it mustn't run, but it does
root
root17mo ago
It's Intel amd64 that's intel well, AMD but pretty close
Jack
Jack17mo ago
intel and amd arent the same 😭 like comparing intel and nvidia graphics cards
root
root17mo ago
compatible architectures relatively
Jack
Jack17mo ago
yh but i dont think his code references anything like that, the linker and his vcpkg should manage it
root
root17mo ago
apt packages
Satan1c
Satan1cOP17mo ago
I've tried add https://github.com/facebookincubator/fizz/blob/a009078d01f476c19a05d3ebc74055a64563d33a/build/fbcode_builder/CMake/FindSodium.cmake to cmakelists, and now new error, on railway
#15 [11/11] RUN cmake --build /out

#15 0.559 [ 50%] Building CXX object CMakeFiles/TestBot.dir/src/main.cpp.o

#15 6.704 [100%] Linking CXX executable TestBot

#15 6.724 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 6.725 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 6.758 collect2: error: ld returned 1 exit status
#15 6.760 gmake[2]: *** [CMakeFiles/TestBot.dir/build.make:101: TestBot] Error 1
#15 6.760 gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TestBot.dir/all] Error 2
#15 6.761 gmake: *** [Makefile:91: all] Error 2
#15 ERROR: process "/bin/sh -c cmake --build /out" did not complete successfully: exit code: 2

-----
> [11/11] RUN cmake --build /out:
#15 0.559 [ 50%] Building CXX object CMakeFiles/TestBot.dir/src/main.cpp.o
#15 6.704 [100%] Linking CXX executable TestBot
#15 6.724 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 6.725 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 6.758 collect2: error: ld returned 1 exit status
#15 6.760 gmake[2]: *** [CMakeFiles/TestBot.dir/build.make:101: TestBot] Error 1
#15 6.760 gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TestBot.dir/all] Error 2
#15 6.761 gmake: *** [Makefile:91: all] Error 2
-----

Dockerfile:17
-------------------
15 |
16 | RUN cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake
17 | >>> RUN cmake --build /out
18 |
19 | ENTRYPOINT ["/out/TestBot"]
-------------------
ERROR: failed to solve: process "/bin/sh -c cmake --build /out" did not complete successfully: exit code: 2

#15 [11/11] RUN cmake --build /out

#15 0.559 [ 50%] Building CXX object CMakeFiles/TestBot.dir/src/main.cpp.o

#15 6.704 [100%] Linking CXX executable TestBot

#15 6.724 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 6.725 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 6.758 collect2: error: ld returned 1 exit status
#15 6.760 gmake[2]: *** [CMakeFiles/TestBot.dir/build.make:101: TestBot] Error 1
#15 6.760 gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TestBot.dir/all] Error 2
#15 6.761 gmake: *** [Makefile:91: all] Error 2
#15 ERROR: process "/bin/sh -c cmake --build /out" did not complete successfully: exit code: 2

-----
> [11/11] RUN cmake --build /out:
#15 0.559 [ 50%] Building CXX object CMakeFiles/TestBot.dir/src/main.cpp.o
#15 6.704 [100%] Linking CXX executable TestBot
#15 6.724 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 6.725 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 6.758 collect2: error: ld returned 1 exit status
#15 6.760 gmake[2]: *** [CMakeFiles/TestBot.dir/build.make:101: TestBot] Error 1
#15 6.760 gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TestBot.dir/all] Error 2
#15 6.761 gmake: *** [Makefile:91: all] Error 2
-----

Dockerfile:17
-------------------
15 |
16 | RUN cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake
17 | >>> RUN cmake --build /out
18 |
19 | ENTRYPOINT ["/out/TestBot"]
-------------------
ERROR: failed to solve: process "/bin/sh -c cmake --build /out" did not complete successfully: exit code: 2

HuTaoThink what it trys to find, if dpp then where it take -l, if ld, then for what - & pp
#15 7.432 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.433 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.434 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.438 /usr/bin/ld: cannot find -lopus: No such file or directory

#15 7.438 /usr/bin/ld: cannot find -lsodium: No such file or directory
#15 7.439 /usr/bin/ld: cannot find -lopus: No such file or directory
#15 7.440 /usr/bin/ld: cannot find -lsodium: No such file or directory
#15 7.432 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.433 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.434 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.438 /usr/bin/ld: cannot find -lopus: No such file or directory

#15 7.438 /usr/bin/ld: cannot find -lsodium: No such file or directory
#15 7.439 /usr/bin/ld: cannot find -lopus: No such file or directory
#15 7.440 /usr/bin/ld: cannot find -lsodium: No such file or directory
what does -l mean ? idk what it tries to do oh... now I can't run it on railway, even with cmake/docker files that runs it an hour Catextraangry
root
root17mo ago
-l is the argument to link with a library
Satan1c
Satan1cOP17mo ago
#15 [11/11] RUN cmake --build /out

#15 0.480 [ 50%] Building CXX object CMakeFiles/TestBot.dir/src/main.cpp.o

#15 7.735 [100%] Linking CXX executable TestBot
#15 7.757 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.757 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.758 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.797 collect2: error: ld returned 1 exit status
#15 7.799 gmake[2]: *** [CMakeFiles/TestBot.dir/build.make:101: TestBot] Error 1

#15 7.799 gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TestBot.dir/all] Error 2
#15 7.799 gmake: *** [Makefile:91: all] Error 2
#15 ERROR: process "/bin/sh -c cmake --build /out" did not complete successfully: exit code: 2
-----
> [11/11] RUN cmake --build /out:
#15 0.480 [ 50%] Building CXX object CMakeFiles/TestBot.dir/src/main.cpp.o
#15 7.735 [100%] Linking CXX executable TestBot
#15 7.757 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.757 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.758 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.797 collect2: error: ld returned 1 exit status
#15 7.799 gmake[2]: *** [CMakeFiles/TestBot.dir/build.make:101: TestBot] Error 1
#15 7.799 gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TestBot.dir/all] Error 2
#15 7.799 gmake: *** [Makefile:91: all] Error 2
-----

Dockerfile:17
-------------------
15 |
16 | RUN cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake
17 | >>> RUN cmake --build /out
18 |
19 | ENTRYPOINT ["/out/TestBot"]
-------------------
ERROR: failed to solve: process "/bin/sh -c cmake --build /out" did not complete successfully: exit code: 2

#15 [11/11] RUN cmake --build /out

#15 0.480 [ 50%] Building CXX object CMakeFiles/TestBot.dir/src/main.cpp.o

#15 7.735 [100%] Linking CXX executable TestBot
#15 7.757 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.757 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.758 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.797 collect2: error: ld returned 1 exit status
#15 7.799 gmake[2]: *** [CMakeFiles/TestBot.dir/build.make:101: TestBot] Error 1

#15 7.799 gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TestBot.dir/all] Error 2
#15 7.799 gmake: *** [Makefile:91: all] Error 2
#15 ERROR: process "/bin/sh -c cmake --build /out" did not complete successfully: exit code: 2
-----
> [11/11] RUN cmake --build /out:
#15 0.480 [ 50%] Building CXX object CMakeFiles/TestBot.dir/src/main.cpp.o
#15 7.735 [100%] Linking CXX executable TestBot
#15 7.757 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.757 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.758 /usr/bin/ld: cannot find -ldpp: No such file or directory
#15 7.797 collect2: error: ld returned 1 exit status
#15 7.799 gmake[2]: *** [CMakeFiles/TestBot.dir/build.make:101: TestBot] Error 1
#15 7.799 gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TestBot.dir/all] Error 2
#15 7.799 gmake: *** [Makefile:91: all] Error 2
-----

Dockerfile:17
-------------------
15 |
16 | RUN cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake
17 | >>> RUN cmake --build /out
18 |
19 | ENTRYPOINT ["/out/TestBot"]
-------------------
ERROR: failed to solve: process "/bin/sh -c cmake --build /out" did not complete successfully: exit code: 2

root
root17mo ago
Could you send your CMakeLists.txt?
root
root17mo ago
Undo your last commit, you removed the bits to configure vcpkg
Satan1c
Satan1cOP17mo ago
as I see that's does nothing for now I can't uderstand from where comes that ld & -l, on railway with that cmake/docker bot just runs or doesn;t find dpp, in #include
#14 0.624 -- The C compiler identification is GNU 12.2.0

#14 0.764 -- The CXX compiler identification is GNU 12.2.0

#14 0.789 -- Detecting C compiler ABI info
#14 0.903 -- Detecting C compiler ABI info - done

#14 0.923 -- Check for working C compiler: /usr/bin/cc - skipped
#14 0.924 -- Detecting C compile features
#14 0.925 -- Detecting C compile features - done
#14 0.933 -- Detecting CXX compiler ABI info

#14 1.068 -- Detecting CXX compiler ABI info - done
#14 1.087 -- Check for working CXX compiler: /usr/bin/c++ - skipped
#14 1.087 -- Detecting CXX compile features
#14 1.088 -- Detecting CXX compile features - done
#14 1.090 CMake Error at CMakeLists.txt:8 (include):
#14 1.090 include could not find requested file:
#14 1.090
#14 1.090 /scripts/buildsystems/vcpkg.cmake
#14 1.090
#14 1.090
#14 1.113 -- Found ZLIB: /vcpkg-boot/vcpkg/installed/x64-linux/lib/libz.a (found version "1.2.13")

#14 1.208 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
#14 1.334 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success

#14 1.336 -- Found Threads: TRUE
#14 1.339 -- Found OpenSSL: /vcpkg-boot/vcpkg/installed/x64-linux/debug/lib/libcrypto.a (found version "3.1.1")
#14 1.340 -- Configuring incomplete, errors occurred!
#14 1.340 See also "/out/CMakeFiles/CMakeOutput.log".

#14 ERROR: process "/bin/sh -c cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake" did not complete successfully: exit code: 1
-----
> [10/11] RUN cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake:
#14 1.090 /scripts/buildsystems/vcpkg.cmake
#14 1.090
#14 1.090
#14 1.113 -- Found ZLIB: /vcpkg-boot/vcpkg/installed/x64-linux/lib/libz.a (found version "1.2.13")
#14 1.208 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
#14 1.334 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
#14 1.336 -- Found Threads: TRUE
#14 1.339 -- Found OpenSSL: /vcpkg-boot/vcpkg/installed/x64-linux/debug/lib/libcrypto.a (found version "3.1.1")
#14 1.340 -- Configuring incomplete, errors occurred!
#14 1.340 See also "/out/CMakeFiles/CMakeOutput.log".
-----

Dockerfile:16
-------------------
14 | ADD . /app
15 |
16 | >>> RUN cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake
17 | RUN cmake --build /out
18 |
-------------------
ERROR: failed to solve: process "/bin/sh -c cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake" did not complete successfully: exit code: 1

#14 0.624 -- The C compiler identification is GNU 12.2.0

#14 0.764 -- The CXX compiler identification is GNU 12.2.0

#14 0.789 -- Detecting C compiler ABI info
#14 0.903 -- Detecting C compiler ABI info - done

#14 0.923 -- Check for working C compiler: /usr/bin/cc - skipped
#14 0.924 -- Detecting C compile features
#14 0.925 -- Detecting C compile features - done
#14 0.933 -- Detecting CXX compiler ABI info

#14 1.068 -- Detecting CXX compiler ABI info - done
#14 1.087 -- Check for working CXX compiler: /usr/bin/c++ - skipped
#14 1.087 -- Detecting CXX compile features
#14 1.088 -- Detecting CXX compile features - done
#14 1.090 CMake Error at CMakeLists.txt:8 (include):
#14 1.090 include could not find requested file:
#14 1.090
#14 1.090 /scripts/buildsystems/vcpkg.cmake
#14 1.090
#14 1.090
#14 1.113 -- Found ZLIB: /vcpkg-boot/vcpkg/installed/x64-linux/lib/libz.a (found version "1.2.13")

#14 1.208 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
#14 1.334 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success

#14 1.336 -- Found Threads: TRUE
#14 1.339 -- Found OpenSSL: /vcpkg-boot/vcpkg/installed/x64-linux/debug/lib/libcrypto.a (found version "3.1.1")
#14 1.340 -- Configuring incomplete, errors occurred!
#14 1.340 See also "/out/CMakeFiles/CMakeOutput.log".

#14 ERROR: process "/bin/sh -c cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake" did not complete successfully: exit code: 1
-----
> [10/11] RUN cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake:
#14 1.090 /scripts/buildsystems/vcpkg.cmake
#14 1.090
#14 1.090
#14 1.113 -- Found ZLIB: /vcpkg-boot/vcpkg/installed/x64-linux/lib/libz.a (found version "1.2.13")
#14 1.208 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
#14 1.334 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
#14 1.336 -- Found Threads: TRUE
#14 1.339 -- Found OpenSSL: /vcpkg-boot/vcpkg/installed/x64-linux/debug/lib/libcrypto.a (found version "3.1.1")
#14 1.340 -- Configuring incomplete, errors occurred!
#14 1.340 See also "/out/CMakeFiles/CMakeOutput.log".
-----

Dockerfile:16
-------------------
14 | ADD . /app
15 |
16 | >>> RUN cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake
17 | RUN cmake --build /out
18 |
-------------------
ERROR: failed to solve: process "/bin/sh -c cmake -B /out -S . -DCMAKE_TOOLCHAIN_FILE=/vcpkg-boot/vcpkg/scripts/buildsystems/vcpkg.cmake" did not complete successfully: exit code: 1

omg, it doesn't get env var from the beginning, it just can't get env cryslam a trouble with Drogon, it runs but I'm getting "Application failed to respond" when I'm going to site, I guess it'll be ok if I ask it here, without creating a new thread, or it'll better to create new HuTaoThink
Adam
Adam17mo ago
Probably better to start a new one
Satan1c
Satan1cOP17mo ago
Ok
Want results from more Discord servers?
Add your server