Skip to content

Commit 6924818

Browse files
Georges Berengerfacebook-github-bot
authored andcommitted
Fix oss build (#309)
Summary: Add a number of OSS issues that accumulated over time: - extractAudio was added, but can't be used in oss from its location (linkage issues). Disabling in pyvrs/oss for now. - properly exposed writer functionality in oss - back-ported cmake install workaround from the vrs/oss repo Differential Revision: D87478397
1 parent 5e4fd95 commit 6924818

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

.github/workflows/build-and-test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ jobs:
3939
python -m pip install pybind11[global]
4040
4141
elif [ "$RUNNER_OS" == "macOS" ]; then
42-
brew install cmake git ninja googletest glog fmt \
42+
# Update or install cmake
43+
brew upgrade cmake || brew install cmake
44+
brew install git ninja googletest glog fmt \
4345
jpeg-turbo libpng \
4446
lz4 zstd xxhash \
4547
boost \

cmake/LibrariesSetup.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ if (EXISTS "$ENV{HOME}/homebrew")
1717
list(APPEND CMAKE_FIND_ROOT_PATH "$ENV{HOME}/homebrew")
1818
endif()
1919

20-
find_package(Boost REQUIRED
20+
find_package(Boost
2121
COMPONENTS
2222
filesystem
2323
chrono
2424
date_time
2525
system
2626
thread
27+
CONFIG
28+
REQUIRED
2729
)
2830
find_package(Eigen REQUIRED)
2931
find_package(FmtLib REQUIRED)

csrc/Pybind11.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
#include "VrsBindings.h"
2323
#include "reader/Reader.h"
2424
#include "utils/Utils.h"
25+
#include "writer/Writer.h"
2526

2627
#if IS_VRS_FB_INTERNAL()
2728
#include "archive/Archive.h"
2829
#include "fb/FbInternal.h"
2930
#include "fb/dataset_snapshot/PyDatasetSnapshot.h"
3031
#include "filter/Filter.h" // Disable filter internally until AsyncImageFilter is reworked.
31-
#include "writer/Writer.h"
3232
#endif
3333

3434
#ifndef PYBIND_MODULE_NAME
@@ -59,9 +59,9 @@ PYBIND11_MODULE(PYBIND_MODULE_NAME, m) {
5959
pyvrs::pybind_fbinternal(m);
6060
#endif
6161
pyvrs::pybind_reader(m);
62+
pyvrs::pybind_writer(m);
6263
#if IS_VRS_FB_INTERNAL()
6364
pyvrs::pybind_filter(m); // Disable filter internally until AsyncImageFilter is reworked.
64-
pyvrs::pybind_writer(m);
6565
pyvrs::pybind_archive(m);
6666
pyvrs::pybind_dataset_snapshot(m);
6767
#endif

csrc/reader/Reader.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818

1919
#include <vrs/os/Platform.h>
2020
#include <vrs/utils/AudioTrackExtractor.h>
21+
22+
#if IS_VRS_FB_INTERNAL()
2123
#include <vrs/utils/cli/DataExtraction.h>
24+
#endif
2225

2326
#include "AsyncVRSReader.h"
2427
#include "FilteredFileReader.h"
@@ -33,10 +36,12 @@ string extractAudioTrack(pyvrs::FilteredFileReader& filteredReader, const string
3336
return vrs::utils::extractAudioTrack(filteredReader.getFilteredReader(), wavFilePath);
3437
}
3538

39+
#if IS_VRS_FB_INTERNAL()
3640
int extractAudio(const string& path, pyvrs::FilteredFileReader& filteredReader) {
3741
initVrsBindings();
3842
return vrs::utils::extractAudio(path, filteredReader.getFilteredReader());
3943
}
44+
#endif
4045

4146
void pybind_reader(py::module& m) {
4247
py::enum_<pyvrs::ImageConversion>(m, "ImageConversion")
@@ -54,13 +59,12 @@ void pybind_reader(py::module& m) {
5459

5560
#if IS_VRS_FB_INTERNAL()
5661
pybind_filtered_filereader(m);
62+
m.def("extract_audio", &extractAudio, "Extract all audio tracks from given FilteredFileReader");
5763
#endif
5864

5965
m.def(
6066
"extract_audio_track",
6167
&extractAudioTrack,
6268
"Extract audio track from given FilteredFileReader");
63-
64-
m.def("extract_audio", &extractAudio, "Extract all audio tracks from given FilteredFileReader");
6569
}
6670
} // namespace pyvrs

0 commit comments

Comments
 (0)