Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ARROW-17795: [C++][R] Add missing PKG_CONFIG_PATH to use system zstd #14202

Merged
merged 10 commits into from
Sep 27, 2022

Conversation

kou
Copy link
Member

@kou kou commented Sep 22, 2022

No description provided.

@kou
Copy link
Member Author

kou commented Sep 22, 2022

@github-actions crossbow submit r-binary-packages

@github-actions
Copy link

@github-actions
Copy link

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

@github-actions

This comment was marked as outdated.

@kou
Copy link
Member Author

kou commented Sep 22, 2022

@github-actions crossbow submit r-binary-packages

@github-actions

This comment was marked as outdated.

@kou
Copy link
Member Author

kou commented Sep 23, 2022

@github-actions crossbow submit r-binary-packages

@github-actions

This comment was marked as outdated.

@kou
Copy link
Member Author

kou commented Sep 23, 2022

@github-actions crossbow submit r-binary-packages

@github-actions

This comment was marked as off-topic.

@kou
Copy link
Member Author

kou commented Sep 23, 2022

@github-actions crossbow submit r-binary-packages

@github-actions

This comment was marked as outdated.

@kou
Copy link
Member Author

kou commented Sep 23, 2022

@github-actions crossbow submit r-binary-packages

@github-actions

This comment was marked as outdated.

@kou kou changed the title ARROW-17795: WIP: [C++][R] Fix a bug that zstd isn't found for static link ARROW-17795: [C++][R] Fix a bug that zstd isn't found for static link Sep 23, 2022
@kou kou changed the title ARROW-17795: [C++][R] Fix a bug that zstd isn't found for static link ARROW-17795: [C++][R] Add missing PKG_CONFIG_PATH to use system zstd Sep 23, 2022
@kou
Copy link
Member Author

kou commented Sep 23, 2022

@github-actions crossbow submit r-binary-packages

@github-actions

This comment was marked as outdated.

@kou
Copy link
Member Author

kou commented Sep 23, 2022

@github-actions crossbow submit -g r

@github-actions
Copy link

Revision: c04e0da

Submitted crossbow builds: ursacomputing/crossbow @ actions-4116018602

Task Status
conda-linux-gcc-py37-cpu-r40 Azure
conda-linux-gcc-py37-cpu-r41 Azure
conda-osx-clang-py37-r40 Azure
conda-osx-clang-py37-r41 Azure
conda-win-vs2019-py37-r40 Azure
conda-win-vs2019-py37-r41 Azure
homebrew-r-autobrew Github Actions
homebrew-r-brew Github Actions
r-binary-packages Github Actions
test-fedora-r-clang-sanitizer Azure
test-r-arrow-backwards-compatibility Github Actions
test-r-depsource-bundled Azure
test-r-depsource-system Github Actions
test-r-dev-duckdb Github Actions
test-r-devdocs Github Actions
test-r-gcc-11 Github Actions
test-r-gcc-12 Github Actions
test-r-install-local Github Actions
test-r-linux-as-cran Github Actions
test-r-linux-rchk Github Actions
test-r-linux-valgrind Azure
test-r-minimal-build Azure
test-r-offline-maximal Github Actions
test-r-offline-minimal Azure
test-r-rhub-debian-gcc-devel-lto-latest Azure
test-r-rhub-debian-gcc-release-custom-ccache Azure
test-r-rhub-ubuntu-gcc-release-latest Azure
test-r-rocker-r-base-latest Azure
test-r-rstudio-r-base-4.1-opensuse153 Azure
test-r-rstudio-r-base-4.2-centos7-devtoolset-8 Azure
test-r-rstudio-r-base-4.2-focal Azure
test-r-ubuntu-22.04 Github Actions
test-r-versions Github Actions
test-ubuntu-18.04-r-sanitizer Azure

@kou
Copy link
Member Author

kou commented Sep 23, 2022

@github-actions crossbow submit test-r-arrow-backwards-compatibility test-r-install-local test-r-offline-maximal

@github-actions
Copy link

Revision: 3cef9bf

Submitted crossbow builds: ursacomputing/crossbow @ actions-48ab0ff1eb

Task Status
test-r-arrow-backwards-compatibility Github Actions
test-r-install-local Github Actions
test-r-offline-maximal Github Actions

@kou
Copy link
Member Author

kou commented Sep 23, 2022

@assignUser You may want to review this.

Copy link
Member

@assignUser assignUser left a comment

Choose a reason for hiding this comment

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

I am still not sure about the changes to FinzstdAlt.cmake (it worked before and now needs special casing -> a regression in my eyes) but as I don't quite understand them and your fix passes ci... 🤷

Should we add a note in the documentation about this?

Comment on lines +187 to +188
export PKG_CONFIG_PATH=${LIB_DIR}/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
PKG_LIBS="`pkg-config --libs --static --silence-errors ${PKG_CONFIG_NAME}`"
Copy link
Member

Choose a reason for hiding this comment

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

These changes are not required for configure.win because we use the mysys stuff anyway right?

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't see configure.win but it seems that configure.win doesn't use pkg-config on release build. configure.win uses pkg-config on dev build but it already uses pkg-config --libs ....

@@ -324,6 +329,7 @@ jobs:
env:
LIBARROW_BINARY: "FALSE"
ARROW_R_DEV: "TRUE"
CMAKE_FIND_DEBUG_MODE: "ON"
Copy link
Member

Choose a reason for hiding this comment

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

Should we remove this before merge?

Copy link
Member Author

Choose a reason for hiding this comment

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

I want to keep this to debug a problem in the future.
This step is executed only when the above build step is failed. Is it accepted?

Copy link
Member

Choose a reason for hiding this comment

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

👍 makes sense!

Copy link
Member Author

@kou kou left a comment

Choose a reason for hiding this comment

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

I am still not sure about the changes to FinzstdAlt.cmake (it worked before and now needs special casing -> a regression in my eyes) but as I don't quite understand them and your fix passes ci... 🤷

Sorry. I explain it:

  • ARROW-17728 / ARROW-17728: [C++][Gandiva] Accept LLVM 15.0 #14125 adds support for system zstdConfig.cmake (the CMake package for Zstandard) to find system Zstandard
  • GitHub Actions' Ubuntu hosted runner provides Zstandard installed by Homebrew by default
  • GitHub Actions' Ubuntu hosted runner has $(brew --prefix)/bin in $PATH by default
  • CMake's find_package can find $(brew --prefix)/lib/cmake/zstd/zstdConfig.cmake because $(brew --prefix)/bin exists in $PATH
    See also: https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure

    "5. Search the standard system environment variables. This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is passed or by setting the CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH to FALSE. Path entries ending in /bin or /sbin are automatically converted to their parent directories"

  • We can use pkg-config --static ... to get build flags suitable for static linking
  • pkg-config uses Requires.private and Libs.private in .pc file only when pkg-config --static ... is used
  • arrow.pc is generated by our CMake config and our CMake config tries setting Requires.private and Libs.private for static linking
  • Our CMake config adds pkg-config package name to Requires.private for system libraries ( such as Zstandard (installed by Homebrew by default) in this case) only if our CMake config can find .pc for the system libraries
  • But our CMake config couldn't add pkg-config package name for the system Zstandard (installed by Homebrew by default) because our CMake config couldn't find zstd.pc for the system Zstandard
  • Our CMake config can find zstd.pc for the system Zstandard by setting PKG_CONFIG_PATH=$(brew --prefix)/lib/pkgconfig
    • GitHub Actions' Ubuntu hosted runner adds $(brew --prefix)/bin to $PATH but doesn't set PKG_CONFIG_PATH=$(brew --prefix)/lib/pkgconfig
    • I think that this is a GitHub Actions' Ubuntu hosted runner's problem not our CMake config's problem. So I set it manually in this pull request.

Does the explanation help you?

Should we add a note in the documentation about this?

Hmm. Do you have any idea which documentation page is suitable?
I think that this is a GitHub Actions' Ubuntu hosted runner's specific problem not a general problem. Generally, users will set all related environment variables (PATH, PKG_CONFIG_PATH, LD_LIBRARY_PATH and so on) when they add a new package prefix such as $(brew --prefix), /usr/local and so on.

@@ -324,6 +329,7 @@ jobs:
env:
LIBARROW_BINARY: "FALSE"
ARROW_R_DEV: "TRUE"
CMAKE_FIND_DEBUG_MODE: "ON"
Copy link
Member Author

Choose a reason for hiding this comment

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

I want to keep this to debug a problem in the future.
This step is executed only when the above build step is failed. Is it accepted?

Comment on lines +187 to +188
export PKG_CONFIG_PATH=${LIB_DIR}/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
PKG_LIBS="`pkg-config --libs --static --silence-errors ${PKG_CONFIG_NAME}`"
Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't see configure.win but it seems that configure.win doesn't use pkg-config on release build. configure.win uses pkg-config on dev build but it already uses pkg-config --libs ....

Copy link
Member

@assignUser assignUser left a comment

Choose a reason for hiding this comment

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

@kou Thanks for the detailed explanation, it helped me a lot! So this issue did not happen before because this is new functionality.

I think that this is a GitHub Actions' Ubuntu hosted runner's specific problem not a general problem.

Now that I understand the issue I agree.

@kou
Copy link
Member Author

kou commented Sep 27, 2022

OK. I merge this.

@kou kou merged commit 83ad54c into apache:master Sep 27, 2022
@kou kou deleted the r-zstd branch September 27, 2022 20:34
@ursabot
Copy link

ursabot commented Sep 28, 2022

Benchmark runs are scheduled for baseline = b75e9e9 and contender = 83ad54c. 83ad54c 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
[Finished ⬇️0.38% ⬆️0.0%] test-mac-arm
[Failed ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.11% ⬆️0.0%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] 83ad54c6 ec2-t3-xlarge-us-east-2
[Finished] 83ad54c6 test-mac-arm
[Failed] 83ad54c6 ursa-i9-9960x
[Finished] 83ad54c6 ursa-thinkcentre-m75q
[Finished] b75e9e9b ec2-t3-xlarge-us-east-2
[Finished] b75e9e9b test-mac-arm
[Failed] b75e9e9b ursa-i9-9960x
[Finished] b75e9e9b 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

fatemehp pushed a commit to fatemehp/arrow that referenced this pull request Oct 17, 2022
…pache#14202)

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Sign up for free to 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.

None yet

3 participants