-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Add yaml #397
Add yaml #397
Conversation
Hi! This is the friendly conda-forge-admin automated user. I just wanted to let you know that I linted all conda-recipes in your PR ( |
cc @msarahan |
73e9f0b
to
234d867
Compare
Please don't merge yet. Am waiting for feedback from @msarahan as to whether this recipe is in line with Continuum's build and if there is anything needing fixing or improvement. |
6d759b8
to
2923544
Compare
So, it didn't have an install step. Right now, I am copying over the library. However, we should be copying over the headers too. Also, it only builds a static library, but a dynamic library should be doable too. This would require a very simple patch. |
4c2335e
to
e1ec38f
Compare
b9c06e7
to
20da14e
Compare
patches: | ||
# Change CMakeLists so that we can build static and shared libraries. | ||
# See this PR ( https://github.com/yaml/libyaml/pull/10 ) for details. | ||
- CMakeLists.txt.patch |
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 patch ( yaml/libyaml#10 ) let's us build DLLs and LIBs. It was the simplest thing I could come up with. Though improvements are certainly welcome.
add_definitions (-DHAVE_CONFIG_H -DYAML_DECLARE_STATIC) | ||
-add_library (yaml STATIC ${SRC}) | ||
- | ||
+add_library (yaml ${LIB_TYPE} ${SRC}) |
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.
Going by the CMake file by @gillins on the jpeg recipe, I think you can achieve the same effect by adding two libraries.
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, adding 2 different ones is the right 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.
Moreover, you should prefer it, as it gives you both a static lib and a dynamic lib. Might need to change the name of the static lib, though, so they don't overlap.
maybe yaml_s
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 problem with doing this is this breaks with existing yaml
package in defaults
. If you could share what you guys are doing to build it there, I would be happy to update this even if it is shared verbally, but I don't think it is a good idea to rename this library and break with the defaults
yaml
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.
It looks like someone created or copied a custom VS solution and projects. This is "land before time" stuff - no history in our repo on it. File modification times between 2010 and 2012.
Suffice to say, the DLL is the one that everyone uses. It should have the default name. The static one can safely have some other name, IMHO (and the defaults channel package does not include it, anyway).
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.
Would there be a way to have both libraries have the same name and only do one build? I initially tried to find something like this, but was unable to get anything like that to work.
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, Windows has 2 different things both with .lib, and you need both of
them. One filename has to change to have both in one package.
On Thu, Apr 21, 2016, 20:04 jakirkham [email protected] wrote:
In recipes/yaml/CMakeLists.txt.patch
#397 (comment)
:++OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
++SET (LIB_TYPE STATIC)
++IF (BUILD_SHARED_LIBS)
++ SET (LIB_TYPE SHARED)
++ENDIF (BUILD_SHARED_LIBS)
++
- set (YAML_VERSION_MAJOR 0)
- set (YAML_VERSION_MINOR 1)
- set (YAML_VERSION_PATCH 6)
+@@ -12,5 +19,4 @@ file (GLOB SRC src/*.c)
+- include_directories (include win32)
- add_definitions (-DHAVE_CONFIG_H -DYAML_DECLARE_STATIC)
+-add_library (yaml STATIC ${SRC})
+-
++add_library (yaml ${LIB_TYPE} ${SRC})Would there be a way to have both libraries have the same name and only do
one build? I initially tried to find something like this, but was unable to
get anything like that to work.—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/conda-forge/staged-recipes/pull/397/files/20da14e8df6aa1519d098c524871ea2191674708#r60678605
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.
You have to make sure the import lib for the DLL doesn't get overwritten by your static lib so probably safest to have different names. I was also unable to work out how to do one build for static/shared with cmake for jpeg. This might be because on Linux (and some other OS's) static and shared builds need different compile flags.
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.
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.
Sorry to be necromancing an ancient topic, but this static lib name change did indeed break a number of things (as some of the downstream consumers of libyaml are very stable and not often updated, it's taken awhile to discover the issues). We've changed the default back, but made it configurable from cmake (see yaml/libyaml#136) so anyone that might need the new name can at least get it back if they want.
Looks like this is pretty close. 👍 |
Please check out jakirkham#8 - I think that will make this one ready to go. |
build static and dll on win. Cleanup.
Hi! This is the friendly automated conda-forge-linting service. I wanted to let you know that I linted all conda-recipes in your PR ( Here's what I've got... For recipes/yaml:
|
Thanks for doing that @msarahan. Sorry I haven't had lots of time to play with this of late. |
Could you please submit this new patch upstream if you haven't already, @msarahan, and cross reference it here? Also, please cc me on the PR. |
- | ||
+add_library (yaml SHARED ${SRC}) | ||
+set_target_properties(yaml PROPERTIES COMPILE_FLAGS "-DYAML_DECLARE_EXPORT -DHAVE_CONFIG_H") | ||
+add_library (yaml_static STATIC ${SRC}) |
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.
Maybe we could do yaml_s
. I know FLANN does something like this.
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
Updated the PR to contain the new patch. |
Going to clear this one out. Thanks everyone for your help. |
Adds a recipe to build yaml. Written from scratch. Seems to work ok and is building the same version in
defaults
so shouldn't cause conflicts by its addition.Would really appreciate any feedback on this. The Windows portion was just my best guess at what might work and could be totally off. The Mac and Linux builds actually seem to work ok.
Windows needs: