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

Fix bazel_to_cmake expand_template if parent directory does not exist #133

Merged
merged 1 commit into from
Feb 6, 2024
Merged

Fix bazel_to_cmake expand_template if parent directory does not exist #133

merged 1 commit into from
Feb 6, 2024

Conversation

LDeakin
Copy link
Contributor

@LDeakin LDeakin commented Jan 24, 2024

This fixes expand_template in bazel_to_cmake so that it creates the parent directory of the output if it does not exist.

This partially fixes a cmake-based build for me, which otherwise errors as below:

Traceback (most recent call last):
  File "/home/lachy/dev/tensorstore/tools/cmake/bazel_to_cmake/bzl_library/expand_template.py", line 50, in <module>
    main()
  File "/home/lachy/dev/tensorstore/tools/cmake/bazel_to_cmake/bzl_library/expand_template.py", line 44, in main
    expand_template(
  File "/home/lachy/dev/tensorstore/tools/cmake/bazel_to_cmake/bzl_library/expand_template.py", line 32, in expand_template
    pathlib.Path(out).write_text(text, encoding='utf-8')
  File "/usr/lib/python3.11/pathlib.py", line 1079, in write_text
    with self.open(mode='w', encoding=encoding, errors=errors, newline=newline) as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/pathlib.py", line 1045, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/lachy/dev/tensorstore/build/_deps/nghttp2-build/lib/includes/nghttp2/nghttp2ver.h'

Copy link

google-cla bot commented Jan 24, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@brian-michell
Copy link

I just wanted to chime in and say this fixed build issues with nghttp2 for me as well, and much nicer than the hack I have for testing on cloud.

@copybara-service copybara-service bot merged commit 7a70768 into google:master Feb 6, 2024
8 checks passed
@LDeakin LDeakin deleted the fix_expand_template branch February 6, 2024 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants