Skip to content

Conversation

cbalioglu
Copy link
Contributor

Fixes the case where the CMAKE_PREFIX_PATH variable gets silently overwritten by a user specified environment variable.

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Jul 20, 2021

🔗 Helpful links

💊 CI failures summary and remediations

As of commit 114f674 (more details on the Dr. CI page):


  • 1/2 failures introduced in this PR
  • 1/2 broken upstream at merge base 548fe68 on Aug 13 from 8:27am to 1:53pm

1 failure not recognized by patterns:

Job Step Action
CircleCI pytorch_linux_backward_compatibility_check_test Set Up CI Environment After attach_workspace 🔁 rerun

1 job timed out:

  • pytorch_linux_xenial_py3_clang7_asan_test1

🚧 1 fixed upstream failure:

These were probably caused by upstream breakages that were already fixed.

Please rebase on the viable/strict branch (expand for instructions)

If your commit is older than viable/strict, run these commands:

git fetch https://github.com/pytorch/pytorch viable/strict
git rebase FETCH_HEAD

This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@facebook-github-bot
Copy link
Contributor

@cbalioglu has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@cbalioglu cbalioglu requested review from driazati and seemethere July 20, 2021 14:05
@cbalioglu cbalioglu force-pushed the balioglu-cmake-fix branch from 4b9eb36 to 3374d7a Compare July 20, 2021 16:03
@seemethere seemethere requested a review from a team July 20, 2021 16:09
@facebook-github-bot
Copy link
Contributor

@cbalioglu has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@cbalioglu cbalioglu force-pushed the balioglu-cmake-fix branch from 3374d7a to fd0bfab Compare July 30, 2021 15:17
@facebook-github-bot
Copy link
Contributor

@cbalioglu has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@cbalioglu has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

cmake_prefix_path = cast(str, build_options.get('CMAKE_PREFIX_PATH', None))
if cmake_prefix_path:
build_options["CMAKE_PREFIX_PATH"] = f'{py_lib_path};{cmake_prefix_path}'
else:
build_options['CMAKE_PREFIX_PATH'] = py_lib_path
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this can simplify right?

Suggested change
cmake_prefix_path = cast(str, build_options.get('CMAKE_PREFIX_PATH', None))
if cmake_prefix_path:
build_options["CMAKE_PREFIX_PATH"] = f'{py_lib_path};{cmake_prefix_path}'
else:
build_options['CMAKE_PREFIX_PATH'] = py_lib_path
cmake_prefix_path = cast(str, build_options.get('CMAKE_PREFIX_PATH', ''))
build_options["CMAKE_PREFIX_PATH"] = f'{py_lib_path};{cmake_prefix_path}'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, technically they are equivalent. I just wanted the final value of CMAKE_PREFIX_PATH to be more "pedantic". For someone checking out CMakeCache.txt later, seeing a CMAKE_PREFIX_PATH that ends with a semicolon might give suspicion about whether it was intentional or whether there was a bug in the build system that overwrote/skipped something.

@facebook-github-bot
Copy link
Contributor

@cbalioglu has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@cbalioglu has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@cbalioglu merged this pull request in e711b5c.

@cbalioglu cbalioglu deleted the balioglu-cmake-fix branch August 13, 2021 20:53
alanwaketan pushed a commit that referenced this pull request Aug 17, 2021
Summary:
Fixes the case where the `CMAKE_PREFIX_PATH` variable gets silently overwritten by a user specified environment variable.

Pull Request resolved: #61904

Reviewed By: walterddr, malfet

Differential Revision: D29792014

Pulled By: cbalioglu

fbshipit-source-id: babacc8d5a1490bff1e14247850cc00c6ba9e6be
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.

4 participants