ARROW-17838: [Python] Unify CMakeLists.txt in python/ - #14925

Merged
kou merged 13 commits into
apache:masterfrom
kou:python-cmake
Dec 21, 2022
Merged

ARROW-17838: [Python] Unify CMakeLists.txt in python/#14925
kou merged 13 commits into
apache:masterfrom
kou:python-cmake

Conversation

@kou

@koukou commented Dec 13, 2022

Copy link
Copy Markdown
Member

This also moves copying codes in setup.py to CMakeLists.txt. setup.py uses "cmake --build --target install" to put artifacts to suitable location.

This also moves copying codes in setup.py to CMakeLists.txt. setup.py
uses "cmake --build --target install" to put artifacts to suitable
location.
@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@github-actions

Copy link
Copy Markdown
Wrong oauth personal access token
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3683723044

@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

Copy link
Copy Markdown
Wrong oauth personal access token
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3683737026

@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

Hmm. Crossbow doesn't work...

@kou

kou commented Dec 14, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow -g python

@github-actions

Copy link
Copy Markdown
No such option: -g
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3698591563

@kou

kou commented Dec 15, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

This comment was marked as outdated.

@kou

kou commented Dec 15, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit test-fedora-35-python-3 test-ubuntu-20.04-python-3

@github-actions

This comment was marked as outdated.

@jorisvandenbossche

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g wheel

@jorisvandenbosschejorisvandenbossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks great!
I did a shallow review of the changes, but also tested locally and for my development setup this seems to be working nicely.

@@ -1,28 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a consequence of those pc files being removed? (are those actually usable right now? I don't think they actually get installed, so this is just cleaning up?)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Because we can't provide .pc in portable way for Python package.
.pc requires fixed install location but Python package is relocatable. Users can install it to /usr/local/lib/python*/dist-packages/pyarrow/, ~/.local/lib/python*/site-packages/pyarrow/ and so on.
If we want to keep .pc support, we need to rewrite .pc after pyarrow is installed. (This is the approach that is used by MSYS2 package.)

FYI: .pc aren't installed since our cpp/src/arrow/python/ -> python/ migration. It means that users already can't use arrow-python.pc since 10.0.0.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the conda builds don't currently test for the pc files, but they are being installed even for v>=10.

I think they should continue to be installed at least on conda, where the location is well-specified (and conda will take care of fixing the .pc files automatically).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@h-vetinari what you point to are the .pc files for libarrow, and that doesn't include the arrow_python library (anymore, since 10.0). This PR only affects the latter, and not the pc files for libarrow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have a test lined up for pkg-config metadata in conda builds that I can either push into #15014, but more likely would put in a separate PR after that one is merged (or into this one, if desired).

In any case, I think this PR should ideally be tested to not break the conda build setup (I'm happy to help with eventual adaptations).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[gh hadn't updated the page so I didn't see you comment while writing my follow-up, apologies]

Sorry I overlooked what .pc files this was pointing at. It seems there are still some .pc files being installed for pyarrow (or rather .pc.in, so probably not functional).

I don't have very strong feelings about .pc files for the python libs, but in general I think if we can create them easily (and it's not an undue maintenance burden), we should keep them for the conda builds.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

but in general I think if we can create them easily (and it's not an undue maintenance burden), we should keep them for the conda builds.

If we prepare arrow-python.pc only for conda, conda users only can use it. It's not portable. It means that developers who use pyarrow's C++ API need to support arrow-python.pc environment and no-arrow-python.pc environment.

I think that all developers who use pyarrow's C++ API use pyarrow.get_include_dir()/pyarrow.get_library_dirs()/pyarrow.get_libraries() instead of arrow-python.pc. pyarrow.* are available on conda and non-conda environments.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And to complement to what @kou said: this is very similar for numpy. There one also need to use np.get_include().

Comment threadpython/CMakeLists.txt
# Parquet
if(PYARROW_BUILD_PARQUET)
# Parquet
find_package(Parquet REQUIRED)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This hasn't yet been done at this point in the file (if you don't use parquet encryption), so I would expect this needs to stay? (although testing locally with my development setup (where I don't enable parquet encryption), it seems to work fine ..)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Good catch! Parquet is found by find_package(ArrowDataset REQUIRED) implicitly but we should call find_package(Parquet REQUIRED) explicitly. I'll fix it.

@github-actions

This comment was marked as outdated.

Comment threadcpp/cmake_modules/BuildUtils.cmake
Comment threadcpp/src/arrow/symbols.map
Comment threadpython/CMakeLists.txt
Comment threadpython/CMakeLists.txt
@AlenkaF

Copy link
Copy Markdown
Member

This is great, thanks so much!
I did not test t locally on M1 yet. Will do that asap.

@kou

kou commented Dec 18, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python -g wheel

@github-actions

Copy link
Copy Markdown

Revision: 75a7574

Submitted crossbow builds: ursacomputing/crossbow @ actions-8f625a77be

TaskStatus
test-conda-python-3.10Github Actions
test-conda-python-3.11Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-pandas-1.0Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-upstream_develGithub Actions
test-conda-python-3.9-pandas-upstream_develGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-cuda-pythonGithub Actions
test-debian-11-python-3Azure
test-fedora-35-python-3Azure
test-ubuntu-20.04-python-3Azure
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp311-arm64Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-mojave-cp310-amd64Github Actions
wheel-macos-mojave-cp311-amd64Github Actions
wheel-macos-mojave-cp37-amd64Github Actions
wheel-macos-mojave-cp38-amd64Github Actions
wheel-macos-mojave-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64Travis CI
wheel-manylinux2014-cp311-amd64Github Actions
wheel-manylinux2014-cp311-arm64Travis CI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64Travis CI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64Travis CI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64Travis CI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp311-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@kou

kou commented Dec 21, 2022

Copy link
Copy Markdown
MemberAuthor

Can we merge this?

@AlenkaFAlenkaF left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have tested it locally on M1, no issues 👍

The CI and crossbow failures are seen elsewhere also so I am happy to approve this. Thank you so much for such great optimisation in pyarrow build process 🙏

@kou

kou commented Dec 21, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks for testing it locally!

I merge this.

@kou
kou merged commit df4cb95 into apache:masterDec 21, 2022
@kou
kou deleted the python-cmake branch December 21, 2022 20:27
@ursabot

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 9ed98bf and contender = df4cb95. df4cb95 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed] test-mac-arm
[Finished ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.07% ⬆️0.0%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] df4cb958 ec2-t3-xlarge-us-east-2
[Failed] df4cb958 test-mac-arm
[Finished] df4cb958 ursa-i9-9960x
[Finished] df4cb958 ursa-thinkcentre-m75q
[Finished] 9ed98bf8 ec2-t3-xlarge-us-east-2
[Finished] 9ed98bf8 test-mac-arm
[Finished] 9ed98bf8 ursa-i9-9960x
[Finished] 9ed98bf8 ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@ursabot

Copy link
Copy Markdown

['Python', 'R'] benchmarks have high level of regressions.
ursa-i9-9960x

@ElenaHenderson

ElenaHenderson commented Dec 28, 2022

Copy link
Copy Markdown
Contributor

@kou@AlenkaF@jorisvandenbossche Benchmark builds on test-mac-arm (https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm) started failing since this change was merged into main branch:

I am reproducing this issue on test-mac-arm:


cd ~
rm -rf arrow
git clone https://github.com/apache/arrow.git
cd arrow
conda create -y -n arrow-commit -c conda-forge \
--file ci/conda_env_unix.txt \
--file ci/conda_env_cpp.txt \
--file ci/conda_env_python.txt \
compilers \
python=3.8 \
pandas \
aws-sdk-cpp \
r
conda activate arrow-commit
pip install -r python/requirements-build.txt -r python/requirements-test.txt
source dev/conbench_envs/hooks.sh set_arrow_build_and_run_env_vars
export RANLIB=`which $RANLIB`
export AR=`which $AR`
export ARROW_JEMALLOC=OFF
ci/scripts/cpp_build.sh $(pwd) $(pwd)
ci/scripts/python_build.sh $(pwd) $(pwd)
(arrow-commit) voltrondata@m1mini01 arrow % python
Python 3.8.15 | packaged by conda-forge | (default, Nov 22 2022, 08:49:06) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyarrow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/__init__.py", line 65, in <module>
import pyarrow.lib as _lib
ImportError: dlopen(/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so, 2): Library not loaded: /Users/voltrondata/arrow/python/build/lib.macosx-11.0-arm64-cpython-38/pyarrow/lib/libarrow_python.1100.dylib
Referenced from: /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
Reason: image not found
>>> 

Any advice on this? Thank you!

@kou

kou commented Dec 28, 2022

Copy link
Copy Markdown
MemberAuthor

Could you show otool -L /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so?

@ElenaHenderson

Copy link
Copy Markdown
Contributor

@kou

(arrow-commit) voltrondata@m1mini01 arrow % otool -L /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so:
/Users/voltrondata/arrow/python/build/lib.macosx-11.0-arm64-cpython-38/pyarrow/lib/libarrow_python.1100.dylib (compatibility version 1100.0.0, current version 1100.0.0)
/Users/voltrondata/miniconda3/envs/arrow-commit/lib/libarrow.1100.dylib (compatibility version 1100.0.0, current version 1100.0.0)
@rpath/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
(arrow-commit) voltrondata@m1mini01 arrow % 

@kou

kou commented Dec 29, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks.
It seems that ARROW_INSTALL_NAME_RPATH=OFF is specified explicitly: https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/2099#01855a81-39fc-4639-b82c-df63b9db8f78/34-986
Can we stop it?

@ElenaHenderson

Copy link
Copy Markdown
Contributor

@kou Thank you! Yes, we can set ARROW_INSTALL_NAME_RPATH=ON. I am going to create a new PR now and confirm that this will work for benchmark builds on all machines.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@kou@jorisvandenbossche@AlenkaF@ursabot@ElenaHenderson@h-vetinari
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

ARROW-17838: [Python] Unify CMakeLists.txt in python/ - #14925

Merged
kou merged 13 commits into
apache:masterfrom
kou:python-cmake
Dec 21, 2022
Merged

ARROW-17838: [Python] Unify CMakeLists.txt in python/#14925
kou merged 13 commits into
apache:masterfrom
kou:python-cmake

Conversation

@kou

@koukou commented Dec 13, 2022

Copy link
Copy Markdown
Member

This also moves copying codes in setup.py to CMakeLists.txt. setup.py uses "cmake --build --target install" to put artifacts to suitable location.

This also moves copying codes in setup.py to CMakeLists.txt. setup.py
uses "cmake --build --target install" to put artifacts to suitable
location.
@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@github-actions

Copy link
Copy Markdown
Wrong oauth personal access token
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3683723044

@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

Copy link
Copy Markdown
Wrong oauth personal access token
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3683737026

@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

Hmm. Crossbow doesn't work...

@kou

kou commented Dec 14, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow -g python

@github-actions

Copy link
Copy Markdown
No such option: -g
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3698591563

@kou

kou commented Dec 15, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

This comment was marked as outdated.

@kou

kou commented Dec 15, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit test-fedora-35-python-3 test-ubuntu-20.04-python-3

@github-actions

This comment was marked as outdated.

@jorisvandenbossche

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g wheel

@jorisvandenbosschejorisvandenbossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks great!
I did a shallow review of the changes, but also tested locally and for my development setup this seems to be working nicely.

@@ -1,28 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a consequence of those pc files being removed? (are those actually usable right now? I don't think they actually get installed, so this is just cleaning up?)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Because we can't provide .pc in portable way for Python package.
.pc requires fixed install location but Python package is relocatable. Users can install it to /usr/local/lib/python*/dist-packages/pyarrow/, ~/.local/lib/python*/site-packages/pyarrow/ and so on.
If we want to keep .pc support, we need to rewrite .pc after pyarrow is installed. (This is the approach that is used by MSYS2 package.)

FYI: .pc aren't installed since our cpp/src/arrow/python/ -> python/ migration. It means that users already can't use arrow-python.pc since 10.0.0.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the conda builds don't currently test for the pc files, but they are being installed even for v>=10.

I think they should continue to be installed at least on conda, where the location is well-specified (and conda will take care of fixing the .pc files automatically).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@h-vetinari what you point to are the .pc files for libarrow, and that doesn't include the arrow_python library (anymore, since 10.0). This PR only affects the latter, and not the pc files for libarrow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have a test lined up for pkg-config metadata in conda builds that I can either push into #15014, but more likely would put in a separate PR after that one is merged (or into this one, if desired).

In any case, I think this PR should ideally be tested to not break the conda build setup (I'm happy to help with eventual adaptations).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[gh hadn't updated the page so I didn't see you comment while writing my follow-up, apologies]

Sorry I overlooked what .pc files this was pointing at. It seems there are still some .pc files being installed for pyarrow (or rather .pc.in, so probably not functional).

I don't have very strong feelings about .pc files for the python libs, but in general I think if we can create them easily (and it's not an undue maintenance burden), we should keep them for the conda builds.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

but in general I think if we can create them easily (and it's not an undue maintenance burden), we should keep them for the conda builds.

If we prepare arrow-python.pc only for conda, conda users only can use it. It's not portable. It means that developers who use pyarrow's C++ API need to support arrow-python.pc environment and no-arrow-python.pc environment.

I think that all developers who use pyarrow's C++ API use pyarrow.get_include_dir()/pyarrow.get_library_dirs()/pyarrow.get_libraries() instead of arrow-python.pc. pyarrow.* are available on conda and non-conda environments.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And to complement to what @kou said: this is very similar for numpy. There one also need to use np.get_include().

Comment threadpython/CMakeLists.txt
# Parquet
if(PYARROW_BUILD_PARQUET)
# Parquet
find_package(Parquet REQUIRED)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This hasn't yet been done at this point in the file (if you don't use parquet encryption), so I would expect this needs to stay? (although testing locally with my development setup (where I don't enable parquet encryption), it seems to work fine ..)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Good catch! Parquet is found by find_package(ArrowDataset REQUIRED) implicitly but we should call find_package(Parquet REQUIRED) explicitly. I'll fix it.

@github-actions

This comment was marked as outdated.

Comment threadcpp/cmake_modules/BuildUtils.cmake
Comment threadcpp/src/arrow/symbols.map
Comment threadpython/CMakeLists.txt
Comment threadpython/CMakeLists.txt
@AlenkaF

Copy link
Copy Markdown
Member

This is great, thanks so much!
I did not test t locally on M1 yet. Will do that asap.

@kou

kou commented Dec 18, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python -g wheel

@github-actions

Copy link
Copy Markdown

Revision: 75a7574

Submitted crossbow builds: ursacomputing/crossbow @ actions-8f625a77be

TaskStatus
test-conda-python-3.10Github Actions
test-conda-python-3.11Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-pandas-1.0Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-upstream_develGithub Actions
test-conda-python-3.9-pandas-upstream_develGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-cuda-pythonGithub Actions
test-debian-11-python-3Azure
test-fedora-35-python-3Azure
test-ubuntu-20.04-python-3Azure
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp311-arm64Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-mojave-cp310-amd64Github Actions
wheel-macos-mojave-cp311-amd64Github Actions
wheel-macos-mojave-cp37-amd64Github Actions
wheel-macos-mojave-cp38-amd64Github Actions
wheel-macos-mojave-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64Travis CI
wheel-manylinux2014-cp311-amd64Github Actions
wheel-manylinux2014-cp311-arm64Travis CI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64Travis CI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64Travis CI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64Travis CI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp311-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@kou

kou commented Dec 21, 2022

Copy link
Copy Markdown
MemberAuthor

Can we merge this?

@AlenkaFAlenkaF left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have tested it locally on M1, no issues 👍

The CI and crossbow failures are seen elsewhere also so I am happy to approve this. Thank you so much for such great optimisation in pyarrow build process 🙏

@kou

kou commented Dec 21, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks for testing it locally!

I merge this.

@kou
kou merged commit df4cb95 into apache:masterDec 21, 2022
@kou
kou deleted the python-cmake branch December 21, 2022 20:27
@ursabot

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 9ed98bf and contender = df4cb95. df4cb95 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed] test-mac-arm
[Finished ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.07% ⬆️0.0%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] df4cb958 ec2-t3-xlarge-us-east-2
[Failed] df4cb958 test-mac-arm
[Finished] df4cb958 ursa-i9-9960x
[Finished] df4cb958 ursa-thinkcentre-m75q
[Finished] 9ed98bf8 ec2-t3-xlarge-us-east-2
[Finished] 9ed98bf8 test-mac-arm
[Finished] 9ed98bf8 ursa-i9-9960x
[Finished] 9ed98bf8 ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@ursabot

Copy link
Copy Markdown

['Python', 'R'] benchmarks have high level of regressions.
ursa-i9-9960x

@ElenaHenderson

ElenaHenderson commented Dec 28, 2022

Copy link
Copy Markdown
Contributor

@kou@AlenkaF@jorisvandenbossche Benchmark builds on test-mac-arm (https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm) started failing since this change was merged into main branch:

I am reproducing this issue on test-mac-arm:


cd ~
rm -rf arrow
git clone https://github.com/apache/arrow.git
cd arrow
conda create -y -n arrow-commit -c conda-forge \
--file ci/conda_env_unix.txt \
--file ci/conda_env_cpp.txt \
--file ci/conda_env_python.txt \
compilers \
python=3.8 \
pandas \
aws-sdk-cpp \
r
conda activate arrow-commit
pip install -r python/requirements-build.txt -r python/requirements-test.txt
source dev/conbench_envs/hooks.sh set_arrow_build_and_run_env_vars
export RANLIB=`which $RANLIB`
export AR=`which $AR`
export ARROW_JEMALLOC=OFF
ci/scripts/cpp_build.sh $(pwd) $(pwd)
ci/scripts/python_build.sh $(pwd) $(pwd)
(arrow-commit) voltrondata@m1mini01 arrow % python
Python 3.8.15 | packaged by conda-forge | (default, Nov 22 2022, 08:49:06) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyarrow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/__init__.py", line 65, in <module>
import pyarrow.lib as _lib
ImportError: dlopen(/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so, 2): Library not loaded: /Users/voltrondata/arrow/python/build/lib.macosx-11.0-arm64-cpython-38/pyarrow/lib/libarrow_python.1100.dylib
Referenced from: /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
Reason: image not found
>>> 

Any advice on this? Thank you!

@kou

kou commented Dec 28, 2022

Copy link
Copy Markdown
MemberAuthor

Could you show otool -L /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so?

@ElenaHenderson

Copy link
Copy Markdown
Contributor

@kou

(arrow-commit) voltrondata@m1mini01 arrow % otool -L /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so:
/Users/voltrondata/arrow/python/build/lib.macosx-11.0-arm64-cpython-38/pyarrow/lib/libarrow_python.1100.dylib (compatibility version 1100.0.0, current version 1100.0.0)
/Users/voltrondata/miniconda3/envs/arrow-commit/lib/libarrow.1100.dylib (compatibility version 1100.0.0, current version 1100.0.0)
@rpath/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
(arrow-commit) voltrondata@m1mini01 arrow % 

@kou

kou commented Dec 29, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks.
It seems that ARROW_INSTALL_NAME_RPATH=OFF is specified explicitly: https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/2099#01855a81-39fc-4639-b82c-df63b9db8f78/34-986
Can we stop it?

@ElenaHenderson

Copy link
Copy Markdown
Contributor

@kou Thank you! Yes, we can set ARROW_INSTALL_NAME_RPATH=ON. I am going to create a new PR now and confirm that this will work for benchmark builds on all machines.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@kou@jorisvandenbossche@AlenkaF@ursabot@ElenaHenderson@h-vetinari
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

ARROW-17838: [Python] Unify CMakeLists.txt in python/ - #14925

Merged
kou merged 13 commits into
apache:masterfrom
kou:python-cmake
Dec 21, 2022
Merged

ARROW-17838: [Python] Unify CMakeLists.txt in python/#14925
kou merged 13 commits into
apache:masterfrom
kou:python-cmake

Conversation

@kou

@koukou commented Dec 13, 2022

Copy link
Copy Markdown
Member

This also moves copying codes in setup.py to CMakeLists.txt. setup.py uses "cmake --build --target install" to put artifacts to suitable location.

This also moves copying codes in setup.py to CMakeLists.txt. setup.py
uses "cmake --build --target install" to put artifacts to suitable
location.
@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@github-actions

Copy link
Copy Markdown
Wrong oauth personal access token
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3683723044

@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

Copy link
Copy Markdown
Wrong oauth personal access token
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3683737026

@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

Hmm. Crossbow doesn't work...

@kou

kou commented Dec 14, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow -g python

@github-actions

Copy link
Copy Markdown
No such option: -g
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3698591563

@kou

kou commented Dec 15, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

This comment was marked as outdated.

@kou

kou commented Dec 15, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit test-fedora-35-python-3 test-ubuntu-20.04-python-3

@github-actions

This comment was marked as outdated.

@jorisvandenbossche

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g wheel

@jorisvandenbosschejorisvandenbossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks great!
I did a shallow review of the changes, but also tested locally and for my development setup this seems to be working nicely.

@@ -1,28 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a consequence of those pc files being removed? (are those actually usable right now? I don't think they actually get installed, so this is just cleaning up?)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Because we can't provide .pc in portable way for Python package.
.pc requires fixed install location but Python package is relocatable. Users can install it to /usr/local/lib/python*/dist-packages/pyarrow/, ~/.local/lib/python*/site-packages/pyarrow/ and so on.
If we want to keep .pc support, we need to rewrite .pc after pyarrow is installed. (This is the approach that is used by MSYS2 package.)

FYI: .pc aren't installed since our cpp/src/arrow/python/ -> python/ migration. It means that users already can't use arrow-python.pc since 10.0.0.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the conda builds don't currently test for the pc files, but they are being installed even for v>=10.

I think they should continue to be installed at least on conda, where the location is well-specified (and conda will take care of fixing the .pc files automatically).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@h-vetinari what you point to are the .pc files for libarrow, and that doesn't include the arrow_python library (anymore, since 10.0). This PR only affects the latter, and not the pc files for libarrow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have a test lined up for pkg-config metadata in conda builds that I can either push into #15014, but more likely would put in a separate PR after that one is merged (or into this one, if desired).

In any case, I think this PR should ideally be tested to not break the conda build setup (I'm happy to help with eventual adaptations).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[gh hadn't updated the page so I didn't see you comment while writing my follow-up, apologies]

Sorry I overlooked what .pc files this was pointing at. It seems there are still some .pc files being installed for pyarrow (or rather .pc.in, so probably not functional).

I don't have very strong feelings about .pc files for the python libs, but in general I think if we can create them easily (and it's not an undue maintenance burden), we should keep them for the conda builds.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

but in general I think if we can create them easily (and it's not an undue maintenance burden), we should keep them for the conda builds.

If we prepare arrow-python.pc only for conda, conda users only can use it. It's not portable. It means that developers who use pyarrow's C++ API need to support arrow-python.pc environment and no-arrow-python.pc environment.

I think that all developers who use pyarrow's C++ API use pyarrow.get_include_dir()/pyarrow.get_library_dirs()/pyarrow.get_libraries() instead of arrow-python.pc. pyarrow.* are available on conda and non-conda environments.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And to complement to what @kou said: this is very similar for numpy. There one also need to use np.get_include().

Comment threadpython/CMakeLists.txt
# Parquet
if(PYARROW_BUILD_PARQUET)
# Parquet
find_package(Parquet REQUIRED)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This hasn't yet been done at this point in the file (if you don't use parquet encryption), so I would expect this needs to stay? (although testing locally with my development setup (where I don't enable parquet encryption), it seems to work fine ..)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Good catch! Parquet is found by find_package(ArrowDataset REQUIRED) implicitly but we should call find_package(Parquet REQUIRED) explicitly. I'll fix it.

@github-actions

This comment was marked as outdated.

Comment threadcpp/cmake_modules/BuildUtils.cmake
Comment threadcpp/src/arrow/symbols.map
Comment threadpython/CMakeLists.txt
Comment threadpython/CMakeLists.txt
@AlenkaF

Copy link
Copy Markdown
Member

This is great, thanks so much!
I did not test t locally on M1 yet. Will do that asap.

@kou

kou commented Dec 18, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python -g wheel

@github-actions

Copy link
Copy Markdown

Revision: 75a7574

Submitted crossbow builds: ursacomputing/crossbow @ actions-8f625a77be

TaskStatus
test-conda-python-3.10Github Actions
test-conda-python-3.11Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-pandas-1.0Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-upstream_develGithub Actions
test-conda-python-3.9-pandas-upstream_develGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-cuda-pythonGithub Actions
test-debian-11-python-3Azure
test-fedora-35-python-3Azure
test-ubuntu-20.04-python-3Azure
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp311-arm64Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-mojave-cp310-amd64Github Actions
wheel-macos-mojave-cp311-amd64Github Actions
wheel-macos-mojave-cp37-amd64Github Actions
wheel-macos-mojave-cp38-amd64Github Actions
wheel-macos-mojave-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64Travis CI
wheel-manylinux2014-cp311-amd64Github Actions
wheel-manylinux2014-cp311-arm64Travis CI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64Travis CI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64Travis CI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64Travis CI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp311-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@kou

kou commented Dec 21, 2022

Copy link
Copy Markdown
MemberAuthor

Can we merge this?

@AlenkaFAlenkaF left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have tested it locally on M1, no issues 👍

The CI and crossbow failures are seen elsewhere also so I am happy to approve this. Thank you so much for such great optimisation in pyarrow build process 🙏

@kou

kou commented Dec 21, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks for testing it locally!

I merge this.

@kou
kou merged commit df4cb95 into apache:masterDec 21, 2022
@kou
kou deleted the python-cmake branch December 21, 2022 20:27
@ursabot

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 9ed98bf and contender = df4cb95. df4cb95 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed] test-mac-arm
[Finished ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.07% ⬆️0.0%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] df4cb958 ec2-t3-xlarge-us-east-2
[Failed] df4cb958 test-mac-arm
[Finished] df4cb958 ursa-i9-9960x
[Finished] df4cb958 ursa-thinkcentre-m75q
[Finished] 9ed98bf8 ec2-t3-xlarge-us-east-2
[Finished] 9ed98bf8 test-mac-arm
[Finished] 9ed98bf8 ursa-i9-9960x
[Finished] 9ed98bf8 ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@ursabot

Copy link
Copy Markdown

['Python', 'R'] benchmarks have high level of regressions.
ursa-i9-9960x

@ElenaHenderson

ElenaHenderson commented Dec 28, 2022

Copy link
Copy Markdown
Contributor

@kou@AlenkaF@jorisvandenbossche Benchmark builds on test-mac-arm (https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm) started failing since this change was merged into main branch:

I am reproducing this issue on test-mac-arm:


cd ~
rm -rf arrow
git clone https://github.com/apache/arrow.git
cd arrow
conda create -y -n arrow-commit -c conda-forge \
--file ci/conda_env_unix.txt \
--file ci/conda_env_cpp.txt \
--file ci/conda_env_python.txt \
compilers \
python=3.8 \
pandas \
aws-sdk-cpp \
r
conda activate arrow-commit
pip install -r python/requirements-build.txt -r python/requirements-test.txt
source dev/conbench_envs/hooks.sh set_arrow_build_and_run_env_vars
export RANLIB=`which $RANLIB`
export AR=`which $AR`
export ARROW_JEMALLOC=OFF
ci/scripts/cpp_build.sh $(pwd) $(pwd)
ci/scripts/python_build.sh $(pwd) $(pwd)
(arrow-commit) voltrondata@m1mini01 arrow % python
Python 3.8.15 | packaged by conda-forge | (default, Nov 22 2022, 08:49:06) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyarrow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/__init__.py", line 65, in <module>
import pyarrow.lib as _lib
ImportError: dlopen(/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so, 2): Library not loaded: /Users/voltrondata/arrow/python/build/lib.macosx-11.0-arm64-cpython-38/pyarrow/lib/libarrow_python.1100.dylib
Referenced from: /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
Reason: image not found
>>> 

Any advice on this? Thank you!

@kou

kou commented Dec 28, 2022

Copy link
Copy Markdown
MemberAuthor

Could you show otool -L /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so?

@ElenaHenderson

Copy link
Copy Markdown
Contributor

@kou

(arrow-commit) voltrondata@m1mini01 arrow % otool -L /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so:
/Users/voltrondata/arrow/python/build/lib.macosx-11.0-arm64-cpython-38/pyarrow/lib/libarrow_python.1100.dylib (compatibility version 1100.0.0, current version 1100.0.0)
/Users/voltrondata/miniconda3/envs/arrow-commit/lib/libarrow.1100.dylib (compatibility version 1100.0.0, current version 1100.0.0)
@rpath/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
(arrow-commit) voltrondata@m1mini01 arrow % 

@kou

kou commented Dec 29, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks.
It seems that ARROW_INSTALL_NAME_RPATH=OFF is specified explicitly: https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/2099#01855a81-39fc-4639-b82c-df63b9db8f78/34-986
Can we stop it?

@ElenaHenderson

Copy link
Copy Markdown
Contributor

@kou Thank you! Yes, we can set ARROW_INSTALL_NAME_RPATH=ON. I am going to create a new PR now and confirm that this will work for benchmark builds on all machines.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@kou@jorisvandenbossche@AlenkaF@ursabot@ElenaHenderson@h-vetinari
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

ARROW-17838: [Python] Unify CMakeLists.txt in python/ - #14925

Merged
kou merged 13 commits into
apache:masterfrom
kou:python-cmake
Dec 21, 2022
Merged

ARROW-17838: [Python] Unify CMakeLists.txt in python/#14925
kou merged 13 commits into
apache:masterfrom
kou:python-cmake

Conversation

@kou

@koukou commented Dec 13, 2022

Copy link
Copy Markdown
Member

This also moves copying codes in setup.py to CMakeLists.txt. setup.py uses "cmake --build --target install" to put artifacts to suitable location.

This also moves copying codes in setup.py to CMakeLists.txt. setup.py
uses "cmake --build --target install" to put artifacts to suitable
location.
@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@github-actions

Copy link
Copy Markdown
Wrong oauth personal access token
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3683723044

@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

Copy link
Copy Markdown
Wrong oauth personal access token
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3683737026

@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

Hmm. Crossbow doesn't work...

@kou

kou commented Dec 14, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow -g python

@github-actions

Copy link
Copy Markdown
No such option: -g
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3698591563

@kou

kou commented Dec 15, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

This comment was marked as outdated.

@kou

kou commented Dec 15, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit test-fedora-35-python-3 test-ubuntu-20.04-python-3

@github-actions

This comment was marked as outdated.

@jorisvandenbossche

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g wheel

@jorisvandenbosschejorisvandenbossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks great!
I did a shallow review of the changes, but also tested locally and for my development setup this seems to be working nicely.

@@ -1,28 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a consequence of those pc files being removed? (are those actually usable right now? I don't think they actually get installed, so this is just cleaning up?)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Because we can't provide .pc in portable way for Python package.
.pc requires fixed install location but Python package is relocatable. Users can install it to /usr/local/lib/python*/dist-packages/pyarrow/, ~/.local/lib/python*/site-packages/pyarrow/ and so on.
If we want to keep .pc support, we need to rewrite .pc after pyarrow is installed. (This is the approach that is used by MSYS2 package.)

FYI: .pc aren't installed since our cpp/src/arrow/python/ -> python/ migration. It means that users already can't use arrow-python.pc since 10.0.0.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the conda builds don't currently test for the pc files, but they are being installed even for v>=10.

I think they should continue to be installed at least on conda, where the location is well-specified (and conda will take care of fixing the .pc files automatically).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@h-vetinari what you point to are the .pc files for libarrow, and that doesn't include the arrow_python library (anymore, since 10.0). This PR only affects the latter, and not the pc files for libarrow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have a test lined up for pkg-config metadata in conda builds that I can either push into #15014, but more likely would put in a separate PR after that one is merged (or into this one, if desired).

In any case, I think this PR should ideally be tested to not break the conda build setup (I'm happy to help with eventual adaptations).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[gh hadn't updated the page so I didn't see you comment while writing my follow-up, apologies]

Sorry I overlooked what .pc files this was pointing at. It seems there are still some .pc files being installed for pyarrow (or rather .pc.in, so probably not functional).

I don't have very strong feelings about .pc files for the python libs, but in general I think if we can create them easily (and it's not an undue maintenance burden), we should keep them for the conda builds.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

but in general I think if we can create them easily (and it's not an undue maintenance burden), we should keep them for the conda builds.

If we prepare arrow-python.pc only for conda, conda users only can use it. It's not portable. It means that developers who use pyarrow's C++ API need to support arrow-python.pc environment and no-arrow-python.pc environment.

I think that all developers who use pyarrow's C++ API use pyarrow.get_include_dir()/pyarrow.get_library_dirs()/pyarrow.get_libraries() instead of arrow-python.pc. pyarrow.* are available on conda and non-conda environments.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And to complement to what @kou said: this is very similar for numpy. There one also need to use np.get_include().

Comment threadpython/CMakeLists.txt
# Parquet
if(PYARROW_BUILD_PARQUET)
# Parquet
find_package(Parquet REQUIRED)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This hasn't yet been done at this point in the file (if you don't use parquet encryption), so I would expect this needs to stay? (although testing locally with my development setup (where I don't enable parquet encryption), it seems to work fine ..)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Good catch! Parquet is found by find_package(ArrowDataset REQUIRED) implicitly but we should call find_package(Parquet REQUIRED) explicitly. I'll fix it.

@github-actions

This comment was marked as outdated.

Comment threadcpp/cmake_modules/BuildUtils.cmake
Comment threadcpp/src/arrow/symbols.map
Comment threadpython/CMakeLists.txt
Comment threadpython/CMakeLists.txt
@AlenkaF

Copy link
Copy Markdown
Member

This is great, thanks so much!
I did not test t locally on M1 yet. Will do that asap.

@kou

kou commented Dec 18, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python -g wheel

@github-actions

Copy link
Copy Markdown

Revision: 75a7574

Submitted crossbow builds: ursacomputing/crossbow @ actions-8f625a77be

TaskStatus
test-conda-python-3.10Github Actions
test-conda-python-3.11Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-pandas-1.0Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-upstream_develGithub Actions
test-conda-python-3.9-pandas-upstream_develGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-cuda-pythonGithub Actions
test-debian-11-python-3Azure
test-fedora-35-python-3Azure
test-ubuntu-20.04-python-3Azure
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp311-arm64Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-mojave-cp310-amd64Github Actions
wheel-macos-mojave-cp311-amd64Github Actions
wheel-macos-mojave-cp37-amd64Github Actions
wheel-macos-mojave-cp38-amd64Github Actions
wheel-macos-mojave-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64Travis CI
wheel-manylinux2014-cp311-amd64Github Actions
wheel-manylinux2014-cp311-arm64Travis CI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64Travis CI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64Travis CI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64Travis CI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp311-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@kou

kou commented Dec 21, 2022

Copy link
Copy Markdown
MemberAuthor

Can we merge this?

@AlenkaFAlenkaF left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have tested it locally on M1, no issues 👍

The CI and crossbow failures are seen elsewhere also so I am happy to approve this. Thank you so much for such great optimisation in pyarrow build process 🙏

@kou

kou commented Dec 21, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks for testing it locally!

I merge this.

@kou
kou merged commit df4cb95 into apache:masterDec 21, 2022
@kou
kou deleted the python-cmake branch December 21, 2022 20:27
@ursabot

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 9ed98bf and contender = df4cb95. df4cb95 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed] test-mac-arm
[Finished ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.07% ⬆️0.0%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] df4cb958 ec2-t3-xlarge-us-east-2
[Failed] df4cb958 test-mac-arm
[Finished] df4cb958 ursa-i9-9960x
[Finished] df4cb958 ursa-thinkcentre-m75q
[Finished] 9ed98bf8 ec2-t3-xlarge-us-east-2
[Finished] 9ed98bf8 test-mac-arm
[Finished] 9ed98bf8 ursa-i9-9960x
[Finished] 9ed98bf8 ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@ursabot

Copy link
Copy Markdown

['Python', 'R'] benchmarks have high level of regressions.
ursa-i9-9960x

@ElenaHenderson

ElenaHenderson commented Dec 28, 2022

Copy link
Copy Markdown
Contributor

@kou@AlenkaF@jorisvandenbossche Benchmark builds on test-mac-arm (https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm) started failing since this change was merged into main branch:

I am reproducing this issue on test-mac-arm:


cd ~
rm -rf arrow
git clone https://github.com/apache/arrow.git
cd arrow
conda create -y -n arrow-commit -c conda-forge \
--file ci/conda_env_unix.txt \
--file ci/conda_env_cpp.txt \
--file ci/conda_env_python.txt \
compilers \
python=3.8 \
pandas \
aws-sdk-cpp \
r
conda activate arrow-commit
pip install -r python/requirements-build.txt -r python/requirements-test.txt
source dev/conbench_envs/hooks.sh set_arrow_build_and_run_env_vars
export RANLIB=`which $RANLIB`
export AR=`which $AR`
export ARROW_JEMALLOC=OFF
ci/scripts/cpp_build.sh $(pwd) $(pwd)
ci/scripts/python_build.sh $(pwd) $(pwd)
(arrow-commit) voltrondata@m1mini01 arrow % python
Python 3.8.15 | packaged by conda-forge | (default, Nov 22 2022, 08:49:06) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyarrow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/__init__.py", line 65, in <module>
import pyarrow.lib as _lib
ImportError: dlopen(/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so, 2): Library not loaded: /Users/voltrondata/arrow/python/build/lib.macosx-11.0-arm64-cpython-38/pyarrow/lib/libarrow_python.1100.dylib
Referenced from: /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
Reason: image not found
>>> 

Any advice on this? Thank you!

@kou

kou commented Dec 28, 2022

Copy link
Copy Markdown
MemberAuthor

Could you show otool -L /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so?

@ElenaHenderson

Copy link
Copy Markdown
Contributor

@kou

(arrow-commit) voltrondata@m1mini01 arrow % otool -L /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so:
/Users/voltrondata/arrow/python/build/lib.macosx-11.0-arm64-cpython-38/pyarrow/lib/libarrow_python.1100.dylib (compatibility version 1100.0.0, current version 1100.0.0)
/Users/voltrondata/miniconda3/envs/arrow-commit/lib/libarrow.1100.dylib (compatibility version 1100.0.0, current version 1100.0.0)
@rpath/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
(arrow-commit) voltrondata@m1mini01 arrow % 

@kou

kou commented Dec 29, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks.
It seems that ARROW_INSTALL_NAME_RPATH=OFF is specified explicitly: https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/2099#01855a81-39fc-4639-b82c-df63b9db8f78/34-986
Can we stop it?

@ElenaHenderson

Copy link
Copy Markdown
Contributor

@kou Thank you! Yes, we can set ARROW_INSTALL_NAME_RPATH=ON. I am going to create a new PR now and confirm that this will work for benchmark builds on all machines.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@kou@jorisvandenbossche@AlenkaF@ursabot@ElenaHenderson@h-vetinari
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

ARROW-17838: [Python] Unify CMakeLists.txt in python/ - #14925

Merged
kou merged 13 commits into
apache:masterfrom
kou:python-cmake
Dec 21, 2022
Merged

ARROW-17838: [Python] Unify CMakeLists.txt in python/#14925
kou merged 13 commits into
apache:masterfrom
kou:python-cmake

Conversation

@kou

@koukou commented Dec 13, 2022

Copy link
Copy Markdown
Member

This also moves copying codes in setup.py to CMakeLists.txt. setup.py uses "cmake --build --target install" to put artifacts to suitable location.

This also moves copying codes in setup.py to CMakeLists.txt. setup.py
uses "cmake --build --target install" to put artifacts to suitable
location.
@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@github-actions

Copy link
Copy Markdown
Wrong oauth personal access token
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3683723044

@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

Copy link
Copy Markdown
Wrong oauth personal access token
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3683737026

@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

Hmm. Crossbow doesn't work...

@kou

kou commented Dec 14, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow -g python

@github-actions

Copy link
Copy Markdown
No such option: -g
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3698591563

@kou

kou commented Dec 15, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

This comment was marked as outdated.

@kou

kou commented Dec 15, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit test-fedora-35-python-3 test-ubuntu-20.04-python-3

@github-actions

This comment was marked as outdated.

@jorisvandenbossche

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g wheel

@jorisvandenbosschejorisvandenbossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks great!
I did a shallow review of the changes, but also tested locally and for my development setup this seems to be working nicely.

@@ -1,28 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a consequence of those pc files being removed? (are those actually usable right now? I don't think they actually get installed, so this is just cleaning up?)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Because we can't provide .pc in portable way for Python package.
.pc requires fixed install location but Python package is relocatable. Users can install it to /usr/local/lib/python*/dist-packages/pyarrow/, ~/.local/lib/python*/site-packages/pyarrow/ and so on.
If we want to keep .pc support, we need to rewrite .pc after pyarrow is installed. (This is the approach that is used by MSYS2 package.)

FYI: .pc aren't installed since our cpp/src/arrow/python/ -> python/ migration. It means that users already can't use arrow-python.pc since 10.0.0.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the conda builds don't currently test for the pc files, but they are being installed even for v>=10.

I think they should continue to be installed at least on conda, where the location is well-specified (and conda will take care of fixing the .pc files automatically).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@h-vetinari what you point to are the .pc files for libarrow, and that doesn't include the arrow_python library (anymore, since 10.0). This PR only affects the latter, and not the pc files for libarrow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have a test lined up for pkg-config metadata in conda builds that I can either push into #15014, but more likely would put in a separate PR after that one is merged (or into this one, if desired).

In any case, I think this PR should ideally be tested to not break the conda build setup (I'm happy to help with eventual adaptations).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[gh hadn't updated the page so I didn't see you comment while writing my follow-up, apologies]

Sorry I overlooked what .pc files this was pointing at. It seems there are still some .pc files being installed for pyarrow (or rather .pc.in, so probably not functional).

I don't have very strong feelings about .pc files for the python libs, but in general I think if we can create them easily (and it's not an undue maintenance burden), we should keep them for the conda builds.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

but in general I think if we can create them easily (and it's not an undue maintenance burden), we should keep them for the conda builds.

If we prepare arrow-python.pc only for conda, conda users only can use it. It's not portable. It means that developers who use pyarrow's C++ API need to support arrow-python.pc environment and no-arrow-python.pc environment.

I think that all developers who use pyarrow's C++ API use pyarrow.get_include_dir()/pyarrow.get_library_dirs()/pyarrow.get_libraries() instead of arrow-python.pc. pyarrow.* are available on conda and non-conda environments.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And to complement to what @kou said: this is very similar for numpy. There one also need to use np.get_include().

Comment threadpython/CMakeLists.txt
# Parquet
if(PYARROW_BUILD_PARQUET)
# Parquet
find_package(Parquet REQUIRED)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This hasn't yet been done at this point in the file (if you don't use parquet encryption), so I would expect this needs to stay? (although testing locally with my development setup (where I don't enable parquet encryption), it seems to work fine ..)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Good catch! Parquet is found by find_package(ArrowDataset REQUIRED) implicitly but we should call find_package(Parquet REQUIRED) explicitly. I'll fix it.

@github-actions

This comment was marked as outdated.

Comment threadcpp/cmake_modules/BuildUtils.cmake
Comment threadcpp/src/arrow/symbols.map
Comment threadpython/CMakeLists.txt
Comment threadpython/CMakeLists.txt
@AlenkaF

Copy link
Copy Markdown
Member

This is great, thanks so much!
I did not test t locally on M1 yet. Will do that asap.

@kou

kou commented Dec 18, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python -g wheel

@github-actions

Copy link
Copy Markdown

Revision: 75a7574

Submitted crossbow builds: ursacomputing/crossbow @ actions-8f625a77be

TaskStatus
test-conda-python-3.10Github Actions
test-conda-python-3.11Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-pandas-1.0Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-upstream_develGithub Actions
test-conda-python-3.9-pandas-upstream_develGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-cuda-pythonGithub Actions
test-debian-11-python-3Azure
test-fedora-35-python-3Azure
test-ubuntu-20.04-python-3Azure
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp311-arm64Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-mojave-cp310-amd64Github Actions
wheel-macos-mojave-cp311-amd64Github Actions
wheel-macos-mojave-cp37-amd64Github Actions
wheel-macos-mojave-cp38-amd64Github Actions
wheel-macos-mojave-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64Travis CI
wheel-manylinux2014-cp311-amd64Github Actions
wheel-manylinux2014-cp311-arm64Travis CI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64Travis CI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64Travis CI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64Travis CI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp311-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@kou

kou commented Dec 21, 2022

Copy link
Copy Markdown
MemberAuthor

Can we merge this?

@AlenkaFAlenkaF left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have tested it locally on M1, no issues 👍

The CI and crossbow failures are seen elsewhere also so I am happy to approve this. Thank you so much for such great optimisation in pyarrow build process 🙏

@kou

kou commented Dec 21, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks for testing it locally!

I merge this.

@kou
kou merged commit df4cb95 into apache:masterDec 21, 2022
@kou
kou deleted the python-cmake branch December 21, 2022 20:27
@ursabot

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 9ed98bf and contender = df4cb95. df4cb95 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed] test-mac-arm
[Finished ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.07% ⬆️0.0%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] df4cb958 ec2-t3-xlarge-us-east-2
[Failed] df4cb958 test-mac-arm
[Finished] df4cb958 ursa-i9-9960x
[Finished] df4cb958 ursa-thinkcentre-m75q
[Finished] 9ed98bf8 ec2-t3-xlarge-us-east-2
[Finished] 9ed98bf8 test-mac-arm
[Finished] 9ed98bf8 ursa-i9-9960x
[Finished] 9ed98bf8 ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@ursabot

Copy link
Copy Markdown

['Python', 'R'] benchmarks have high level of regressions.
ursa-i9-9960x

@ElenaHenderson

ElenaHenderson commented Dec 28, 2022

Copy link
Copy Markdown
Contributor

@kou@AlenkaF@jorisvandenbossche Benchmark builds on test-mac-arm (https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm) started failing since this change was merged into main branch:

I am reproducing this issue on test-mac-arm:


cd ~
rm -rf arrow
git clone https://github.com/apache/arrow.git
cd arrow
conda create -y -n arrow-commit -c conda-forge \
--file ci/conda_env_unix.txt \
--file ci/conda_env_cpp.txt \
--file ci/conda_env_python.txt \
compilers \
python=3.8 \
pandas \
aws-sdk-cpp \
r
conda activate arrow-commit
pip install -r python/requirements-build.txt -r python/requirements-test.txt
source dev/conbench_envs/hooks.sh set_arrow_build_and_run_env_vars
export RANLIB=`which $RANLIB`
export AR=`which $AR`
export ARROW_JEMALLOC=OFF
ci/scripts/cpp_build.sh $(pwd) $(pwd)
ci/scripts/python_build.sh $(pwd) $(pwd)
(arrow-commit) voltrondata@m1mini01 arrow % python
Python 3.8.15 | packaged by conda-forge | (default, Nov 22 2022, 08:49:06) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyarrow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/__init__.py", line 65, in <module>
import pyarrow.lib as _lib
ImportError: dlopen(/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so, 2): Library not loaded: /Users/voltrondata/arrow/python/build/lib.macosx-11.0-arm64-cpython-38/pyarrow/lib/libarrow_python.1100.dylib
Referenced from: /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
Reason: image not found
>>> 

Any advice on this? Thank you!

@kou

kou commented Dec 28, 2022

Copy link
Copy Markdown
MemberAuthor

Could you show otool -L /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so?

@ElenaHenderson

Copy link
Copy Markdown
Contributor

@kou

(arrow-commit) voltrondata@m1mini01 arrow % otool -L /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so:
/Users/voltrondata/arrow/python/build/lib.macosx-11.0-arm64-cpython-38/pyarrow/lib/libarrow_python.1100.dylib (compatibility version 1100.0.0, current version 1100.0.0)
/Users/voltrondata/miniconda3/envs/arrow-commit/lib/libarrow.1100.dylib (compatibility version 1100.0.0, current version 1100.0.0)
@rpath/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
(arrow-commit) voltrondata@m1mini01 arrow % 

@kou

kou commented Dec 29, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks.
It seems that ARROW_INSTALL_NAME_RPATH=OFF is specified explicitly: https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/2099#01855a81-39fc-4639-b82c-df63b9db8f78/34-986
Can we stop it?

@ElenaHenderson

Copy link
Copy Markdown
Contributor

@kou Thank you! Yes, we can set ARROW_INSTALL_NAME_RPATH=ON. I am going to create a new PR now and confirm that this will work for benchmark builds on all machines.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@kou@jorisvandenbossche@AlenkaF@ursabot@ElenaHenderson@h-vetinari
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

ARROW-17838: [Python] Unify CMakeLists.txt in python/ - #14925

Merged
kou merged 13 commits into
apache:masterfrom
kou:python-cmake
Dec 21, 2022
Merged

ARROW-17838: [Python] Unify CMakeLists.txt in python/#14925
kou merged 13 commits into
apache:masterfrom
kou:python-cmake

Conversation

@kou

@koukou commented Dec 13, 2022

Copy link
Copy Markdown
Member

This also moves copying codes in setup.py to CMakeLists.txt. setup.py uses "cmake --build --target install" to put artifacts to suitable location.

This also moves copying codes in setup.py to CMakeLists.txt. setup.py
uses "cmake --build --target install" to put artifacts to suitable
location.
@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@github-actions

Copy link
Copy Markdown
Wrong oauth personal access token
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3683723044

@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

Copy link
Copy Markdown
Wrong oauth personal access token
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3683737026

@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

Hmm. Crossbow doesn't work...

@kou

kou commented Dec 14, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow -g python

@github-actions

Copy link
Copy Markdown
No such option: -g
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3698591563

@kou

kou commented Dec 15, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

This comment was marked as outdated.

@kou

kou commented Dec 15, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit test-fedora-35-python-3 test-ubuntu-20.04-python-3

@github-actions

This comment was marked as outdated.

@jorisvandenbossche

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g wheel

@jorisvandenbosschejorisvandenbossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks great!
I did a shallow review of the changes, but also tested locally and for my development setup this seems to be working nicely.

@@ -1,28 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a consequence of those pc files being removed? (are those actually usable right now? I don't think they actually get installed, so this is just cleaning up?)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Because we can't provide .pc in portable way for Python package.
.pc requires fixed install location but Python package is relocatable. Users can install it to /usr/local/lib/python*/dist-packages/pyarrow/, ~/.local/lib/python*/site-packages/pyarrow/ and so on.
If we want to keep .pc support, we need to rewrite .pc after pyarrow is installed. (This is the approach that is used by MSYS2 package.)

FYI: .pc aren't installed since our cpp/src/arrow/python/ -> python/ migration. It means that users already can't use arrow-python.pc since 10.0.0.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the conda builds don't currently test for the pc files, but they are being installed even for v>=10.

I think they should continue to be installed at least on conda, where the location is well-specified (and conda will take care of fixing the .pc files automatically).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@h-vetinari what you point to are the .pc files for libarrow, and that doesn't include the arrow_python library (anymore, since 10.0). This PR only affects the latter, and not the pc files for libarrow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have a test lined up for pkg-config metadata in conda builds that I can either push into #15014, but more likely would put in a separate PR after that one is merged (or into this one, if desired).

In any case, I think this PR should ideally be tested to not break the conda build setup (I'm happy to help with eventual adaptations).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[gh hadn't updated the page so I didn't see you comment while writing my follow-up, apologies]

Sorry I overlooked what .pc files this was pointing at. It seems there are still some .pc files being installed for pyarrow (or rather .pc.in, so probably not functional).

I don't have very strong feelings about .pc files for the python libs, but in general I think if we can create them easily (and it's not an undue maintenance burden), we should keep them for the conda builds.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

but in general I think if we can create them easily (and it's not an undue maintenance burden), we should keep them for the conda builds.

If we prepare arrow-python.pc only for conda, conda users only can use it. It's not portable. It means that developers who use pyarrow's C++ API need to support arrow-python.pc environment and no-arrow-python.pc environment.

I think that all developers who use pyarrow's C++ API use pyarrow.get_include_dir()/pyarrow.get_library_dirs()/pyarrow.get_libraries() instead of arrow-python.pc. pyarrow.* are available on conda and non-conda environments.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And to complement to what @kou said: this is very similar for numpy. There one also need to use np.get_include().

Comment threadpython/CMakeLists.txt
# Parquet
if(PYARROW_BUILD_PARQUET)
# Parquet
find_package(Parquet REQUIRED)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This hasn't yet been done at this point in the file (if you don't use parquet encryption), so I would expect this needs to stay? (although testing locally with my development setup (where I don't enable parquet encryption), it seems to work fine ..)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Good catch! Parquet is found by find_package(ArrowDataset REQUIRED) implicitly but we should call find_package(Parquet REQUIRED) explicitly. I'll fix it.

@github-actions

This comment was marked as outdated.

Comment threadcpp/cmake_modules/BuildUtils.cmake
Comment threadcpp/src/arrow/symbols.map
Comment threadpython/CMakeLists.txt
Comment threadpython/CMakeLists.txt
@AlenkaF

Copy link
Copy Markdown
Member

This is great, thanks so much!
I did not test t locally on M1 yet. Will do that asap.

@kou

kou commented Dec 18, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python -g wheel

@github-actions

Copy link
Copy Markdown

Revision: 75a7574

Submitted crossbow builds: ursacomputing/crossbow @ actions-8f625a77be

TaskStatus
test-conda-python-3.10Github Actions
test-conda-python-3.11Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-pandas-1.0Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-upstream_develGithub Actions
test-conda-python-3.9-pandas-upstream_develGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-cuda-pythonGithub Actions
test-debian-11-python-3Azure
test-fedora-35-python-3Azure
test-ubuntu-20.04-python-3Azure
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp311-arm64Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-mojave-cp310-amd64Github Actions
wheel-macos-mojave-cp311-amd64Github Actions
wheel-macos-mojave-cp37-amd64Github Actions
wheel-macos-mojave-cp38-amd64Github Actions
wheel-macos-mojave-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64Travis CI
wheel-manylinux2014-cp311-amd64Github Actions
wheel-manylinux2014-cp311-arm64Travis CI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64Travis CI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64Travis CI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64Travis CI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp311-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@kou

kou commented Dec 21, 2022

Copy link
Copy Markdown
MemberAuthor

Can we merge this?

@AlenkaFAlenkaF left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have tested it locally on M1, no issues 👍

The CI and crossbow failures are seen elsewhere also so I am happy to approve this. Thank you so much for such great optimisation in pyarrow build process 🙏

@kou

kou commented Dec 21, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks for testing it locally!

I merge this.

@kou
kou merged commit df4cb95 into apache:masterDec 21, 2022
@kou
kou deleted the python-cmake branch December 21, 2022 20:27
@ursabot

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 9ed98bf and contender = df4cb95. df4cb95 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed] test-mac-arm
[Finished ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.07% ⬆️0.0%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] df4cb958 ec2-t3-xlarge-us-east-2
[Failed] df4cb958 test-mac-arm
[Finished] df4cb958 ursa-i9-9960x
[Finished] df4cb958 ursa-thinkcentre-m75q
[Finished] 9ed98bf8 ec2-t3-xlarge-us-east-2
[Finished] 9ed98bf8 test-mac-arm
[Finished] 9ed98bf8 ursa-i9-9960x
[Finished] 9ed98bf8 ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@ursabot

Copy link
Copy Markdown

['Python', 'R'] benchmarks have high level of regressions.
ursa-i9-9960x

@ElenaHenderson

ElenaHenderson commented Dec 28, 2022

Copy link
Copy Markdown
Contributor

@kou@AlenkaF@jorisvandenbossche Benchmark builds on test-mac-arm (https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm) started failing since this change was merged into main branch:

I am reproducing this issue on test-mac-arm:


cd ~
rm -rf arrow
git clone https://github.com/apache/arrow.git
cd arrow
conda create -y -n arrow-commit -c conda-forge \
--file ci/conda_env_unix.txt \
--file ci/conda_env_cpp.txt \
--file ci/conda_env_python.txt \
compilers \
python=3.8 \
pandas \
aws-sdk-cpp \
r
conda activate arrow-commit
pip install -r python/requirements-build.txt -r python/requirements-test.txt
source dev/conbench_envs/hooks.sh set_arrow_build_and_run_env_vars
export RANLIB=`which $RANLIB`
export AR=`which $AR`
export ARROW_JEMALLOC=OFF
ci/scripts/cpp_build.sh $(pwd) $(pwd)
ci/scripts/python_build.sh $(pwd) $(pwd)
(arrow-commit) voltrondata@m1mini01 arrow % python
Python 3.8.15 | packaged by conda-forge | (default, Nov 22 2022, 08:49:06) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyarrow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/__init__.py", line 65, in <module>
import pyarrow.lib as _lib
ImportError: dlopen(/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so, 2): Library not loaded: /Users/voltrondata/arrow/python/build/lib.macosx-11.0-arm64-cpython-38/pyarrow/lib/libarrow_python.1100.dylib
Referenced from: /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
Reason: image not found
>>> 

Any advice on this? Thank you!

@kou

kou commented Dec 28, 2022

Copy link
Copy Markdown
MemberAuthor

Could you show otool -L /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so?

@ElenaHenderson

Copy link
Copy Markdown
Contributor

@kou

(arrow-commit) voltrondata@m1mini01 arrow % otool -L /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so:
/Users/voltrondata/arrow/python/build/lib.macosx-11.0-arm64-cpython-38/pyarrow/lib/libarrow_python.1100.dylib (compatibility version 1100.0.0, current version 1100.0.0)
/Users/voltrondata/miniconda3/envs/arrow-commit/lib/libarrow.1100.dylib (compatibility version 1100.0.0, current version 1100.0.0)
@rpath/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
(arrow-commit) voltrondata@m1mini01 arrow % 

@kou

kou commented Dec 29, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks.
It seems that ARROW_INSTALL_NAME_RPATH=OFF is specified explicitly: https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/2099#01855a81-39fc-4639-b82c-df63b9db8f78/34-986
Can we stop it?

@ElenaHenderson

Copy link
Copy Markdown
Contributor

@kou Thank you! Yes, we can set ARROW_INSTALL_NAME_RPATH=ON. I am going to create a new PR now and confirm that this will work for benchmark builds on all machines.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@kou@jorisvandenbossche@AlenkaF@ursabot@ElenaHenderson@h-vetinari
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

ARROW-17838: [Python] Unify CMakeLists.txt in python/ - #14925

Merged
kou merged 13 commits into
apache:masterfrom
kou:python-cmake
Dec 21, 2022
Merged

ARROW-17838: [Python] Unify CMakeLists.txt in python/#14925
kou merged 13 commits into
apache:masterfrom
kou:python-cmake

Conversation

@kou

@koukou commented Dec 13, 2022

Copy link
Copy Markdown
Member

This also moves copying codes in setup.py to CMakeLists.txt. setup.py uses "cmake --build --target install" to put artifacts to suitable location.

This also moves copying codes in setup.py to CMakeLists.txt. setup.py
uses "cmake --build --target install" to put artifacts to suitable
location.
@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@github-actions

Copy link
Copy Markdown
Wrong oauth personal access token
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3683723044

@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

Copy link
Copy Markdown
Wrong oauth personal access token
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3683737026

@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

Hmm. Crossbow doesn't work...

@kou

kou commented Dec 14, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow -g python

@github-actions

Copy link
Copy Markdown
No such option: -g
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3698591563

@kou

kou commented Dec 15, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

This comment was marked as outdated.

@kou

kou commented Dec 15, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit test-fedora-35-python-3 test-ubuntu-20.04-python-3

@github-actions

This comment was marked as outdated.

@jorisvandenbossche

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g wheel

@jorisvandenbosschejorisvandenbossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks great!
I did a shallow review of the changes, but also tested locally and for my development setup this seems to be working nicely.

@@ -1,28 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a consequence of those pc files being removed? (are those actually usable right now? I don't think they actually get installed, so this is just cleaning up?)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Because we can't provide .pc in portable way for Python package.
.pc requires fixed install location but Python package is relocatable. Users can install it to /usr/local/lib/python*/dist-packages/pyarrow/, ~/.local/lib/python*/site-packages/pyarrow/ and so on.
If we want to keep .pc support, we need to rewrite .pc after pyarrow is installed. (This is the approach that is used by MSYS2 package.)

FYI: .pc aren't installed since our cpp/src/arrow/python/ -> python/ migration. It means that users already can't use arrow-python.pc since 10.0.0.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the conda builds don't currently test for the pc files, but they are being installed even for v>=10.

I think they should continue to be installed at least on conda, where the location is well-specified (and conda will take care of fixing the .pc files automatically).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@h-vetinari what you point to are the .pc files for libarrow, and that doesn't include the arrow_python library (anymore, since 10.0). This PR only affects the latter, and not the pc files for libarrow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have a test lined up for pkg-config metadata in conda builds that I can either push into #15014, but more likely would put in a separate PR after that one is merged (or into this one, if desired).

In any case, I think this PR should ideally be tested to not break the conda build setup (I'm happy to help with eventual adaptations).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[gh hadn't updated the page so I didn't see you comment while writing my follow-up, apologies]

Sorry I overlooked what .pc files this was pointing at. It seems there are still some .pc files being installed for pyarrow (or rather .pc.in, so probably not functional).

I don't have very strong feelings about .pc files for the python libs, but in general I think if we can create them easily (and it's not an undue maintenance burden), we should keep them for the conda builds.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

but in general I think if we can create them easily (and it's not an undue maintenance burden), we should keep them for the conda builds.

If we prepare arrow-python.pc only for conda, conda users only can use it. It's not portable. It means that developers who use pyarrow's C++ API need to support arrow-python.pc environment and no-arrow-python.pc environment.

I think that all developers who use pyarrow's C++ API use pyarrow.get_include_dir()/pyarrow.get_library_dirs()/pyarrow.get_libraries() instead of arrow-python.pc. pyarrow.* are available on conda and non-conda environments.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And to complement to what @kou said: this is very similar for numpy. There one also need to use np.get_include().

Comment threadpython/CMakeLists.txt
# Parquet
if(PYARROW_BUILD_PARQUET)
# Parquet
find_package(Parquet REQUIRED)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This hasn't yet been done at this point in the file (if you don't use parquet encryption), so I would expect this needs to stay? (although testing locally with my development setup (where I don't enable parquet encryption), it seems to work fine ..)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Good catch! Parquet is found by find_package(ArrowDataset REQUIRED) implicitly but we should call find_package(Parquet REQUIRED) explicitly. I'll fix it.

@github-actions

This comment was marked as outdated.

Comment threadcpp/cmake_modules/BuildUtils.cmake
Comment threadcpp/src/arrow/symbols.map
Comment threadpython/CMakeLists.txt
Comment threadpython/CMakeLists.txt
@AlenkaF

Copy link
Copy Markdown
Member

This is great, thanks so much!
I did not test t locally on M1 yet. Will do that asap.

@kou

kou commented Dec 18, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python -g wheel

@github-actions

Copy link
Copy Markdown

Revision: 75a7574

Submitted crossbow builds: ursacomputing/crossbow @ actions-8f625a77be

TaskStatus
test-conda-python-3.10Github Actions
test-conda-python-3.11Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-pandas-1.0Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-upstream_develGithub Actions
test-conda-python-3.9-pandas-upstream_develGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-cuda-pythonGithub Actions
test-debian-11-python-3Azure
test-fedora-35-python-3Azure
test-ubuntu-20.04-python-3Azure
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp311-arm64Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-mojave-cp310-amd64Github Actions
wheel-macos-mojave-cp311-amd64Github Actions
wheel-macos-mojave-cp37-amd64Github Actions
wheel-macos-mojave-cp38-amd64Github Actions
wheel-macos-mojave-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64Travis CI
wheel-manylinux2014-cp311-amd64Github Actions
wheel-manylinux2014-cp311-arm64Travis CI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64Travis CI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64Travis CI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64Travis CI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp311-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@kou

kou commented Dec 21, 2022

Copy link
Copy Markdown
MemberAuthor

Can we merge this?

@AlenkaFAlenkaF left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have tested it locally on M1, no issues 👍

The CI and crossbow failures are seen elsewhere also so I am happy to approve this. Thank you so much for such great optimisation in pyarrow build process 🙏

@kou

kou commented Dec 21, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks for testing it locally!

I merge this.

@kou
kou merged commit df4cb95 into apache:masterDec 21, 2022
@kou
kou deleted the python-cmake branch December 21, 2022 20:27
@ursabot

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 9ed98bf and contender = df4cb95. df4cb95 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed] test-mac-arm
[Finished ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.07% ⬆️0.0%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] df4cb958 ec2-t3-xlarge-us-east-2
[Failed] df4cb958 test-mac-arm
[Finished] df4cb958 ursa-i9-9960x
[Finished] df4cb958 ursa-thinkcentre-m75q
[Finished] 9ed98bf8 ec2-t3-xlarge-us-east-2
[Finished] 9ed98bf8 test-mac-arm
[Finished] 9ed98bf8 ursa-i9-9960x
[Finished] 9ed98bf8 ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@ursabot

Copy link
Copy Markdown

['Python', 'R'] benchmarks have high level of regressions.
ursa-i9-9960x

@ElenaHenderson

ElenaHenderson commented Dec 28, 2022

Copy link
Copy Markdown
Contributor

@kou@AlenkaF@jorisvandenbossche Benchmark builds on test-mac-arm (https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm) started failing since this change was merged into main branch:

I am reproducing this issue on test-mac-arm:


cd ~
rm -rf arrow
git clone https://github.com/apache/arrow.git
cd arrow
conda create -y -n arrow-commit -c conda-forge \
--file ci/conda_env_unix.txt \
--file ci/conda_env_cpp.txt \
--file ci/conda_env_python.txt \
compilers \
python=3.8 \
pandas \
aws-sdk-cpp \
r
conda activate arrow-commit
pip install -r python/requirements-build.txt -r python/requirements-test.txt
source dev/conbench_envs/hooks.sh set_arrow_build_and_run_env_vars
export RANLIB=`which $RANLIB`
export AR=`which $AR`
export ARROW_JEMALLOC=OFF
ci/scripts/cpp_build.sh $(pwd) $(pwd)
ci/scripts/python_build.sh $(pwd) $(pwd)
(arrow-commit) voltrondata@m1mini01 arrow % python
Python 3.8.15 | packaged by conda-forge | (default, Nov 22 2022, 08:49:06) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyarrow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/__init__.py", line 65, in <module>
import pyarrow.lib as _lib
ImportError: dlopen(/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so, 2): Library not loaded: /Users/voltrondata/arrow/python/build/lib.macosx-11.0-arm64-cpython-38/pyarrow/lib/libarrow_python.1100.dylib
Referenced from: /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
Reason: image not found
>>> 

Any advice on this? Thank you!

@kou

kou commented Dec 28, 2022

Copy link
Copy Markdown
MemberAuthor

Could you show otool -L /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so?

@ElenaHenderson

Copy link
Copy Markdown
Contributor

@kou

(arrow-commit) voltrondata@m1mini01 arrow % otool -L /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so:
/Users/voltrondata/arrow/python/build/lib.macosx-11.0-arm64-cpython-38/pyarrow/lib/libarrow_python.1100.dylib (compatibility version 1100.0.0, current version 1100.0.0)
/Users/voltrondata/miniconda3/envs/arrow-commit/lib/libarrow.1100.dylib (compatibility version 1100.0.0, current version 1100.0.0)
@rpath/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
(arrow-commit) voltrondata@m1mini01 arrow % 

@kou

kou commented Dec 29, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks.
It seems that ARROW_INSTALL_NAME_RPATH=OFF is specified explicitly: https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/2099#01855a81-39fc-4639-b82c-df63b9db8f78/34-986
Can we stop it?

@ElenaHenderson

Copy link
Copy Markdown
Contributor

@kou Thank you! Yes, we can set ARROW_INSTALL_NAME_RPATH=ON. I am going to create a new PR now and confirm that this will work for benchmark builds on all machines.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@kou@jorisvandenbossche@AlenkaF@ursabot@ElenaHenderson@h-vetinari
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

ARROW-17838: [Python] Unify CMakeLists.txt in python/ - #14925

Merged
kou merged 13 commits into
apache:masterfrom
kou:python-cmake
Dec 21, 2022
Merged

ARROW-17838: [Python] Unify CMakeLists.txt in python/#14925
kou merged 13 commits into
apache:masterfrom
kou:python-cmake

Conversation

@kou

@koukou commented Dec 13, 2022

Copy link
Copy Markdown
Member

This also moves copying codes in setup.py to CMakeLists.txt. setup.py uses "cmake --build --target install" to put artifacts to suitable location.

This also moves copying codes in setup.py to CMakeLists.txt. setup.py
uses "cmake --build --target install" to put artifacts to suitable
location.
@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@github-actions

Copy link
Copy Markdown
Wrong oauth personal access token
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3683723044

@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

Copy link
Copy Markdown
Wrong oauth personal access token
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3683737026

@kou

kou commented Dec 13, 2022

Copy link
Copy Markdown
MemberAuthor

Hmm. Crossbow doesn't work...

@kou

kou commented Dec 14, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow -g python

@github-actions

Copy link
Copy Markdown
No such option: -g
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/3698591563

@kou

kou commented Dec 15, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python

@github-actions

This comment was marked as outdated.

@kou

kou commented Dec 15, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit test-fedora-35-python-3 test-ubuntu-20.04-python-3

@github-actions

This comment was marked as outdated.

@jorisvandenbossche

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g wheel

@jorisvandenbosschejorisvandenbossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks great!
I did a shallow review of the changes, but also tested locally and for my development setup this seems to be working nicely.

@@ -1,28 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a consequence of those pc files being removed? (are those actually usable right now? I don't think they actually get installed, so this is just cleaning up?)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Because we can't provide .pc in portable way for Python package.
.pc requires fixed install location but Python package is relocatable. Users can install it to /usr/local/lib/python*/dist-packages/pyarrow/, ~/.local/lib/python*/site-packages/pyarrow/ and so on.
If we want to keep .pc support, we need to rewrite .pc after pyarrow is installed. (This is the approach that is used by MSYS2 package.)

FYI: .pc aren't installed since our cpp/src/arrow/python/ -> python/ migration. It means that users already can't use arrow-python.pc since 10.0.0.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the conda builds don't currently test for the pc files, but they are being installed even for v>=10.

I think they should continue to be installed at least on conda, where the location is well-specified (and conda will take care of fixing the .pc files automatically).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@h-vetinari what you point to are the .pc files for libarrow, and that doesn't include the arrow_python library (anymore, since 10.0). This PR only affects the latter, and not the pc files for libarrow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have a test lined up for pkg-config metadata in conda builds that I can either push into #15014, but more likely would put in a separate PR after that one is merged (or into this one, if desired).

In any case, I think this PR should ideally be tested to not break the conda build setup (I'm happy to help with eventual adaptations).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[gh hadn't updated the page so I didn't see you comment while writing my follow-up, apologies]

Sorry I overlooked what .pc files this was pointing at. It seems there are still some .pc files being installed for pyarrow (or rather .pc.in, so probably not functional).

I don't have very strong feelings about .pc files for the python libs, but in general I think if we can create them easily (and it's not an undue maintenance burden), we should keep them for the conda builds.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

but in general I think if we can create them easily (and it's not an undue maintenance burden), we should keep them for the conda builds.

If we prepare arrow-python.pc only for conda, conda users only can use it. It's not portable. It means that developers who use pyarrow's C++ API need to support arrow-python.pc environment and no-arrow-python.pc environment.

I think that all developers who use pyarrow's C++ API use pyarrow.get_include_dir()/pyarrow.get_library_dirs()/pyarrow.get_libraries() instead of arrow-python.pc. pyarrow.* are available on conda and non-conda environments.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And to complement to what @kou said: this is very similar for numpy. There one also need to use np.get_include().

Comment threadpython/CMakeLists.txt
# Parquet
if(PYARROW_BUILD_PARQUET)
# Parquet
find_package(Parquet REQUIRED)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This hasn't yet been done at this point in the file (if you don't use parquet encryption), so I would expect this needs to stay? (although testing locally with my development setup (where I don't enable parquet encryption), it seems to work fine ..)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Good catch! Parquet is found by find_package(ArrowDataset REQUIRED) implicitly but we should call find_package(Parquet REQUIRED) explicitly. I'll fix it.

@github-actions

This comment was marked as outdated.

Comment threadcpp/cmake_modules/BuildUtils.cmake
Comment threadcpp/src/arrow/symbols.map
Comment threadpython/CMakeLists.txt
Comment threadpython/CMakeLists.txt
@AlenkaF

Copy link
Copy Markdown
Member

This is great, thanks so much!
I did not test t locally on M1 yet. Will do that asap.

@kou

kou commented Dec 18, 2022

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit -g python -g wheel

@github-actions

Copy link
Copy Markdown

Revision: 75a7574

Submitted crossbow builds: ursacomputing/crossbow @ actions-8f625a77be

TaskStatus
test-conda-python-3.10Github Actions
test-conda-python-3.11Github Actions
test-conda-python-3.7Github Actions
test-conda-python-3.7-hdfs-2.9.2Github Actions
test-conda-python-3.7-hdfs-3.2.1Github Actions
test-conda-python-3.7-pandas-1.0Github Actions
test-conda-python-3.7-pandas-latestGithub Actions
test-conda-python-3.7-spark-v3.1.2Github Actions
test-conda-python-3.8Github Actions
test-conda-python-3.8-hypothesisGithub Actions
test-conda-python-3.8-pandas-latestGithub Actions
test-conda-python-3.8-pandas-nightlyGithub Actions
test-conda-python-3.8-spark-v3.2.0Github Actions
test-conda-python-3.9Github Actions
test-conda-python-3.9-dask-latestGithub Actions
test-conda-python-3.9-dask-upstream_develGithub Actions
test-conda-python-3.9-pandas-upstream_develGithub Actions
test-conda-python-3.9-spark-masterGithub Actions
test-cuda-pythonGithub Actions
test-debian-11-python-3Azure
test-fedora-35-python-3Azure
test-ubuntu-20.04-python-3Azure
wheel-macos-big-sur-cp310-arm64Github Actions
wheel-macos-big-sur-cp311-arm64Github Actions
wheel-macos-big-sur-cp38-arm64Github Actions
wheel-macos-big-sur-cp39-arm64Github Actions
wheel-macos-mojave-cp310-amd64Github Actions
wheel-macos-mojave-cp311-amd64Github Actions
wheel-macos-mojave-cp37-amd64Github Actions
wheel-macos-mojave-cp38-amd64Github Actions
wheel-macos-mojave-cp39-amd64Github Actions
wheel-manylinux2014-cp310-amd64Github Actions
wheel-manylinux2014-cp310-arm64Travis CI
wheel-manylinux2014-cp311-amd64Github Actions
wheel-manylinux2014-cp311-arm64Travis CI
wheel-manylinux2014-cp37-amd64Github Actions
wheel-manylinux2014-cp37-arm64Travis CI
wheel-manylinux2014-cp38-amd64Github Actions
wheel-manylinux2014-cp38-arm64Travis CI
wheel-manylinux2014-cp39-amd64Github Actions
wheel-manylinux2014-cp39-arm64Travis CI
wheel-windows-cp310-amd64Github Actions
wheel-windows-cp311-amd64Github Actions
wheel-windows-cp37-amd64Github Actions
wheel-windows-cp38-amd64Github Actions
wheel-windows-cp39-amd64Github Actions

@kou

kou commented Dec 21, 2022

Copy link
Copy Markdown
MemberAuthor

Can we merge this?

@AlenkaFAlenkaF left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have tested it locally on M1, no issues 👍

The CI and crossbow failures are seen elsewhere also so I am happy to approve this. Thank you so much for such great optimisation in pyarrow build process 🙏

@kou

kou commented Dec 21, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks for testing it locally!

I merge this.

@kou
kou merged commit df4cb95 into apache:masterDec 21, 2022
@kou
kou deleted the python-cmake branch December 21, 2022 20:27
@ursabot

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 9ed98bf and contender = df4cb95. df4cb95 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed] test-mac-arm
[Finished ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.07% ⬆️0.0%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] df4cb958 ec2-t3-xlarge-us-east-2
[Failed] df4cb958 test-mac-arm
[Finished] df4cb958 ursa-i9-9960x
[Finished] df4cb958 ursa-thinkcentre-m75q
[Finished] 9ed98bf8 ec2-t3-xlarge-us-east-2
[Finished] 9ed98bf8 test-mac-arm
[Finished] 9ed98bf8 ursa-i9-9960x
[Finished] 9ed98bf8 ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@ursabot

Copy link
Copy Markdown

['Python', 'R'] benchmarks have high level of regressions.
ursa-i9-9960x

@ElenaHenderson

ElenaHenderson commented Dec 28, 2022

Copy link
Copy Markdown
Contributor

@kou@AlenkaF@jorisvandenbossche Benchmark builds on test-mac-arm (https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm) started failing since this change was merged into main branch:

I am reproducing this issue on test-mac-arm:


cd ~
rm -rf arrow
git clone https://github.com/apache/arrow.git
cd arrow
conda create -y -n arrow-commit -c conda-forge \
--file ci/conda_env_unix.txt \
--file ci/conda_env_cpp.txt \
--file ci/conda_env_python.txt \
compilers \
python=3.8 \
pandas \
aws-sdk-cpp \
r
conda activate arrow-commit
pip install -r python/requirements-build.txt -r python/requirements-test.txt
source dev/conbench_envs/hooks.sh set_arrow_build_and_run_env_vars
export RANLIB=`which $RANLIB`
export AR=`which $AR`
export ARROW_JEMALLOC=OFF
ci/scripts/cpp_build.sh $(pwd) $(pwd)
ci/scripts/python_build.sh $(pwd) $(pwd)
(arrow-commit) voltrondata@m1mini01 arrow % python
Python 3.8.15 | packaged by conda-forge | (default, Nov 22 2022, 08:49:06) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyarrow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/__init__.py", line 65, in <module>
import pyarrow.lib as _lib
ImportError: dlopen(/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so, 2): Library not loaded: /Users/voltrondata/arrow/python/build/lib.macosx-11.0-arm64-cpython-38/pyarrow/lib/libarrow_python.1100.dylib
Referenced from: /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
Reason: image not found
>>> 

Any advice on this? Thank you!

@kou

kou commented Dec 28, 2022

Copy link
Copy Markdown
MemberAuthor

Could you show otool -L /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so?

@ElenaHenderson

Copy link
Copy Markdown
Contributor

@kou

(arrow-commit) voltrondata@m1mini01 arrow % otool -L /Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
/Users/voltrondata/miniconda3/envs/arrow-commit/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so:
/Users/voltrondata/arrow/python/build/lib.macosx-11.0-arm64-cpython-38/pyarrow/lib/libarrow_python.1100.dylib (compatibility version 1100.0.0, current version 1100.0.0)
/Users/voltrondata/miniconda3/envs/arrow-commit/lib/libarrow.1100.dylib (compatibility version 1100.0.0, current version 1100.0.0)
@rpath/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
(arrow-commit) voltrondata@m1mini01 arrow % 

@kou

kou commented Dec 29, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks.
It seems that ARROW_INSTALL_NAME_RPATH=OFF is specified explicitly: https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/2099#01855a81-39fc-4639-b82c-df63b9db8f78/34-986
Can we stop it?

@ElenaHenderson

Copy link
Copy Markdown
Contributor

@kou Thank you! Yes, we can set ARROW_INSTALL_NAME_RPATH=ON. I am going to create a new PR now and confirm that this will work for benchmark builds on all machines.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@kou@jorisvandenbossche@AlenkaF@ursabot@ElenaHenderson@h-vetinari