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

[dev] build from top of branch-2.1, set -DORC_PACKAGE_KIND= #86

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 3 additions & 8 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
@echo on

cmake -S %SRC_DIR% -Bbuild ^
-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON ^
-DBUILD_SHARED_LIBS=ON ^
-DBUILD_JAVA=False ^
-DLZ4_HOME=%LIBRARY_PREFIX% ^
-DZLIB_HOME=%LIBRARY_PREFIX% ^
-DZSTD_HOME=%LIBRARY_PREFIX% ^
-DSTOP_BUILD_ON_WARNING=OFF ^
-DProtobuf_ROOT=%LIBRARY_PREFIX% ^
-DPROTOBUF_HOME=%LIBRARY_PREFIX% ^
-DPROTOBUF_EXECUTABLE=%BUILD_PREFIX%\Library\bin\protoc.exe ^
-DSNAPPY_HOME=%LIBRARY_PREFIX% ^
-DORC_PACKAGE_KIND=vcpkg ^
-DBUILD_LIBHDFSPP=NO ^
-DBUILD_CPP_TESTS=OFF ^
-DBUILD_TOOLS=OFF ^
Expand Down
7 changes: 1 addition & 6 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,8 @@ cmake ${CMAKE_ARGS} \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_JAVA=False \
-DLZ4_HOME=$PREFIX \
-DZLIB_HOME=$PREFIX \
-DZSTD_HOME=$PREFIX \
-DProtobuf_ROOT=$PREFIX \
-DPROTOBUF_HOME=$PREFIX \
-DORC_PACKAGE_KIND=vcpkg \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for trying it! How does $PREFIX directory look like? Are libraries like ZLIB and others have their CMake package config file in it?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that Arrow has special logic for conda so that XXX_ROOT and XXX_SOURCE will be defined automatically:

if(ARROW_DEPENDENCY_SOURCE STREQUAL "CONDA")
  if(MSVC)
    set(ARROW_PACKAGE_PREFIX "$ENV{CONDA_PREFIX}/Library")
  else()
    set(ARROW_PACKAGE_PREFIX $ENV{CONDA_PREFIX})
  endif()
  set(ARROW_ACTUAL_DEPENDENCY_SOURCE "SYSTEM")
  ...
endif()

and

# For each dependency, set dependency source to global default, if unset
foreach(DEPENDENCY ${ARROW_THIRDPARTY_DEPENDENCIES})
  if("${${DEPENDENCY}_SOURCE}" STREQUAL "")
    set(${DEPENDENCY}_SOURCE ${ARROW_ACTUAL_DEPENDENCY_SOURCE})
    # If no ROOT was supplied and we have a global prefix, use it
    if(NOT ${DEPENDENCY}_ROOT AND ARROW_PACKAGE_PREFIX)
      set(${DEPENDENCY}_ROOT ${ARROW_PACKAGE_PREFIX})
    endif()
  endif()
endforeach()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does $PREFIX directory look like? Are libraries like ZLIB and others have their CMake package config file in it?

Yes, $PREFIX contains all of the following (using linux as an example):

## Package Plan ##

  environment location: /home/conda/feedstock_root/build_artifacts/orc_1740564737847/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho


The following NEW packages will be INSTALLED:

    _libgcc_mutex: 0.1-conda_forge             conda-forge
    _openmp_mutex: 4.5-2_gnu                   conda-forge
    libabseil:     20240722.0-cxx17_hbbce691_4 conda-forge
    libgcc:        14.2.0-h767d61c_2           conda-forge
    libgomp:       14.2.0-h767d61c_2           conda-forge
    libprotobuf:   5.28.3-h6128344_1           conda-forge
    libstdcxx:     14.2.0-h8f9b012_2           conda-forge
    libzlib:       1.3.1-hb9d3cd8_2            conda-forge
    lz4-c:         1.10.0-h5888daf_1           conda-forge
    snappy:        1.2.1-h8bd8927_1            conda-forge
    zlib:          1.3.1-hb9d3cd8_2            conda-forge
    zstd:          1.5.7-hb8e6e7a_1            conda-forge

The content of each of these packages can be explored online, here's zstd, for example.

-DPROTOBUF_EXECUTABLE=$BUILD_PREFIX/bin/protoc \
-DSNAPPY_HOME=$PREFIX \
-DBUILD_LIBHDFSPP=NO \
-DBUILD_CPP_TESTS=OFF \
-DSTOP_BUILD_ON_WARNING=OFF \
Expand Down
6 changes: 3 additions & 3 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ source:
url: https://archive.apache.org/dist/orc/orc-{{ version }}/orc-{{ version }}.tar.gz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to specify a github url and a commit tag? If true, I can try it by myself.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, the syntax for this is:

source:
  git_url: https://github.com/apache/orc.git
  git_rev: branch-2.1  # or 0ee235c2d92096155aaaebf87c3daf94be46882e, or ...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I will try to fix this on my end but I cannot promise the ETA.

What about releasing Apache ORC 2.1.1 with the current branch-2.1? It means that following workarounds are still needed by conda-forge:

  • Add ZLIB_xxx and ZSTD_xxx variables to ORC.
  • Patching ORC adapter test to Arrow.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about releasing Apache ORC 2.1.1 with the current branch-2.1?

Yes, this is preferable to me

It means that following workarounds are still needed [...]

We can manage for now, and we can still get rid of them later.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, thanks for confirmation!

sha256: 69d45665bfb5699b709094ba630ae4b186b19e083c4438855fc29c77125c149c
patches:
# diff from 2.1.0 to head of `branch-2.1`: https://github.com/apache/orc/commit/0ee235c2d92096155aaaebf87c3daf94be46882e
- patches/0001-combined-patch-until-https-github.com-apache-orc-com.patch
- patches/0001-Don-t-force-orc-to-be-a-static-library-let-end-user-.patch
- patches/0002-Allow-user-to-override-path-to-protoc.patch
# backport https://github.com/apache/orc/pull/2108
- patches/0003-ORC-1833-C-Fix-CMake-script-to-be-used-inside-anothe.patch

build:
number: 1
number: 2
run_exports:
- {{ pin_subpackage("orc", max_pin="x.x.x") }}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
From 2da6a76b50e719d2aec9dd46fb640c524455b1fd Mon Sep 17 00:00:00 2001
From d365dc6926ab5bc9ea9ee3d55d46ba71b7c1671b Mon Sep 17 00:00:00 2001
From: Nehal J Wani <[email protected]>
Date: Fri, 25 Sep 2020 14:49:59 -0400
Subject: [PATCH 1/3] Don't force orc to be a static library, let end user
Subject: [PATCH 1/2] Don't force orc to be a static library, let end user
control it

---
c++/src/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index 694667c06..175c032ca 100644
index e378429f1..0c5b39c53 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -200,7 +200,7 @@ if(BUILD_ENABLE_AVX512)
Expand Down
Loading
Loading