netheril96 / securefs

Filesystem in userspace (FUSE) with transparent authenticated encryption
Other
732 stars 62 forks source link

Failing to compile on FreeBSD 13.2 #156

Closed llucps closed 1 year ago

llucps commented 1 year ago

These are the steps I tried in order to compile securefs on FreeBSD 13.2

git clone https://github.com/Microsoft/vcpkg.git

./vcpkg/bootstrap-vcpkg.sh -disableMetrics

git clone https://github.com/netheril96/securefs.git

python3 build.py --enable_test --vcpkg_root="/usr/home/xxxxx/projects/vcpkg/"

And I get these errors:

ld: error: undefined symbol: absl::lts_20220623::container_internal::kEmptyGroup
>>> referenced by commands.cpp
>>>               commands.cpp.o:((anonymous namespace)::fix_helper(securefs::operations::FileSystemContext*, securefs::Directory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_set<securefs::PODArray<unsigned char, 32ul>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<securefs::PODArray<unsigned char, 32ul> > >*)) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:((anonymous namespace)::fix_helper(securefs::operations::FileSystemContext*, securefs::Directory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_set<securefs::PODArray<unsigned char, 32ul>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<securefs::PODArray<unsigned char, 32ul> > >*)) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(securefs::FixCommand::execute()) in archive libsecurefs-static.a
>>> referenced 13 more times

ld: error: undefined symbol: absl::lts_20220623::hash_internal::MixingHashState::kSeed
>>> referenced by commands.cpp
>>>               commands.cpp.o:((anonymous namespace)::fix_helper(securefs::operations::FileSystemContext*, securefs::Directory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_set<securefs::PODArray<unsigned char, 32ul>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<securefs::PODArray<unsigned char, 32ul> > >*)) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:((anonymous namespace)::fix_helper(securefs::operations::FileSystemContext*, securefs::Directory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_set<securefs::PODArray<unsigned char, 32ul>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<securefs::PODArray<unsigned char, 32ul> > >*)) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:((anonymous namespace)::fix_helper(securefs::operations::FileSystemContext*, securefs::Directory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_set<securefs::PODArray<unsigned char, 32ul>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<securefs::PODArray<unsigned char, 32ul> > >*)) in archive libsecurefs-static.a
>>> referenced 28 more times

ld: error: undefined symbol: absl::lts_20220623::hash_internal::MixingHashState::LowLevelHashImpl(unsigned char const*, unsigned long)
>>> referenced by commands.cpp
>>>               commands.cpp.o:((anonymous namespace)::fix_helper(securefs::operations::FileSystemContext*, securefs::Directory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_set<securefs::PODArray<unsigned char, 32ul>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<securefs::PODArray<unsigned char, 32ul> > >*)) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(securefs::FixCommand::execute()) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(absl::lts_20220623::hash_internal::MixingHashState::combine_contiguous(absl::lts_20220623::hash_internal::MixingHashState, unsigned char const*, unsigned long)) in archive libsecurefs-static.a

ld: error: undefined symbol: absl::lts_20220623::hash_internal::MixingHashState::CombineLargeContiguousImpl64(unsigned long, unsigned char const*, unsigned long)
>>> referenced by commands.cpp
>>>               commands.cpp.o:((anonymous namespace)::fix_helper(securefs::operations::FileSystemContext*, securefs::Directory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_set<securefs::PODArray<unsigned char, 32ul>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<securefs::PODArray<unsigned char, 32ul> > >*)) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(securefs::FixCommand::execute()) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(absl::lts_20220623::hash_internal::MixingHashState::combine_contiguous(absl::lts_20220623::hash_internal::MixingHashState, unsigned char const*, unsigned long)) in archive libsecurefs-static.a

ld: error: undefined symbol: absl::lts_20220623::base_internal::ThrowStdOutOfRange(char const*)
>>> referenced by commands.cpp
>>>               commands.cpp.o:((anonymous namespace)::fix_hardlink_count(securefs::operations::FileSystemContext*, securefs::Directory*, absl::lts_20220623::flat_hash_map<securefs::PODArray<unsigned char, 32ul>, int, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<std::__1::pair<securefs::PODArray<unsigned char, 32ul> const, int> > >*, (anonymous namespace)::NLinkFixPhase)) in archive libsecurefs-static.a
>>> referenced by operations.cpp
>>>               operations.cpp.o:(absl::lts_20220623::strings_internal::Splitter<absl::lts_20220623::ByChar, absl::lts_20220623::SkipEmpty, absl::lts_20220623::string_view>::ConvertToContainer<absl::lts_20220623::InlinedVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 32ul, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, false>::operator()(absl::lts_20220623::strings_internal::Splitter<absl::lts_20220623::ByChar, absl::lts_20220623::SkipEmpty, absl::lts_20220623::string_view> const&) const) in archive libsecurefs-static.a
>>> referenced by operations.cpp
>>>               operations.cpp.o:(absl::lts_20220623::strings_internal::Splitter<absl::lts_20220623::ByChar, absl::lts_20220623::SkipEmpty, absl::lts_20220623::string_view>::ConvertToContainer<absl::lts_20220623::InlinedVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 32ul, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, false>::operator()(absl::lts_20220623::strings_internal::Splitter<absl::lts_20220623::ByChar, absl::lts_20220623::SkipEmpty, absl::lts_20220623::string_view> const&) const) in archive libsecurefs-static.a

ld: error: undefined symbol: absl::lts_20220623::optional_internal::throw_bad_optional_access()
>>> referenced by commands.cpp
>>>               commands.cpp.o:(securefs::MountCommand::execute()) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(securefs::MountCommand::execute()) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(securefs::MountCommand::execute()) in archive libsecurefs-static.a
>>> referenced 12 more times

ld: error: undefined symbol: absl::lts_20220623::container_internal::FindInfo absl::lts_20220623::container_internal::find_first_non_full<void>(absl::lts_20220623::container_internal::ctrl_t const*, unsigned long, unsigned long)
>>> referenced by commands.cpp
>>>               commands.cpp.o:(absl::lts_20220623::container_internal::raw_hash_set<absl::lts_20220623::container_internal::FlatHashMapPolicy<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()> >, absl::lts_20220623::container_internal::StringHash, absl::lts_20220623::container_internal::StringEq, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::function<void ()> > > >::prepare_insert(unsigned long)) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(absl::lts_20220623::container_internal::raw_hash_set<absl::lts_20220623::container_internal::FlatHashMapPolicy<securefs::PODArray<unsigned char, 32ul>, int>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<std::__1::pair<securefs::PODArray<unsigned char, 32ul> const, int> > >::prepare_insert(unsigned long)) in archive libsecurefs-static.a
>>> referenced by file_table.cpp
>>>               file_table.cpp.o:(absl::lts_20220623::container_internal::raw_hash_set<absl::lts_20220623::container_internal::FlatHashMapPolicy<securefs::PODArray<unsigned char, 32ul>, std::__1::unique_ptr<securefs::FileBase, std::__1::default_delete<securefs::FileBase> > >, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<std::__1::pair<securefs::PODArray<unsigned char, 32ul> const, std::__1::unique_ptr<securefs::FileBase, std::__1::default_delete<securefs::FileBase> > > > >::prepare_insert(unsigned long)) in archive libsecurefs-static.a
>>> referenced 2 more times

ld: error: undefined symbol: absl::lts_20220623::container_internal::ConvertDeletedToEmptyAndFullToDeleted(absl::lts_20220623::container_internal::ctrl_t*, unsigned long)
>>> referenced by commands.cpp
>>>               commands.cpp.o:(absl::lts_20220623::container_internal::raw_hash_set<absl::lts_20220623::container_internal::FlatHashMapPolicy<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()> >, absl::lts_20220623::container_internal::StringHash, absl::lts_20220623::container_internal::StringEq, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::function<voqid ()> > > >::drop_deletes_without_resize()) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(absl::lts_20220623::container_internal::raw_hash_set<absl::lts_20220623::container_internal::FlatHashMapPolicy<securefs::PODArray<unsigned char, 32ul>, int>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<std::__1::pair<securefs::PODArray<unsigned char, 32ul> const, int> > >::drop_deletes_without_resize()) in archive libsecurefs-static.a
>>> referenced by file_table.cpp
>>>               file_table.cpp.o:(absl::lts_20220623::container_internal::raw_hash_set<absl::lts_20220623::container_internal::FlatHashMapPolicy<securefs::PODArray<unsigned char, 32ul>, std::__1::unique_ptr<securefs::FileBase, std::__1::default_delete<securefs::FileBase> > >, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<std::__1::pair<securefs::PODArray<unsigned char, 32ul> const, std::__1::unique_ptr<securefs::FileBase, std::__1::default_delete<securefs::FileBase> > > > >::drop_deletes_without_resize()) in archive libsecurefs-static.a
>>> referenced 2 more times

ld: error: undefined symbol: absl::lts_20220623::ByChar::Find(absl::lts_20220623::string_view, unsigned long) const
>>> referenced by operations.cpp
>>>               operations.cpp.o:(absl::lts_20220623::strings_internal::Splitter<absl::lts_20220623::ByChar, absl::lts_20220623::SkipEmpty, absl::lts_20220623::string_view>::ConvertToContainer<absl::lts_20220623::InlinedVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 32ul, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, false>::operator()(absl::lts_20220623::strings_internal::Splitter<absl::lts_20220623::ByChar, absl::lts_20220623::SkipEmpty, absl::lts_20220623::string_view> const&) const) in archive libsecurefs-static.a
>>> referenced by operations.cpp
>>>               operations.cpp.o:(absl::lts_20220623::strings_internal::Splitter<absl::lts_20220623::ByChar, absl::lts_20220623::SkipEmpty, absl::lts_20220623::string_view>::ConvertToContainer<absl::lts_20220623::InlinedVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 32ul, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, false>::operator()(absl::lts_20220623::strings_internal::Splitter<absl::lts_20220623::ByChar, absl::lts_20220623::SkipEmpty, absl::lts_20220623::string_view> const&) const) in archive libsecurefs-static.a
c++: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make[2]: stopped in /tmp/securefs0i51mqez
*** Error code 1

Stop.
make[1]: stopped in /tmp/securefs0i51mqez
*** Error code 1

Stop.
make: stopped in /tmp/securefs0i51mqez
Traceback (most recent call last):
  File "/usr/home/llucps/projects/securefs/build.py", line 82, in <module>
    main()
  File "/usr/home/llucps/projects/securefs/build.py", line 72, in main
    check_call("cmake", "--build", ".", "--config", "Release")
  File "/usr/home/llucps/projects/securefs/build.py", line 10, in check_call
    subprocess.check_call(args)
  File "/usr/local/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('cmake', '--build', '.', '--config', 'Release')' returned non-zero exit status 1.

I'm not sure whether these are the correct steps. Any idea of what to do?

Thanks in advance.

netheril96 commented 1 year ago

Try append this option --cmake_defines CMAKE_CXX_STANDARD=17.

netheril96 commented 1 year ago

I suspect that you have installed abseil from pkg and the build script uses that instead of vcpkg compiled one.

llucps commented 1 year ago

Still no luck... this is the command and below the result:

python3 build.py --cmake_defines CMAKE_CXX_STANDARD=17 --enable_test --vcpkg_root="/usr/home/llucps/projects/vcpkg/"

Executing ('cmake', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_TOOLCHAIN_FILE=/usr/home/llucps/projects/vcpkg//scripts/buildsystems/vcpkg.cmake', '-DCMAKE_CXX_STANDARD=17', '/usr/home/llucps/projects/securefs')
-- Running vcpkg install
Detecting compiler hash for triplet x64-freebsd...
The following packages will be built and installed:
    abseil:x64-freebsd -> 20230125.3
    argon2:x64-freebsd -> 20190702#1
    catch2:x64-freebsd -> 3.3.2
    cryptopp:x64-freebsd -> 8.7.0#3
    jsoncpp:x64-freebsd -> 1.9.5
    tclap:x64-freebsd -> 1.2.5
    utf8proc:x64-freebsd -> 2.7.0#1
  * vcpkg-cmake:x64-freebsd -> 2023-05-04
  * vcpkg-cmake-config:x64-freebsd -> 2022-02-06#1
Additional packages (*) will be modified to complete this operation.
Restored 9 package(s) from /home/llucps/.cache/vcpkg/archives in 607 ms. Use --debug to see more details.
Installing 1/9 vcpkg-cmake-config:x64-freebsd...
Elapsed time to handle vcpkg-cmake-config:x64-freebsd: 1.16 ms
Installing 2/9 vcpkg-cmake:x64-freebsd...
Elapsed time to handle vcpkg-cmake:x64-freebsd: 946 us
Installing 3/9 abseil:x64-freebsd...
Elapsed time to handle abseil:x64-freebsd: 160 ms
Installing 4/9 argon2:x64-freebsd...
Elapsed time to handle argon2:x64-freebsd: 3.29 ms
Installing 5/9 catch2:x64-freebsd...
Elapsed time to handle catch2:x64-freebsd: 87.8 ms
Installing 6/9 cryptopp:x64-freebsd...
Elapsed time to handle cryptopp:x64-freebsd: 221 ms
Installing 7/9 jsoncpp:x64-freebsd...
Elapsed time to handle jsoncpp:x64-freebsd: 22.9 ms
Installing 8/9 tclap:x64-freebsd...
Elapsed time to handle tclap:x64-freebsd: 3.8 ms
Installing 9/9 utf8proc:x64-freebsd...
Elapsed time to handle utf8proc:x64-freebsd: 4.44 ms
Total install time: 506 ms
abseil provides CMake targets:

    # this is heuristically generated, and may not be correct
    find_package(absl CONFIG REQUIRED)
    # note: 170 additional targets are not displayed.
    target_link_libraries(main PRIVATE absl::any absl::log absl::base absl::bits)

argon2 provides CMake targets:

    find_package(unofficial-argon2 CONFIG REQUIRED)
    target_link_libraries(main PRIVATE unofficial::argon2::libargon2)

catch2 provides CMake targets:

    # this is heuristically generated, and may not be correct
    find_package(Catch2 CONFIG REQUIRED)
    target_link_libraries(main PRIVATE Catch2::Catch2 Catch2::Catch2WithMain)

cryptopp provides CMake targets:

    # this is heuristically generated, and may not be correct
    find_package(cryptopp CONFIG REQUIRED)
    target_link_libraries(main PRIVATE cryptopp::cryptopp)

jsoncpp provides CMake targets:

    # this is heuristically generated, and may not be correct
    find_package(jsoncpp CONFIG REQUIRED)
    target_link_libraries(main PRIVATE JsonCpp::JsonCpp)

tclap is header-only and can be used from CMake via:

    find_path(TCLAP_INCLUDE_DIRS "tclap/Arg.h")
    target_include_directories(main PRIVATE ${TCLAP_INCLUDE_DIRS})

utf8proc provides CMake targets:

    # this is heuristically generated, and may not be correct
    find_package(unofficial-utf8proc CONFIG REQUIRED)
    target_link_libraries(main PRIVATE utf8proc)

-- Running vcpkg install - done
-- The C compiler identification is Clang 14.0.5
-- The CXX compiler identification is Clang 14.0.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
CMake Warning at /tmp/securefsz342ob_j/vcpkg_installed/x64-freebsd/share/unofficial-libargon2/unofficial-libargon2-config.cmake:2 (message):
  find_package(unofficial-libargon2) is deprecated.

  argon2 provides CMake targets:

      find_package(unofficial-argon2 CONFIG REQUIRED)
      target_link_libraries(main PRIVATE unofficial::argon2::libargon2)

Call Stack (most recent call first):
  /usr/home/llucps/projects/vcpkg/scripts/buildsystems/vcpkg.cmake:853 (_find_package)
  CMakeLists.txt:123 (find_package)

-- Found Python3: /usr/local/bin/python3 (found version "3.9.16") found components: Interpreter
-- Configuring done (3.6s)
-- Generating done (0.0s)
-- Build files have been written to: /tmp/securefsz342ob_j
Executing ('cmake', '--build', '.', '--config', 'Release')
[  2%] Building CXX object CMakeFiles/securefs-static.dir/git-version.cpp.o
[  5%] Building CXX object CMakeFiles/securefs-static.dir/sources/apple_xattr_workaround.cpp.o
[  8%] Building CXX object CMakeFiles/securefs-static.dir/sources/btree_dir.cpp.o
[ 11%] Building CXX object CMakeFiles/securefs-static.dir/sources/commands.cpp.o
[ 14%] Building CXX object CMakeFiles/securefs-static.dir/sources/common_platform.cpp.o
[ 17%] Building CXX object CMakeFiles/securefs-static.dir/sources/crypto.cpp.o
[ 20%] Building CXX object CMakeFiles/securefs-static.dir/sources/exceptions.cpp.o
[ 22%] Building CXX object CMakeFiles/securefs-static.dir/sources/file_table.cpp.o
[ 25%] Building CXX object CMakeFiles/securefs-static.dir/sources/files.cpp.o
[ 28%] Building CXX object CMakeFiles/securefs-static.dir/sources/fuse_tracer.cpp.o
[ 31%] Building CXX object CMakeFiles/securefs-static.dir/sources/lite_fs.cpp.o
[ 34%] Building CXX object CMakeFiles/securefs-static.dir/sources/lite_operations.cpp.o
[ 37%] Building CXX object CMakeFiles/securefs-static.dir/sources/lite_stream.cpp.o
[ 40%] Building CXX object CMakeFiles/securefs-static.dir/sources/lock_enabled.cpp.o
[ 42%] Building CXX object CMakeFiles/securefs-static.dir/sources/logger.cpp.o
[ 45%] Building CXX object CMakeFiles/securefs-static.dir/sources/mystring.cpp.o
[ 48%] Building CXX object CMakeFiles/securefs-static.dir/sources/myutils.cpp.o
[ 51%] Building CXX object CMakeFiles/securefs-static.dir/sources/operations.cpp.o
[ 54%] Building CXX object CMakeFiles/securefs-static.dir/sources/streams.cpp.o
[ 57%] Building CXX object CMakeFiles/securefs-static.dir/sources/unix.cpp.o
[ 60%] Building CXX object CMakeFiles/securefs-static.dir/sources/win.cpp.o
[ 62%] Linking CXX static library libsecurefs-static.a
[ 62%] Built target securefs-static
[ 65%] Building CXX object CMakeFiles/securefs.dir/main.cpp.o
[ 68%] Linking CXX executable securefs
ld: error: undefined symbol: absl::lts_20220623::container_internal::kEmptyGroup
>>> referenced by commands.cpp
>>>               commands.cpp.o:((anonymous namespace)::fix_helper(securefs::operations::FileSystemContext*, securefs::Directory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_set<securefs::PODArray<unsigned char, 32ul>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<securefs::PODArray<unsigned char, 32ul> > >*)) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:((anonymous namespace)::fix_helper(securefs::operations::FileSystemContext*, securefs::Directory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_set<securefs::PODArray<unsigned char, 32ul>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<securefs::PODArray<unsigned char, 32ul> > >*)) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(securefs::FixCommand::execute()) in archive libsecurefs-static.a
>>> referenced 13 more times

ld: error: undefined symbol: absl::lts_20220623::hash_internal::MixingHashState::kSeed
>>> referenced by commands.cpp
>>>               commands.cpp.o:((anonymous namespace)::fix_helper(securefs::operations::FileSystemContext*, securefs::Directory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_set<securefs::PODArray<unsigned char, 32ul>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<securefs::PODArray<unsigned char, 32ul> > >*)) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:((anonymous namespace)::fix_helper(securefs::operations::FileSystemContext*, securefs::Directory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_set<securefs::PODArray<unsigned char, 32ul>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<securefs::PODArray<unsigned char, 32ul> > >*)) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:((anonymous namespace)::fix_helper(securefs::operations::FileSystemContext*, securefs::Directory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_set<securefs::PODArray<unsigned char, 32ul>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<securefs::PODArray<unsigned char, 32ul> > >*)) in archive libsecurefs-static.a
>>> referenced 28 more times

ld: error: undefined symbol: absl::lts_20220623::hash_internal::MixingHashState::LowLevelHashImpl(unsigned char const*, unsigned long)
>>> referenced by commands.cpp
>>>               commands.cpp.o:((anonymous namespace)::fix_helper(securefs::operations::FileSystemContext*, securefs::Directory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_set<securefs::PODArray<unsigned char, 32ul>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<securefs::PODArray<unsigned char, 32ul> > >*)) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(securefs::FixCommand::execute()) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(absl::lts_20220623::hash_internal::MixingHashState::combine_contiguous(absl::lts_20220623::hash_internal::MixingHashState, unsigned char const*, unsigned long)) in archive libsecurefs-static.a

ld: error: undefined symbol: absl::lts_20220623::hash_internal::MixingHashState::CombineLargeContiguousImpl64(unsigned long, unsigned char const*, unsigned long)
>>> referenced by commands.cpp
>>>               commands.cpp.o:((anonymous namespace)::fix_helper(securefs::operations::FileSystemContext*, securefs::Directory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_set<securefs::PODArray<unsigned char, 32ul>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<securefs::PODArray<unsigned char, 32ul> > >*)) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(securefs::FixCommand::execute()) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(absl::lts_20220623::hash_internal::MixingHashState::combine_contiguous(absl::lts_20220623::hash_internal::MixingHashState, unsigned char const*, unsigned long)) in archive libsecurefs-static.a

ld: error: undefined symbol: absl::lts_20220623::base_internal::ThrowStdOutOfRange(char const*)
>>> referenced by commands.cpp
>>>               commands.cpp.o:((anonymous namespace)::fix_hardlink_count(securefs::operations::FileSystemContext*, securefs::Directory*, absl::lts_20220623::flat_hash_map<securefs::PODArray<unsigned char, 32ul>, int, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<std::__1::pair<securefs::PODArray<unsigned char, 32ul> const, int> > >*, (anonymous namespace)::NLinkFixPhase)) in archive libsecurefs-static.a
>>> referenced by operations.cpp
>>>               operations.cpp.o:(absl::lts_20220623::strings_internal::Splitter<absl::lts_20220623::ByChar, absl::lts_20220623::SkipEmpty, absl::lts_20220623::string_view>::ConvertToContainer<absl::lts_20220623::InlinedVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 32ul, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, false>::operator()(absl::lts_20220623::strings_internal::Splitter<absl::lts_20220623::ByChar, absl::lts_20220623::SkipEmpty, absl::lts_20220623::string_view> const&) const) in archive libsecurefs-static.a
>>> referenced by operations.cpp
>>>               operations.cpp.o:(absl::lts_20220623::strings_internal::Splitter<absl::lts_20220623::ByChar, absl::lts_20220623::SkipEmpty, absl::lts_20220623::string_view>::ConvertToContainer<absl::lts_20220623::InlinedVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 32ul, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, false>::operator()(absl::lts_20220623::strings_internal::Splitter<absl::lts_20220623::ByChar, absl::lts_20220623::SkipEmpty, absl::lts_20220623::string_view> const&) const) in archive libsecurefs-static.a

ld: error: undefined symbol: absl::lts_20220623::optional_internal::throw_bad_optional_access()
>>> referenced by commands.cpp
>>>               commands.cpp.o:(securefs::MountCommand::execute()) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(securefs::MountCommand::execute()) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(securefs::MountCommand::execute()) in archive libsecurefs-static.a
>>> referenced 12 more times

ld: error: undefined symbol: absl::lts_20220623::container_internal::FindInfo absl::lts_20220623::container_internal::find_first_non_full<void>(absl::lts_20220623::container_internal::ctrl_t const*, unsigned long, unsigned long)
>>> referenced by commands.cpp
>>>               commands.cpp.o:(absl::lts_20220623::container_internal::raw_hash_set<absl::lts_20220623::container_internal::FlatHashMapPolicy<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()> >, absl::lts_20220623::container_internal::StringHash, absl::lts_20220623::container_internal::StringEq, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::function<void ()> > > >::prepare_insert(unsigned long)) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(absl::lts_20220623::container_internal::raw_hash_set<absl::lts_20220623::container_internal::FlatHashMapPolicy<securefs::PODArray<unsigned char, 32ul>, int>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<std::__1::pair<securefs::PODArray<unsigned char, 32ul> const, int> > >::prepare_insert(unsigned long)) in archive libsecurefs-static.a
>>> referenced by file_table.cpp
>>>               file_table.cpp.o:(absl::lts_20220623::container_internal::raw_hash_set<absl::lts_20220623::container_internal::FlatHashMapPolicy<securefs::PODArray<unsigned char, 32ul>, std::__1::unique_ptr<securefs::FileBase, std::__1::default_delete<securefs::FileBase> > >, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<std::__1::pair<securefs::PODArray<unsigned char, 32ul> const, std::__1::unique_ptr<securefs::FileBase, std::__1::default_delete<securefs::FileBase> > > > >::prepare_insert(unsigned long)) in archive libsecurefs-static.a
>>> referenced 2 more times

ld: error: undefined symbol: absl::lts_20220623::container_internal::ConvertDeletedToEmptyAndFullToDeleted(absl::lts_20220623::container_internal::ctrl_t*, unsigned long)
>>> referenced by commands.cpp
>>>               commands.cpp.o:(absl::lts_20220623::container_internal::raw_hash_set<absl::lts_20220623::container_internal::FlatHashMapPolicy<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()> >, absl::lts_20220623::container_internal::StringHash, absl::lts_20220623::container_internal::StringEq, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::function<void ()> > > >::drop_deletes_without_resize()) in archive libsecurefs-static.a
>>> referenced by commands.cpp
>>>               commands.cpp.o:(absl::lts_20220623::container_internal::raw_hash_set<absl::lts_20220623::container_internal::FlatHashMapPolicy<securefs::PODArray<unsigned char, 32ul>, int>, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<std::__1::pair<securefs::PODArray<unsigned char, 32ul> const, int> > >::drop_deletes_without_resize()) in archive libsecurefs-static.a
>>> referenced by file_table.cpp
>>>               file_table.cpp.o:(absl::lts_20220623::container_internal::raw_hash_set<absl::lts_20220623::container_internal::FlatHashMapPolicy<securefs::PODArray<unsigned char, 32ul>, std::__1::unique_ptr<securefs::FileBase, std::__1::default_delete<securefs::FileBase> > >, securefs::id_hash, std::__1::equal_to<securefs::PODArray<unsigned char, 32ul> >, std::__1::allocator<std::__1::pair<securefs::PODArray<unsigned char, 32ul> const, std::__1::unique_ptr<securefs::FileBase, std::__1::default_delete<securefs::FileBase> > > > >::drop_deletes_without_resize()) in archive libsecurefs-static.a
>>> referenced 2 more times

ld: error: undefined symbol: absl::lts_20220623::ByChar::Find(absl::lts_20220623::string_view, unsigned long) const
>>> referenced by operations.cpp
>>>               operations.cpp.o:(absl::lts_20220623::strings_internal::Splitter<absl::lts_20220623::ByChar, absl::lts_20220623::SkipEmpty, absl::lts_20220623::string_view>::ConvertToContainer<absl::lts_20220623::InlinedVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 32ul, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, false>::operator()(absl::lts_20220623::strings_internal::Splitter<absl::lts_20220623::ByChar, absl::lts_20220623::SkipEmpty, absl::lts_20220623::string_view> const&) const) in archive libsecurefs-static.a
>>> referenced by operations.cpp
>>>               operations.cpp.o:(absl::lts_20220623::strings_internal::Splitter<absl::lts_20220623::ByChar, absl::lts_20220623::SkipEmpty, absl::lts_20220623::string_view>::ConvertToContainer<absl::lts_20220623::InlinedVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 32ul, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, false>::operator()(absl::lts_20220623::strings_internal::Splitter<absl::lts_20220623::ByChar, absl::lts_20220623::SkipEmpty, absl::lts_20220623::string_view> const&) const) in archive libsecurefs-static.a
c++: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make[2]: stopped in /tmp/securefsz342ob_j
*** Error code 1

Stop.
make[1]: stopped in /tmp/securefsz342ob_j
*** Error code 1

Stop.
make: stopped in /tmp/securefsz342ob_j
Traceback (most recent call last):
  File "/usr/home/llucps/projects/securefs/build.py", line 82, in <module>
    main()
  File "/usr/home/llucps/projects/securefs/build.py", line 72, in main
    check_call("cmake", "--build", ".", "--config", "Release")
  File "/usr/home/llucps/projects/securefs/build.py", line 10, in check_call
    subprocess.check_call(args)
  File "/usr/local/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('cmake', '--build', '.', '--config', 'Release')' returned non-zero exit status 1.

I checked the abseil packages and it's indeed installed

sudo pkg search abseil abseil-20220623.1 Abseil Common Libraries (C++)

Any idea of what else I could try?

Thanks.

netheril96 commented 1 year ago

My guess is that the build system is confused by the two abseil libraries. Can you try keep the above option but remove abseil from vcpkg.json?

llucps commented 1 year ago

I removed the abseil requirement from vcpkg.json so it looks like this:

{
    "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
    "dependencies": [
        "argon2",
        "cryptopp",
        "tclap",
        "utf8proc",
        "catch2",
        "jsoncpp"
    ]
}

And the result is the same.. same error.

Coulsd it be something else?

Thanks.

netheril96 commented 1 year ago

Try building without vcpkg.

First install all deps by pkg.

pkg install utf8proc jsoncpp libargon2 tclap cryptopp.

Then create a build directory, cd into it.

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DSECUREFS_USE_VCPKG=OFF -DSECUREFS_ENABLE_BUILD_TEST=OFF ${SECUREFS_SOURCE_DIR}

Then make.

llucps commented 1 year ago

Making progress.. now it fails on a different line:

sudo pkg install utf8proc jsoncpp libargon2 tclap cryptopp
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    cryptopp: 8.7.0
    tclap: 1.4.0.r1

Number of packages to be installed: 2

The process will require 78 MiB more space.
10 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/2] Fetching cryptopp-8.7.0.pkg: 100%    9 MiB   1.1MB/s    00:09
[2/2] Fetching tclap-1.4.0.r1.pkg: 100%   26 KiB  26.5kB/s    00:01
Checking integrity... done (0 conflicting)
[1/2] Installing cryptopp-8.7.0...
[1/2] Extracting cryptopp-8.7.0: 100%
[2/2] Installing tclap-1.4.0.r1...
[2/2] Extracting tclap-1.4.0.r1: 100%
[llucps@rubik ~/projects/securefs]$ mkdir build
[llucps@rubik ~/projects/securefs]$ cd build
[llucps@rubik ~/projects/securefs/build]$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DSECUREFS_USE_VCPKG=OFF -DSECUREFS_ENABLE_BUILD_TEST=OFF ../
-- The C compiler identification is Clang 14.0.5
-- The CXX compiler identification is Clang 14.0.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "1.8.1")
-- Checking for module 'libutf8proc'
--   Found libutf8proc, version 2.8.0
-- Checking for module 'libargon2'
--   Found libargon2, version 20190702
-- Checking for module 'jsoncpp'
--   Found jsoncpp, version 1.9.4
-- Found Python3: /usr/local/bin/python3 (found version "3.9.16") found components: Interpreter
-- Configuring done (2.4s)
-- Generating done (0.0s)
-- Build files have been written to: /home/llucps/projects/securefs/build
[llucps@rubik ~/projects/securefs/build]$ ls
CMakeCache.txt      CMakeFiles      CTestTestfile.cmake Makefile        cmake_install.cmake git-version.cpp
[llucps@rubik ~/projects/securefs/build]$ make
[  4%] Building CXX object CMakeFiles/securefs-static.dir/git-version.cpp.o
[  8%] Building CXX object CMakeFiles/securefs-static.dir/sources/apple_xattr_workaround.cpp.o
[ 12%] Building CXX object CMakeFiles/securefs-static.dir/sources/btree_dir.cpp.o
[ 16%] Building CXX object CMakeFiles/securefs-static.dir/sources/commands.cpp.o
/home/llucps/projects/securefs/sources/commands.cpp:704:40: error: reinterpret_cast from 'const std::basic_string<char>::value_type *' (aka 'const char *') to 'byte *' (aka 'unsigned char *') casts away qualifiers
            CryptoPP::SecureWipeBuffer(reinterpret_cast<byte*>(&pass.getValue()[0]),
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/home/llucps/projects/securefs/build
*** Error code 1

Stop.
make[1]: stopped in /usr/home/llucps/projects/securefs/build
*** Error code 1

Stop.
make: stopped in /usr/home/llucps/projects/securefs/build
netheril96 commented 1 year ago

This is more difficult than I have imagined. Let me provision a FreeBSD VM and try it out myself. Probably tomorrow.

llucps commented 1 year ago

No problem, I appreciate your help!.

Thanks!

llucps commented 1 year ago

As a side note, I've been able to compile securefs and a mac mini M1 with Ventura 13.4 using MacPorts, by installing this following ports:

sudo port install libutf8proc jsoncpp argon2 tclap libcryptopp

mkdir build && cd build

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DSECUREFS_USE_VCPKG=OFF -DSECUREFS_ENABLE_BUILD_TEST=OFF ../

cmake --build build --config Release ../

Also is there a way to mount the folder without having to have a terminal window open? Basically the same way as Gocryptfs or EncFS do. Jusr run the command in it gets mounted without having a window terminal permanently open.

securefs mount --plain-text-names securefs/ mount-securefs/

Is it possible to add fuse mount options as arguments? such as:

securefs mount --plain-text-names securefs/ mount-securefs/ -o volname="securefs"

Thanks.

netheril96 commented 1 year ago

You can run securefs mount -h to see all the options.

These are relevant to you


   --fssubtype <fssubtype>
     Filesystem subtype shown when mounted

   --fsname <fsname>
     Filesystem name shown when mounted

   -o <options>,  --opt <options>  (accepted multiple times)
     Additional FUSE options; this may crash the filesystem; use only for
     testing!

   -b,  --background
     Run securefs in the background (currently no effect on Windows)
netheril96 commented 1 year ago

I added a FreeBSD precompiled binary in 0.14.2.

I'll try to fix later the compilation problem when pkg installed libraries are present.

netheril96 commented 1 year ago

Fixed in fb34909dd3acfa19f5db890ab3469e9e7685c9e1.

llucps commented 1 year ago

Thank you very much @netheril96 . I used your compiled version and it works like a charm. I'll try to compile it myself later on.

On last thing I would like to ask, with the --plain-text-names parameter I get this warning:

securefs mount --plain-text-names --background /home/llucps/.doc /mnt/doc/ --log securefs.log

[Warning] [0x82b292000] [2023-06-13 11:28:28.470329686 UTC] [virtual int securefs::MountCommand::execute():1347] --plain-text-names should be used with out of tree JSON config. Please specify --config-path explicitly.

Does it mean that I should move the .securefs.json outside of the /mnt/.doc folder and add the --config parameter pointing where the file is? Like so:

securefs mount --plain-text-names --background /home/llucps/.doc /mnt/doc/ --config /home/llucps/.config/securefs/securefs.json

Thanks.

netheril96 commented 1 year ago

Yes

llucps @.***>于2023年6月13日 周二19:32写道:

Thank you very much @netheril96 https://github.com/netheril96 . I used your compiled version and it works like a charm. Later I'll try to compile it myself later on.

On last think I would like to ask, with the --plain-text-names parameter I get this warning:

securefs mount --plain-text-names --background /home/llucps/.doc /mnt/doc/ --log securefs.log

[Warning] [0x82b292000] [2023-06-13 11:28:28.470329686 UTC] [virtual int securefs::MountCommand::execute():1347] --plain-text-names should be used with out of tree JSON config. Please specify --config-path explicitly.

Does it mean that I should move the .securefs.json outside of the /mnt/.doc folder and add the parameter --config-path pointing where the file is? Like so:

securefs mount --plain-text-names --background /home/llucps/.doc /mnt/doc/ --config-path /home/llucps/.config/securefs.json

Thanks.

— Reply to this email directly, view it on GitHub https://github.com/netheril96/securefs/issues/156#issuecomment-1589118382, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGMJZ2ONLHZC44WRWUVGUDXLBFVJANCNFSM6AAAAAAZDMDREM . You are receiving this because you were mentioned.Message ID: @.***>

llucps commented 1 year ago

Thanks. 👍

llucps commented 1 year ago

FYI I tried to compile after pulling your changes from the repo and I'm still getting the same error:

First make sure all the packages are installed

sudo pkg install utf8proc jsoncpp libargon2 tclap cryptopp

Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed

And then:

[llucps@rubik ~/projects/securefs/build]$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DSECUREFS_USE_VCPKG=OFF -DSECUREFS_ENABLE_BUILD_TEST=OFF ../

-- The C compiler identification is Clang 14.0.5
-- The CXX compiler identification is Clang 14.0.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "1.8.1")
-- Checking for module 'libutf8proc'
--   Found libutf8proc, version 2.8.0
-- Checking for module 'libargon2'
--   Found libargon2, version 20190702
-- Checking for module 'jsoncpp'
--   Found jsoncpp, version 1.9.4
-- Found Python3: /usr/local/bin/python3 (found version "3.9.16") found components: Interpreter
-- Configuring done (2.8s)
-- Generating done (0.0s)
-- Build files have been written to: /home/llucps/projects/securefs/build
[llucps@rubik ~/projects/securefs/build]$ make
[  4%] Building CXX object CMakeFiles/securefs-static.dir/git-version.cpp.o
[  8%] Building CXX object CMakeFiles/securefs-static.dir/sources/apple_xattr_workaround.cpp.o
[ 12%] Building CXX object CMakeFiles/securefs-static.dir/sources/btree_dir.cpp.o
[ 16%] Building CXX object CMakeFiles/securefs-static.dir/sources/commands.cpp.o
/home/llucps/projects/securefs/sources/commands.cpp:704:40: error: reinterpret_cast from 'const std::basic_string<char>::value_type *' (aka 'const char *') to 'byte *' (aka 'unsigned char *') casts away qualifiers
            CryptoPP::SecureWipeBuffer(reinterpret_cast<byte*>(&pass.getValue()[0]),
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/home/llucps/projects/securefs/build
*** Error code 1

Stop.
make[1]: stopped in /usr/home/llucps/projects/securefs/build
*** Error code 1

Am I missing something? Did you do something different when compiling on FreeBSD?

Oh by the way I also checked that I had fusefs-libs installed.

sudo pkg install fusefs-libs

Updating` FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed

Thanks.

netheril96 commented 1 year ago

FYI I tried to compile after pulling your changes from the repo and I'm still getting the same error:

First make sure all the packages are installed

sudo pkg install utf8proc jsoncpp libargon2 tclap cryptopp

Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed

And then:

[llucps@rubik ~/projects/securefs/build]$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DSECUREFS_USE_VCPKG=OFF -DSECUREFS_ENABLE_BUILD_TEST=OFF ../

-- The C compiler identification is Clang 14.0.5
-- The CXX compiler identification is Clang 14.0.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "1.8.1")
-- Checking for module 'libutf8proc'
--   Found libutf8proc, version 2.8.0
-- Checking for module 'libargon2'
--   Found libargon2, version 20190702
-- Checking for module 'jsoncpp'
--   Found jsoncpp, version 1.9.4
-- Found Python3: /usr/local/bin/python3 (found version "3.9.16") found components: Interpreter
-- Configuring done (2.8s)
-- Generating done (0.0s)
-- Build files have been written to: /home/llucps/projects/securefs/build
[llucps@rubik ~/projects/securefs/build]$ make
[  4%] Building CXX object CMakeFiles/securefs-static.dir/git-version.cpp.o
[  8%] Building CXX object CMakeFiles/securefs-static.dir/sources/apple_xattr_workaround.cpp.o
[ 12%] Building CXX object CMakeFiles/securefs-static.dir/sources/btree_dir.cpp.o
[ 16%] Building CXX object CMakeFiles/securefs-static.dir/sources/commands.cpp.o
/home/llucps/projects/securefs/sources/commands.cpp:704:40: error: reinterpret_cast from 'const std::basic_string<char>::value_type *' (aka 'const char *') to 'byte *' (aka 'unsigned char *') casts away qualifiers
            CryptoPP::SecureWipeBuffer(reinterpret_cast<byte*>(&pass.getValue()[0]),
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/home/llucps/projects/securefs/build
*** Error code 1

Stop.
make[1]: stopped in /usr/home/llucps/projects/securefs/build
*** Error code 1

Am I missing something? Did you do something different when compiling on FreeBSD?

Oh by the way I also checked that I had fusefs-libs installed.

sudo pkg install fusefs-libs

Updating` FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed

Thanks.

I haven’t fixed compilation against system libs on FreeBSD. What I have fixed is compilation against vcpkg using build.py.

llucps commented 1 year ago

Oh ok, it would be great if it were possible to compile without having to use vcpkg. The same way I could compile with macOS. That would be ideal :) If possible.

netheril96 commented 1 year ago

You can now compile it on FreeBSD against system libs in bce0eae6585810ef5d03becae8ed1dc308ac4ffe.

But it doesn't work: it crashes. The pkg installed cryptopp may be bugged, and even when it isn't, it has no hardware acceleration.

I suggest that you stick with vcpkg.

And by the way, don't use -DCMAKE_CXX_STANDARD=17 on macOS.

llucps commented 1 year ago

ok thanks!

jpdoyle commented 1 year ago

S

-------- Original Message -------- On Jun 13, 2023, 19:22, Siyuan Ren < @.> wrote: Reopened #156. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.> [ { @.": "http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "[https://github.com](<a href=)/netheril96/securefs/issues/156#event-9521813375">https://github.com/netheril96/securefs/issues/156#event-9521813375", "url": "[https://github.com](<a href=)/netheril96/securefs/issues/156#event-9521813375">https://github.com/netheril96/securefs/issues/156#event-9521813375", "name": "View Issue" }, "description": "View this Issue on GitHub","publisher": { @.": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

diizzyy commented 10 months ago

Updated to 0.14.3 as of https://github.com/freebsd/freebsd-ports/commit/1e9f8e5ccaa18abe55e129673cd90431ff012361 so it at least builds but it's untested however