-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Initial support for wasmtime package #6083
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
50fbaa9
to
7663797
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically we a hesitant about adding binary downloads https://github.com/conan-io/conan-center-index/blob/41d4fbb8c218f9d938ccb8b9d888bff52002e62e/docs/packaging_policy.md
You'll need to wait for the CCI teams to move this forward of not
self.cpp_info.libs = ["wasmtime"] | ||
else: | ||
if self.settings.os == "Windows": | ||
self.cpp_info.defines= ["/DWASM_API_EXTERN=", "/DWASI_API_EXTERN="] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conan should handle the rest
self.cpp_info.defines= ["/DWASM_API_EXTERN=", "/DWASI_API_EXTERN="] | |
self.cpp_info.defines.extend(["WASM_API_EXTERN", "WASI_API_EXTERN"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without /D
conan generates some strange defines and test_package does not work:
set(CONAN_DEFINES_WASMTIME "-DWASM_API_EXTERN"
"-DWASI_API_EXTERN")
set(CONAN_BUILD_MODULES_PATHS_WASMTIME )
# COMPILE_DEFINITIONS are equal to CONAN_DEFINES without -D, for targets
set(CONAN_COMPILE_DEFINITIONS_WASMTIME "WASM_API_EXTERN"
"WASI_API_EXTERN")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for a lot of other recipes. https://github.com/conan-io/conan-center-index/search?p=2&q=cpp_info+defines
You need to use it in tandem with the other comment https://github.com/conan-io/conan-center-index/pull/6083/files#r663361146
I update the suggestion with a better syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better syntax, but it is not working ...
Please, check it locally in Windows machine
|
||
add_executable(example example.cpp) | ||
target_link_libraries(example PRIVATE wasmtime::wasmtime) | ||
target_compile_options(example PRIVATE ${CONAN_COMPILE_DEFINITIONS_WASMTIME}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be included with the targets
target_compile_options(example PRIVATE ${CONAN_COMPILE_DEFINITIONS_WASMTIME}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot do this, because wasmtime::wasmtime
do not have compile definitions for this target ...
By some reason conan
do not add target_compile_definitions(...)
for this target
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also very strange behavior:
set(CONAN_DEFINES_WASMTIME "-D/DWASM_API_EXTERN="
"-D/DWASI_API_EXTERN=")
set(CONAN_BUILD_MODULES_PATHS_WASMTIME )
# COMPILE_DEFINITIONS are equal to CONAN_DEFINES without -D, for targets
set(CONAN_COMPILE_DEFINITIONS_WASMTIME "/DWASM_API_EXTERN="
"/DWASI_API_EXTERN=")
CONAN_COMPILE_DEFINITIONS_WASMTIME
generated properly, but CONAN_DEFINES_WASMTIME
is incorrect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With https://github.com/conan-io/conan-center-index/pull/6083/files#r670901897, this should be correct now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it is not, see comment above for it
|
||
class WasmtimeConan(ConanFile): | ||
name = 'wasmtime' | ||
homepage = 'https://github.com/bytecodealliance/wasmtime' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
homepage = 'https://github.com/bytecodealliance/wasmtime' | |
homepage = 'https://wasmtime.dev/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disagree, because later I will add package for wasmtime-cpp
and it would be weird to have two projects with the same home directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those should be the same recipe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be separate receipts wasmtime
(only C API) and wasmtime-cpp
(C++ API)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also https://wasmtime.dev/
is not descriptive enough for understanding how to use this package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you will still need this package
As I mentioned previously I will create support with dependency on this package when I will create wasmtime-cpp
See the issue:
bytecodealliance/wasmtime-cpp#1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's okay to have two recipes share the same homepage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Home page should be meaningful
https://wasmtime.dev/ does not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you're right.
The c api lives in the main/crates/c-api
subfolder.
How does this project relate to wasm-c-api
at https://github.com/WebAssembly/wasm-c-api/?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@madebr It is unrelated project
This policy that you mentioned looks bad ... Because there are lots of ways to signal that package has vulnerabilities, for example to mark it with some flag, also source code could be analyzed by Official support will be provided by me bytecodealliance/wasmtime-cpp#1 Biulding from sources is not available, because this package is build by |
You can build the rust compiler https://github.com/rust-lang/rust#installing-from-source add it as a build requirements and compile this project from source |
What is the point of doing this ? Why |
Conan produces binary packages from source code to be consumed... by downloading from other services theres a risk of incompatiblity with ABI and platform variations. Not all binaries are permitted to be distrusted which has also been an issue in the past. The last PR of this nature is stalled so I just wanted to warn you this topic has not been resolved. Packaging pre compiled binaries is possible it's just an on going issue in CCI |
…x into add-wasmtime
Update license type Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
except KeyError: | ||
raise ConanInvalidConfiguration("Binaries for this combination of architecture/version/os not available") | ||
|
||
if (self.settings.compiler, self.settings.os) == ("gcc", "Windows") and self.options.shared: | ||
# FIXME: https://github.com/bytecodealliance/wasmtime/issues/3168 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was merged in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, but we will need to wait for the next release to have shared mingw avaialble.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh I did not look, but thats for checking!
This comment has been minimized.
This comment has been minimized.
@Croydon @prince-chrismc @SSE4 @uilianries @jgsogo |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
All green in build 33 (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried about the issue with self.cpp_info.defines
, but it's probably more related to a Conan client missing/incomplete feature. Now with the new toolchains effort, it's the time to try and fix these errors.
Anyway, I see value having this recipe available to build on top of it. As always, details and improvements will arrive in following PRs 💪
this is blocked by an old review
|
Specify library name and version: wasmtime/0.29.0
conan-center hook activated.