-
Notifications
You must be signed in to change notification settings - Fork 3
emsdk: new recipe #4
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
base: main
Are you sure you want to change the base?
Conversation
Apologies for my ignorance, but how would the migration of my profile to WebAssembly work, as shown below? $ cat ~/.conan2/profiles/webassembly
include(default)
[settings]
arch=wasm
os=Emscripten
[tool_requires]
*: emsdk/4.0.10 |
@skhaz no problem at all! This would be a great wasm 32-bit profile:
Notice the usage of Ninja (if you are in windows, its crucial to avoid some compilation issues, and in general, Ninja is a better opcion over Makefile). And the usage of In the docs you could find more information about other architectures such the experimental I hope it helps! |
--- | ||
## 🧰 Built-in Profiles | ||
|
||
This repository includes several **pre-configured Conan profiles** designed to make toolchain setup effortless: |
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.
Each "toolchain" should have a readme with tailored instructions - as I would expect this grow in the future.
I would refer to them as "reference" profiles - the ones we test, leaving it up to users to customise before installing. e.g. the "native" one still requires manual configuration, so I'm not sure that's effortless, there's still some use intervention needed in some instances.
we may consider having the profile .zip files as releases - so that a user can do conan config install https://github.com/xxxx/emsdk_profiles_1.0.zip
or something like that - so that they get only what they need
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.
In this line, another approach would be to have the profiles in a specific folder, under the emsdk
folder. Let the users manually copy them, or if not, they can do a conan config install --source-folder
to specify the specific folder. But better that than a single conan config install
that will bring different profiles for emcc
, cuda
, etc, etc, of different unrelated things that users will not want in general
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.
That is another good approach, right now, what I've done in the CI is the ability to publish recipe specific profiles manually with a github action, check out my fork releases: https://github.com/perseoGI/conan-toolchains/releases
This can be installed with:
$ conan config install https://github.com/perseoGI/conan-toolchains/releases/download/emsdk-4.0.10-profiles.zip/emsdk-4.0.10-profiles.zip
Allowing profile isolation with different recipes, and also, keeping a profile versioning.
Do you like this approach?
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.
Seem a bit overkill to me, in terms of extra effort to publish and release the profiles, version them, etc.
One of the reasons of using the conan-toolchains
repo is that it is not necessary to provide the same backward compatibility and previous versions support, and it is possible a more "live at head" approach. So such a strong effort towards versioning profiles seems very overkill to me.
@@ -0,0 +1,15 @@ | |||
[platform_tool_requires] | |||
emsdk/4.0.10 | |||
|
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.
The name "native" can be confusing because "native" usually means the "local cpu architecture".
I would probably go for another name.
This profile seems to assume that all these tools are discoverable in PATH
, otherwise they won't work, other than perhaps in CMake.
Is there a case for adding a PATH in the [buildenv]
section to point to the installation directory, in case it is not in the system PATH?
once again ,a README for this profiles may clarify these questions
generators = "CMakeToolchain", "VirtualBuildEnv" | ||
|
||
def build_requirements(self): | ||
self.tool_requires(self.tested_reference_str) |
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 would probably have a test_package
that is a regular requires and tests the post-conditions (e.g. checking emcc
is called, etc)
and a separate, standalone "sample" project that is tested with the profiles in the profiles/emsdk
folder instead. That way we test all the profiles
Thank you so much @perseoGI. Sorry bugging you again, I am just trying to help. Do you know if do I need some extra setup? ERROR: Package 'emsdk/4.0.10' not resolved: Unable to find 'emsdk/4.0.10' in remotes. Ot it is not published yet? cat ~/.conan2/profiles/default
[settings]
arch=armv8
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=17
os=Macos
[replace_tool_requires]
meson/*: meson/[*]
pkgconf/*: pkgconf/[*]
[tool_requires]
!cmake/*: cmake/[>=3 <4]
[conf]
tools.cmake.cmaketoolchain:generator=Ninja cat ~/.conan2/profiles/webassembly
include(default)
[tool_requires]
ninja/[*]
emsdk/4.0.10
[settings]
arch=wasm
build_type=Release
compiler=emcc
compiler.cppstd=17
compiler.libcxx=libc++
compiler.version=4.0.10
os=Emscripten |
Hi @skhaz For the time being - this new repo will be available as a local recipes index and not published to Conan Center - we want the focus of Conan Center to remain on libraries, and treat these (there will be more!) as a separate case - eventually we may make the recipes available in a remote. You'd have to follow these instructions: https://github.com/perseoGI/conan-toolchains/tree/pgi/new/emsdk, however since it has not been merged, you have to do the following:
For the recipe to be available. |
My bad, thank you so much. |
+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.
I have reviewed the emsdk
recipe part mostly, and there are a couple of comments to check, but overall looks good.
For the CI part, I haven't seen any important issues, so looking good to me too. Not sure if some of the comments of @jcar87 are pending to check.
env.define_path("EMSCRIPTEN", self._emscripten) | ||
env.define_path("EM_CONFIG", self._em_config) | ||
env.define_path("EM_CACHE", self._em_cache) | ||
env.vars(self, scope="emsdk").save_script("emsdk_env_file") |
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 not very clear who is using this file in this scope.
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 also confusing that the PATHs of this file are pointing to the package_folder/something
paths, that doesn't really exist when the build()
method runs, and it might even not be defined with package_folder=None
for local conan build
or conan install
operations.
@@ -0,0 +1,4 @@ | |||
cmake_minimum_required(VERSION 3.15) |
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 unclear how this test_example
uses emsdk, it looks like a regular C++ executable application?
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.
Yes, this is a very basic test_example application which does nothing with Emsdk.
I could complicate the code.
Right now, the deep examples of usage of this toolchain are in conan-examples2
Maybe we could move those examples here, but it might be preferable to keep this repository as simple as possible.
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.
Yes, if this doesn't have any clear instructions how to use this and run it in the browser or something like that, better follow up on the examples2
repo.
Summary
Original PR conan-io/conan-center-index#27213