Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into Add-action-for-publ…
Browse files Browse the repository at this point in the history
…ishing-mgconsole
  • Loading branch information
antejavor committed Sep 16, 2024
2 parents 06544c1 + e564229 commit decf1ca
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 28 deletions.
44 changes: 23 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ on:
workflow_dispatch:

env:
OFFICIAL: false
OFFICIAL: true

jobs:
build_and_test_ubuntu:
strategy:
matrix:
platform: [ubuntu-22.04]
mg_version:
- "2.19.0-rc2"
- "2.19.0"
runs-on: ${{ matrix.platform }}
steps:
- name: Set up and check memgraph download link
Expand All @@ -33,7 +33,6 @@ jobs:
echo "Memgraph download link is not valid"
exit 1
fi
- name: Install dependencies (Ubuntu 22.04)
if: matrix.platform == 'ubuntu-22.04'
run: |
Expand All @@ -43,7 +42,6 @@ jobs:
curl -L ${{ env.MEMGRAPH_DOWNLOAD_LINK }} > ~/memgraph/memgraph_${{ matrix.mg_version }}-1_amd64.deb
sudo systemctl mask memgraph
sudo dpkg -i ~/memgraph/memgraph_${{ matrix.mg_version }}-1_amd64.deb
- uses: actions/checkout@v4
- name: Install and test mgconsole
run: |
Expand All @@ -60,41 +58,45 @@ jobs:
name: "mgconsole_ctest.log"
path: build/Testing/Temporary/LastTest.log

build_windows:
if: false
runs-on: windows-latest
build_windows_mingw:
runs-on: windows-2022
strategy:
matrix:
include: [
{ msystem: MINGW64, arch: x86_64 }
]
defaults:
run:
shell: msys2 {0}
steps:
- name: Set-up repository
uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
msystem: ${{ matrix.msystem }}
update: true
install: git mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-openssl
- name: Add mingw64 to PATH
run: |
# First make sure python would resolve to the windows native python, not mingw one
echo "C:/msys64/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
echo "${{ env.pythonLocation }}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- uses: actions/checkout@v4
- name: Install mgconsole
install: >-
git base-devel
mingw-w64-${{ matrix.arch }}-toolchain
mingw-w64-${{ matrix.arch }}-cmake
mingw-w64-${{ matrix.arch }}-openssl
- name: Build and install mgconsole
run: |
$env:OPENSSL_ROOT_DIR = "C:/msys64/mingw64"
mkdir build
cd build
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make
cmake --build . --parallel
make install
- name: Save mgconsole Windows build
uses: actions/upload-artifact@v4
with:
name: "mgconsole Windows build"
path: build/src/mgconsole.exe
#ToDo(the-joksim):
# - add Windows e2e test

build_apple:
strategy:
matrix:
platform: [macos-latest]
platform: [macos-14]
runs-on: ${{ matrix.platform }}
steps:
- name: Set-up repository
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWERCASE)
# Enable explicit static linking of SSL because of generic Linux binary.
set(MGCONSOLE_STATIC_SSL OFF CACHE STRING "Statically link SSL")

# Set default instalation directory to '/usr'
# Set default installation directory to '/usr'
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# '/usr' is a special case, for more details see:
# https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html#special-cases
Expand Down
30 changes: 30 additions & 0 deletions DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

FROM debian:bullseye-slim AS builder

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
git \
cmake \
make \
gcc \
g++ \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/memgraph/mgconsole.git /mgconsole

WORKDIR /mgconsole

RUN mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make && \
make install

FROM debian:bullseye-slim

WORKDIR /mgconsole

COPY --from=builder /mgconsole/build/src/mgconsole /usr/local/bin/mgconsole

ENTRYPOINT ["mgconsole"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ change this location, use `-DCMAKE_INSTALL_PREFIX` option when running CMake.

NOTE: If you have issues compiling `mgconsole` using your compiler, please try to use
[Memgraph official toolchain](https://memgraph.notion.site/Toolchain-37c37c84382149a58d09b2ccfcb410d7).
In case you encouner any problem, please create
[a new Github issue](https://github.com/memgraph/mgconsole/issues/new).
In case you encounter any problem, please create
[a new GitHub issue](https://github.com/memgraph/mgconsole/issues/new).

## Example usage

Expand Down Expand Up @@ -181,4 +181,4 @@ special care is required:
- please use only import statements using simple MATCH, CREATE, MERGE
statements.

If you encounter any issue, please create a new [mgconsole Github issue](https://github.com/memgraph/mgconsole/issues).
If you encounter any issue, please create a new [mgconsole GitHub issue](https://github.com/memgraph/mgconsole/issues).
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ endif()
# Handle platforms
if(MGCONSOLE_ON_WINDOWS)
set(GFLAGS_WIN_LIB_SUFFIX "_static")
set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -lws2_32")
set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -lws2_32 -lcrypt32")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive")
elseif(MGCONSOLE_ON_LINUX)
# -no-pie -> https://stackoverflow.com/questions/46827433/g-compile-error-rodata-can-not-be-used-when-making-a-shared-object-recomp
Expand Down Expand Up @@ -84,7 +84,7 @@ add_dependencies(${GFLAGS_LIBRARY} gflags-proj)
ExternalProject_Add(mgclient-proj
PREFIX mgclient
GIT_REPOSITORY https://github.com/memgraph/mgclient.git
GIT_TAG v1.4.1
GIT_TAG v1.4.4
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>"
"-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
"-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}"
Expand Down
2 changes: 1 addition & 1 deletion src/utils/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ struct BatchResult {
};

// Depends on the global static string because of ...; MATCH
// The extra part is perserved for the next GetQuery call
// The extra part is preserved for the next GetQuery call
std::optional<Query> GetQuery(Replxx *replxx_instance, bool collect_info = false);

QueryResult ExecuteQuery(mg_session *session, const std::string &query);
Expand Down

0 comments on commit decf1ca

Please sign in to comment.