Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conda-build: Add 'windows-latest' to conda build workflow #449

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
1c4cb14
github: Add 'windows-latest' to conda build workflow
jjerphan Jun 1, 2023
d3e0058
Activate the environment before the installation
jjerphan Jun 2, 2023
e3cab68
Add dedicated job for Windows
jjerphan Jun 2, 2023
c09ad1f
Retrigger CI
jjerphan Jun 2, 2023
0d0afad
Rename environment_unix to environment-dev
jjerphan Jun 2, 2023
2677ca7
Correct OS specification
jjerphan Jun 2, 2023
b43344e
Remove vcpkg-specific config and compilers specification
jjerphan Jun 2, 2023
c15bae2
cmake: Turn on verbosity
jjerphan Jun 2, 2023
0aae86e
cmake: Adapt verbose mode
jjerphan Jun 2, 2023
6c70271
Disable flags for conda builds
jjerphan Jun 2, 2023
9fdbc4a
Reintroduce flags for Windows
jjerphan Jun 5, 2023
66fc24f
Add build dependencies
jjerphan Jun 5, 2023
033e74b
Add compilers flags for Windows in again
jjerphan Jun 5, 2023
2509a50
Do not specify toolset
jjerphan Jun 5, 2023
7584a6b
Do not specify any architecture
jjerphan Jun 5, 2023
89ee9d0
Replace FindLZ4.cmake
jjerphan Jun 2, 2023
fdc41ec
Configure C++17 for MSVC
jjerphan Jun 5, 2023
7739f74
Specify typename in exception handling
jjerphan Jun 5, 2023
081453e
Use decltype instead
jjerphan Jun 5, 2023
1ab315f
Do not try custom resolution of PCRE
jjerphan Jun 5, 2023
053eb75
Use the CMake variables generated by FindPCRE.cmake
jjerphan Jun 6, 2023
85827a9
Do not build with Remotery by default
jjerphan Jun 6, 2023
83cf64e
Define ARCTICDB_RUNTIME_{SAMPLE,SUBSAMPLE} generally
jjerphan Jun 8, 2023
f194177
Merge branch 'master' into conda-build/add-windows-latest
jjerphan Jun 8, 2023
1837095
Merge branch 'master' into conda-build/add-windows-latest
jjerphan Jun 13, 2023
df3b6e8
conda-build: Pin folly 2023.05.22.00
jjerphan Jun 13, 2023
1d431f6
Naively update vcpkg to use folly 2023.05.22.00
jjerphan Jun 13, 2023
666322f
Update vcpkg submodule
jjerphan Jun 13, 2023
12e74e2
Update vcpkg submodule
jjerphan Jun 13, 2023
20b72d9
Merge branch 'master' into conda-build/add-windows-latest
DerThorsten Jun 19, 2023
9a5d03a
conda-build: Use the same build type than folly's
jjerphan Jun 20, 2023
8e6aaf8
Merge remote-tracking branch 'upstream/master' into conda-build/add-w…
jjerphan Jul 3, 2023
90fecbe
conda-build: Just use the last version of folly for now
jjerphan Jul 3, 2023
612fdf9
build: Specify CMAKE_CXX_FLAGS_RELWITHDEBINFO for Windows
jjerphan Jul 4, 2023
9ad10cb
conda-build: Use cache variables to resolve `cl`
jjerphan Jul 4, 2023
0c91512
conda-build: Do not use protobuf 3
jjerphan Jul 4, 2023
5d06c1c
build: Reintroduce install_requires and directly use protoc
jjerphan Jul 5, 2023
d98bbc6
conda-build: Do not depend on libarrow and depend on protobuf < 4
jjerphan Jul 5, 2023
e4dcd61
conda-build: Just publish flags that are used locally for now
jjerphan Jul 5, 2023
15bf7f9
debug: Never ever use packages from PyPI and only use existing matching
jjerphan Jul 6, 2023
d00fbd5
wip: End of debug for today
jjerphan Jul 6, 2023
8602dc2
Merge branch 'master' into conda-build/add-windows-latest
jjerphan Oct 12, 2023
d8c1193
Merge branch 'master' into conda-build/add-windows-latest
jjerphan Nov 29, 2023
f6aac57
ci: Simplifications
jjerphan Nov 29, 2023
1a6baf4
Revert changes to setup.cfg
jjerphan Nov 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 50 additions & 4 deletions .github/workflows/build_with_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:
uses: SimenB/[email protected]
id: cpu-cores

- name: Install Conda environment from environment_unix.yml
- name: Install Conda environment from environment-dev.yml
uses: mamba-org/[email protected]
with:
environment-file: environment_unix.yml
environment-file: environment-dev.yml
init-shell: >-
bash
cache-environment: true
Expand Down Expand Up @@ -111,10 +111,10 @@ jobs:
uses: SimenB/[email protected]
id: cpu-cores

- name: Install Conda environment from environment_unix.yml
- name: Install Conda environment from environment-dev.yml
uses: mamba-org/[email protected]
with:
environment-file: environment_unix.yml
environment-file: environment-dev.yml
environment-name: arcticdb
init-shell: >-
bash
Expand Down Expand Up @@ -158,3 +158,49 @@ jobs:
env:
ARCTICDB_USING_CONDA: 1

win:
strategy:
matrix:
include:
- os: windows-latest

fail-fast: false
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Conda environment from environment-dev.yml
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: environment-dev.yml
environment-name: arcticdb

- name: micromamba shell hook
shell: powershell
run: |
micromamba shell hook -s cmd.exe -p C:\Users\runneradmin\micromamba-root

- name: Make build directory
run: mkdir build

- name: cmake configure
shell: cmd
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate arcticdb
# Protocol buffers compilation require not using build isolation.
python -m pip install --no-build-isolation --no-deps -v -e .
env:
ARCTICDB_USING_CONDA: 1

- name: Test with pytest
shell: cmd
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate arcticdb
cd python
export ARCTICDB_RAND_SEED=$RANDOM
python -m pytest -n ${{ steps.cpu-cores.outputs.count }} tests
env:
ARCTICDB_USING_CONDA: 1
22 changes: 19 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ option(
)


set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON" FORCE)

if(WIN32)
add_compile_definitions(NOGDI)
add_compile_definitions(WIN32_LEAN_AND_MEAN)
Expand All @@ -25,9 +27,23 @@ if(WIN32)
# We always generate the debug info on Windows since those are not in the final .dll.
# sccache needs the /Z7 format, but the linker will still produce .pdb files.
# Guide to MSVC compilation warnings https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warnings-c4000-through-c4199?view=msvc-170
set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /GR /EHsc /bigobj /Z7 /w /wd4244 /wd4267")
set(CMAKE_CXX_FLAGS_RELEASE "/MT /DNDEBUG /O2")
set(CMAKE_CXX_FLAGS_DEBUG "/MTd /RTC1 /Od")
if(${ARCTICDB_USING_CONDA})
set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /GR /EHsc /bigobj /Z7 /w /wd4244 /wd4267 /MP")
set(CMAKE_CXX_FLAGS_RELEASE "/MD /DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "/MD")

# `RelWithDebInfo` is used for conda-forge builds.
# The default for `CMAKE_CXX_FLAGS_RELWITHDEBINFO` is `/MD /Zi /O2 /Ob1 /DNDEBUG`.
# We don't want /Zi, because it uses .pdb files instead
# which are not distributed by some libraries like folly.
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Ob1 /DNDEBUG")
else()
set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /GR /EHsc /bigobj /Z7 /w /wd4244 /wd4267")
set(CMAKE_CXX_FLAGS_RELEASE "/MT /DNDEBUG /O2")
set(CMAKE_CXX_FLAGS_DEBUG "/MTd /RTC1 /Od")
set(CMAKE_CXX_FLAGS_RELEASE "/MT /DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "/MTd /RTC1")
endif()
else()
if(${ARCTICDB_USING_CONDA})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
Expand Down
10 changes: 7 additions & 3 deletions cpp/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
{
"name": "windows",
"hidden": true,
"generator": "Ninja",
"generator": "Visual Studio 17 2022",
"environment": {"cmakepreset_expected_host_system": "Windows"}
},
{
Expand All @@ -83,7 +83,11 @@
},
{
"name": "windows-cl-conda-debug",
"inherits": ["common_conda", "windows"]
"inherits": ["common_conda", "windows"],
"cacheVariables": {
"CMAKE_C_COMPILER": "cl",
"CMAKE_CXX_COMPILER": "cl"
}
},


Expand Down Expand Up @@ -123,7 +127,7 @@


{ "name": "windows-cl-release", "inherits": "windows-cl-debug", "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" }},
{ "name": "windows-cl-conda-release", "inherits": "windows-cl-conda-debug", "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } },
{ "name": "windows-cl-conda-release", "inherits": "windows-cl-conda-debug", "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo" } },
{ "name": "linux-release", "inherits": "linux-debug", "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo" } },
{ "name": "linux-conda-release", "inherits": "linux-conda-debug", "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo" } },
{ "name": "darwin-conda-release", "inherits": "darwin-conda-debug", "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo" } }
Expand Down
9 changes: 6 additions & 3 deletions cpp/arcticdb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ endif()

# Libraries baked into the internal and external Linux images are found by searching various paths
# On Windows, vcpkg will provide a "Config" which takes precedence
find_library(Pcre_LIBRARY NAMES pcre PATHS /usr/local/lib/libpcre.a REQUIRED)
if(NOT ${ARCTICDB_USING_CONDA} OR NOT WIN32)
find_library(Pcre_LIBRARY NAMES pcre PATHS /usr/local/lib/libpcre.a REQUIRED)
endif()

if (WIN32)
find_package(Iconv)
else ()
Expand Down Expand Up @@ -498,7 +501,7 @@ set (arcticdb_core_libraries
prometheus-cpp::pull
${standard_libraries}
fmt::fmt
${Protobuf_lite_LIBRARY}
# ${Protobuf_lite_LIBRARY}
${Protobuf_LIBRARY}
${LZ4_LIBRARY}
${Zstd_LIBRARY}
Expand All @@ -516,7 +519,7 @@ if(${ARCTICDB_USING_CONDA})
# We must use dynamic libraries.
list (APPEND arcticdb_core_libraries
xxHash::xxHash
pcre
${PCRE_LIBRARIES}
msgpack-c
${LMDB_LIBRARIES}
)
Expand Down
2 changes: 1 addition & 1 deletion cpp/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
{ "name": "curl", "version": "8.4.0" },
{ "name": "double-conversion", "version": "3.2.1" },
{ "name": "fmt", "version": "9.1.0#1" },
{ "name": "folly", "version-string": "2022.10.31.00#3" },
{ "name": "folly", "version-string": "2023.05.22.00" },
{ "name": "gflags", "version": "2.2.2#5" },
{ "name": "glog", "version": "0.6.0#2" },
{ "name": "gtest", "version": "1.12.1" },
Expand Down
8 changes: 4 additions & 4 deletions environment_unix.yml → environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ dependencies:
- gtest
- gflags
- doxygen
- boost-cpp
- grpcio
- grpcio-tools
- protobuf
# Build dependencies
# Host dependencies
- boost-cpp
- krb5
- lz4-c
- double-conversion
Expand All @@ -28,7 +28,7 @@ dependencies:
- cyrus-sasl
- aws-sdk-cpp
- prometheus-cpp
- libprotobuf < 4
- libprotobuf
- bitmagic
- spdlog
- azure-core-cpp
Expand All @@ -55,7 +55,7 @@ dependencies:
# Build dependencies for tests
- libarrow
# Python dependences
- python =3.10 # Python 3.11 requires protobuf>=4
- python =3.10
- packaging
- numpy
- pandas
Expand Down
30 changes: 8 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def run(self):
print(f"\nProtoc compilation (into '{output_dir}') for versions '{self.proto_vers}':")
for proto_ver in self.proto_vers:
if python >= (3, 11) and proto_ver == "3":
print(f"Python protobuf {proto_ver} is not officially supported on Python {python}. Skipping...") # e.g. https://pypi.org/project/protobuf/3.20.3/#files
# e.g. https://pypi.org/project/protobuf/3.20.3/#files
print(f"Python protobuf {proto_ver} is not officially supported on Python {python}. Skipping...")
elif python <= (3, 6) and proto_ver >= "4":
print(f"Python protobuf {proto_ver} do not run on Python {python}. Skipping...")
else:
Expand All @@ -74,32 +75,17 @@ def _compile_one_version(self, proto_ver: str, version_output_dir: str):
assert grpc_version, "Supported proto-vers arguments are " + ", ".join(self._PROTOBUF_TO_GRPC_VERSION)

# Manual virtualenv to avoid hard-coding Man internal locations
pythonpath = mkdtemp()
if not ARCTICDB_USING_CONDA:
# Python protobuf 3 and 4 are incompatible and we do not want to dictate which version of protobuf
# the user can have, so we compile the Python binding files with both versions and dynamically load
# the correct version at run time.
_log_and_run(
sys.executable,
"-mpip",
"install",
"--disable-pip-version-check",
"--target=" + pythonpath,
"grpcio-tools" + grpc_version,
f"protobuf=={proto_ver}.*",
)
env = {**os.environ, "PYTHONPATH": pythonpath, "PYTHONNOUSERSITE": "1"}
else:
# grpcio-tools is already installed in the conda environment (see environment.yml)
env = {**os.environ}
# grpcio-tools and protobuf already are installed in the conda environment (see environment.yml)
# Using protoc installed in the conda environment from conda-forge.
env = {**os.environ}
cmd = ["protoc", "--version"]
_log_and_run(*cmd, env=env)

# Compile
cmd = ["protoc", "-Icpp/proto", "--python_out=" + version_output_dir]
os.makedirs(version_output_dir, exist_ok=True)
cmd = [sys.executable, "-mgrpc_tools.protoc", "-Icpp/proto", "--python_out=" + version_output_dir]
_log_and_run(*cmd, *glob.glob(os.path.normpath("cpp/proto/arcticc/pb2/*.proto")), env=env)

shutil.rmtree(pythonpath)


class CompileProtoAndBuild(build_py):
def run(self):
Expand Down
Loading