Skip to content

Conversation

@dconeybe
Copy link
Contributor

Use a Python virtualenv when running Python scripts during a cmake build.

This PR is a copy of firebase/firebase-ios-sdk#9662.

This PR adds a new cmake module, python_setup, that defines a single function: FirebaseSetupPythonInterpreter(). This function will find a Python interpreter installed on the system, create a virtualenv with it, pip-install dependencies into it, and set a variable to the path of the Python executable. Then, when cmake wants to run a Python script, it uses the one in the virtualenv.

This has several benefits compared to the old design:

  1. There is no need to manually pip-install the dependencies into the local Python installation.
  2. The dependencies of the Python scripts are clearly specified in the "requirements" argument to the function.
  3. You don't have to worry about cmake's built-in Python searching logic finding a different interpreter than intended, which does not happen to have the required dependencies installed (e.g. https://github.com/firebase/firebase-cpp-sdk/runs/6065960193)

@dconeybe dconeybe added api: firestore skip-release-notes Skip release notes check labels Apr 20, 2022
@dconeybe dconeybe self-assigned this Apr 20, 2022
@dconeybe dconeybe added the tests-requested: quick Trigger a quick set of integration tests. label Apr 20, 2022
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. and removed tests-requested: quick Trigger a quick set of integration tests. labels Apr 20, 2022
@github-actions
Copy link

github-actions bot commented Apr 20, 2022

❌  Integration test FAILED

Requested by @dconeybe on commit 79b91ca
Last updated: Mon Apr 25 10:25 PDT 2022
View integration test log & download artifacts

Failures Configs
admob [BUILD] [ERROR] [Android] [1/3 os: windows]
analytics [BUILD] [ERROR] [Android] [1/3 os: windows]
auth [BUILD] [ERROR] [Android] [1/3 os: windows]
database [BUILD] [ERROR] [Android] [1/3 os: windows]
dynamic_links [BUILD] [ERROR] [Android] [1/3 os: windows]
firestore [BUILD] [ERROR] [Android] [All 3 os]
functions [BUILD] [ERROR] [Android] [1/3 os: windows]
installations [BUILD] [ERROR] [Android] [1/3 os: windows]
messaging [BUILD] [ERROR] [Android] [1/3 os: windows]
remote_config [BUILD] [ERROR] [Android] [1/3 os: windows]
storage [BUILD] [ERROR] [Android] [1/3 os: windows]

Add flaky tests to go/fpl-cpp-flake-tracker

@github-actions github-actions bot added the tests: failed This PR's integration tests failed. label Apr 20, 2022
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Apr 20, 2022
@dconeybe dconeybe added the tests-requested: quick Trigger a quick set of integration tests. label Apr 20, 2022
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. tests: failed This PR's integration tests failed. and removed tests-requested: quick Trigger a quick set of integration tests. tests: failed This PR's integration tests failed. labels Apr 20, 2022
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Apr 20, 2022
@dconeybe dconeybe added the tests-requested: quick Trigger a quick set of integration tests. label Apr 24, 2022
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. tests: failed This PR's integration tests failed. and removed tests-requested: quick Trigger a quick set of integration tests. tests: failed This PR's integration tests failed. labels Apr 24, 2022
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Apr 24, 2022
@dconeybe dconeybe added the tests-requested: quick Trigger a quick set of integration tests. label Apr 25, 2022
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. tests: failed This PR's integration tests failed. and removed tests-requested: quick Trigger a quick set of integration tests. tests: failed This PR's integration tests failed. labels Apr 25, 2022
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Apr 25, 2022
@dconeybe
Copy link
Contributor Author

The last of the build errors are related to gradle communicating with cmake. I think those will be fixed once we upgrade the gradle plugin, which will happen after dropping gnustl support (#889). I'm going to put this PR on hold for now.

@dconeybe dconeybe marked this pull request as draft April 26, 2022 01:05
@dconeybe dconeybe closed this Sep 8, 2023
@dconeybe dconeybe deleted the dconeybe/PythonCmakeSetup branch September 8, 2023 14:19
@firebase firebase locked and limited conversation to collaborators Oct 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: firestore skip-release-notes Skip release notes check tests: failed This PR's integration tests failed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant