-
Notifications
You must be signed in to change notification settings - Fork 89
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
celix_ShellCxx extraction error #643
Comments
As a note, I tested using |
I cannot reproduce your issue on a brand-new Ubuntu machine. If following these steps strictly does not address your issue, feel free to reopen it. Setup Project
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps
class cxx_shell_exampleRecipe(ConanFile):
name = "cxx_shell_example"
version = "0.1"
package_type = "library"
# Optional metadata
license = "<Put the package license here>"
author = "<Put your name here> <And your email here>"
url = "<Package recipe repository url here, for issues about the package>"
description = "<Description of cxx_shell_example package here>"
topics = ("<Put some tag here>", "<here>", "<and here>")
# Binary configuration
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {"shared": False, "fPIC": True}
# Sources are located in the same place as this recipe, copy them to the recipe
exports_sources = "CMakeLists.txt", "src/*", "include/*"
# MODIFICATION: setup environment for me
generators = "VirtualRunEnv"
def config_options(self):
if self.settings.os == "Windows":
self.options.rm_safe("fPIC")
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
# MODIFICATION: minimal requirement
self.options["celix"].build_shell_tui = True
def requirements(self):
self.requires("celix/2.3.0")
def generate(self):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)
# MODIFICATION: workaround for 642
if self.settings.os == "Linux":
tc.cache_variables["CMAKE_EXE_LINKER_FLAGS"] = "-Wl,--unresolved-symbols=ignore-in-shared-libs"
elif self.settings.os == "Macos":
tc.cache_variables["CMAKE_EXE_LINKER_FLAGS"] = "-Wl,-undefined -Wl,dynamic_lookup"
tc.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install() cmake_minimum_required(VERSION 3.15)
project(cxx_shell_example CXX)
# MODIFICATION: use Celix to build bundle container
find_package(Celix)
add_celix_container(TestCelixContainer CXX
BUNDLES
Celix::ShellCxx
Celix::shell_tui
)
Build
Run
|
Thank you. From a quick glance, I'd say I might be missing the I forgot about Conan create command, might use it to restart my recipe file to make sure I have the new good practices. If I encounter the problem again, I'll push the project somewhere to make it easier. |
Yes, that would be very helpful. |
Hello, I pushed a repository. There are two branches:
As far as I can tell, the error message is the same on both branch, and only in release on both branch. I have a readme in each branch with the information I could think of. Note that the version and profiles are the same between the two branches, I just realized I put one half in each readme. PS: I added shell scripts files in both branches to reproduce the command sequences. |
You are using Conan 2, but dev_celix_with_clion still reference to Conan 1. We need to fix it. Thanks. For Conan 2, you don't need a separate mkdir build
cd build
conan build .. --build missing -s:h build_type=Release
cd Release/deploy/TestCelixContainer/
source ../../generators/conanrun.sh
./TestCelixContainer
and doTheThing-debug.sh to mkdir build
cd build
conan build .. --build missing -pr default -s:h build_type=Debug
cd Debug/deploy/TestCelixContainer/
source ../../generators/conanrun.sh
./TestCelixContainer Both work on my machine. If you prefer working in Clion, |
Hello. Thank you for having a look. I indeed use the separate Conan install out of habits from V1. I noticed I forgot the profile in the debug build step, I guess I must not have properly purged my build directory when I checked the script. I am already using the CMakeUserPresets.json file and usually build & debug with the IDE. I am simply using the .sh scripts to eliminate CLion as a potential cause. I tried updating the scripts with the one provided, the error still remains. I find it weird that the debug correctly works but not the release. I committed the bundles from the release folder on both branches. I can inflate them, and they don't appear to be corrupted. Is it normal for it to extract to This bundle appears to be the only C++ one of those I tested (shell TUI and WUI), could it be linked? Thanks again. |
Using your project, The #include <celix_launcher.h>
int main(int argc, char *argv[]) {
const char * config = "\
CELIX_CONTAINER_NAME=TestCelixContainer\n\
CELIX_BUNDLES_PATH=bundles\n\
\
\
\
CELIX_AUTO_START_3=celix_http_admin.zip celix_ShellCxx.zip celix_shell_tui.zip celix_shell_wui.zip\n\
\
\
\
\
";
celix_properties_t *embeddedProps = celix_properties_loadFromString(config);
return celixLauncher_launchAndWaitForShutdown(argc, argv, embeddedProps);
} build/Release/deploy/TestCelixContainer/
├── bundles
│ ├── celix_http_admin.zip
│ ├── celix_ShellCxx.zip
│ ├── celix_shell_tui.zip
│ └── celix_shell_wui.zip
├── .cache
│ ├── bundle1
│ │ ├── bundle_state.properties
│ │ ├── resources
│ │ │ ├── libhttp_admin.so.0
│ │ │ └── META-INF
│ │ │ └── MANIFEST.MF
│ │ └── storage
│ │ └── root
│ ├── bundle2
│ │ ├── bundle_state.properties
│ │ ├── resources
│ │ │ ├── libShellCxx.so.2
│ │ │ └── META-INF
│ │ │ └── MANIFEST.MF
│ │ └── storage
│ ├── bundle3
│ │ ├── bundle_state.properties
│ │ ├── resources
│ │ │ ├── libshell_tui.so.1
│ │ │ └── META-INF
│ │ │ └── MANIFEST.MF
│ │ └── storage
│ └── bundle4
│ ├── bundle_state.properties
│ ├── resources
│ │ ├── libshell_wui.so.1
│ │ ├── META-INF
│ │ │ └── MANIFEST.MF
│ │ └── resources
│ │ ├── ansi_up.js
│ │ ├── index.html
│ │ └── script.js
│ └── storage
└── TestCelixContainer
20 directories, 20 files
I guess not. From the following message, the bundle path is resolved correctly, but "no such file or directory" is reported.
Since the issue is not reproducible on my machine, I suggest:
set(CMAKE_C_FLAGS "-g ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-g ${CMAKE_CXX_FLAGS}")
|
Hello, I was able to track the problem in a RelWithDebInfo build. I did purge the whole Conan just in case (remove and cache clean to be safe) and re-exported Celix after pulling to get latest commits. Celix commit:
Debug:
Not sure why the order is different, but ensuring the destination folder is created first looks like it would fix the problem. PS: I also added the CMake edits to the project. |
Using the zip file you provide, a unit test reproduces this issue: TEST_F(FileUtilsTestSuite, ExtractZipFileTest2) {
std::cout << "Using test zip location " << SHELL_ZIP_LOCATION << std::endl;
const char* extractLocation = "extract_location";
celix_utils_deleteDirectory(extractLocation, nullptr);
//Given a test zip file, I can extract this to a provided location and the correct files are extracted
EXPECT_FALSE(celix_utils_fileExists(extractLocation));
auto status = celix_utils_extractZipFile(SHELL_ZIP_LOCATION, extractLocation, nullptr);
EXPECT_EQ(status, CELIX_SUCCESS);
celix_utils_deleteDirectory(extractLocation, nullptr);
} Thank you very much for taking time debugging this right before a new release. |
You are welcome, thank you for taking the time as well. I'm glad it got figured out in the end. |
@SkyWhiteEagle May I ask how was this zip produced? Do you have jar installed? If not, it will be produced using zip. According to standard, a manifest file entry named META-INF/MANIFEST. MF is automatically generated by the jar tool and is always the first entry in the jar file. Inspecting the zip file, I found:
|
I would say no: Is there another test to check if I have jar? |
It seems that we have encountered a corner case caused by bundle produced by zip. Anyway, |
I uninstall Java from my machine, create Celix using zip.
|
Bundle produces by zip does not necessarily begin with META-INF.
[#643] Create destination directory before performing decompression.
Hi,
I don't think this is related to #642 so I'm opening another issue.
I am trying to make a project using Celix. I am using Conan V2 and CMake to build the project.
I locally exported the Conan recipe from the master branch (e1d7fc1, as far as I can tell, the previous release is not Conan V2 compatible) and required it in my consumer recipe. I set the following in my recipe:
In my CMake I have:
When running the container in release, I get:
In debug however, the container works like a charm. In can see no obvious difference between the release and debug folder. beside the fact that the bundles have a
-Debug
suffix. Even more puzzling to me, in the.cache
or the release, I see abundle2
folder, does that mean that the shell TUI bundle was extracted just fine?Thanks in advance.
The text was updated successfully, but these errors were encountered: