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

[7zip] Some implementations aren't compiled #42910

Open
msclock opened this issue Dec 24, 2024 · 0 comments · May be fixed by #42911
Open

[7zip] Some implementations aren't compiled #42910

msclock opened this issue Dec 24, 2024 · 0 comments · May be fixed by #42911
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@msclock
Copy link
Contributor

msclock commented Dec 24, 2024

Describe the bug
in #41721, it removed some necessary sources such as CPP/Windows/PropVariant.cpp under the subdir CPP/Windows/ casues the unavailable dynamic library built for dlopen becuase of the lack of its implementations.

Actually, some sources in build CMakeLists such as CPP/7zip/Archive/ApmHandler.cpp in the latest hash https://github.com/ip7z/7zip/blob/e5431fa6f5505e385c6f9367260717e9c47dc2ee/CPP/7zip/Archive/ApmHandler.cpp#L1-L12 contain the headers with the relative path #include "../../Windows/PropVariantUtils.h" which had been removed in #41721.

Environment

  • OS: Linux
vscode ➜ /workspaces/pybit7z (master) $ uname -a
Linux f3e2c9372be8 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  • Compiler:
vscode ➜ /workspaces/pybit7z (master) $ g++ --version
g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

To Reproduce
It always build successfully with included relative path headers.

Additional context
Reproduce commands:

git clone https://github.com/msclock/pybit7z.git
cd pybit7z
git fetch origin 5cdb6ef15757afb4831bfb91e859b0e4b35ea99a
git checkout 5cdb6ef15757afb4831bfb91e859b0e4b35ea99a
sed -i 's/24.08/24.09/g' vcpkg.json # use problematic version 24.09
cmake -S. --preset default-config
cmake --build --preset default-config-debug
ctest --preset default-config-debug
Test project /workspaces/pybit7z/out/build/default-config
    Start 1: _core.version
1/3 Test #1: _core.version .......................   Passed    0.00 sec
    Start 2: _core_pybit7z_test.compress
2/3 Test #2: _core_pybit7z_test.compress .........***Failed    0.00 sec
Running main() from /usr/local/vcpkg/buildtrees/gtest/src/v1.15.2-41f5afb119.clean/googletest/src/gtest_main.cc
Note: Google Test filter = _core_pybit7z_test.compress
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from _core_pybit7z_test
[ RUN      ] _core_pybit7z_test.compress
unknown file: Failure
C++ exception with description "Failed to load the 7-zip library: Bad file descriptor" thrown in the test body.

[  FAILED  ] _core_pybit7z_test.compress (1 ms)
[----------] 1 test from _core_pybit7z_test (1 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (1 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] _core_pybit7z_test.compress

 1 FAILED TEST


50% tests passed, 1 tests failed out of 2

Total Test time (real) =   0.01 sec

The following tests FAILED:
          2 - _core_pybit7z_test.compress (Failed)
Errors while running CTest

Try to correct manually:

cp /usr/local/vcpkg/ports/7zip cmake/vcpkg/ports/ -rf # use overlay port
sed -i 's/if(WIN32)/if(NOT WIN32)/g' cmake/vcpkg/ports/7zip/CMakeLists.txt # Only include sources on Linux
cmake -S. --preset default-config
cmake --build --preset default-config-debug
vscode ➜ /workspaces/pybit7z (master) $ ctest --preset default-config-debug
Test project /workspaces/pybit7z/out/build/default-config
    Start 1: _core.version
1/3 Test #1: _core.version .......................   Passed    0.00 sec
    Start 2: _core_pybit7z_test.compress
2/3 Test #2: _core_pybit7z_test.compress .........   Passed    0.07 sec
    Start 3: _core_pybit7z_test.archive_writer
3/3 Test #3: _core_pybit7z_test.archive_writer ...   Passed    0.02 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   0.09 sec
@msclock msclock linked a pull request Dec 24, 2024 that will close this issue
@JonLiu1993 JonLiu1993 added the category:port-bug The issue is with a library, which is something the port should already support label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants