-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Build lib separately (shared on unix; stay static on win) #33
Conversation
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 ( |
72db7e0
to
0c5db76
Compare
and incorporating lots of experience from conda-forge#26 & conda-forge#30
developed in conda-forge#26
…nda-forge-pinning 2022.12.11.21.21.05
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.
Hey @xhochy
I finally cracked this one. 🥳
The main change to the previous attempts (#26, #30, #32) was that I gave up on shared libraries on windows - which, honestly, I feel I should have done months ago. Protobuf+windows+shared is just an insane effort (also seen in grpc, etc.), so I don't feel too bad about that.
This package comes with some binaries as well, which are currently placed with libsentencepiece
(because I didn't want to do further CMake surgery), making it akin to libprotobuf
carrying protoc
. Are you strongly against that? If yes, how would you name an output for the binaries?
Would appreciate your review. 🙃
Likewise for you all, @isuruf @hmaarrfk @carterbox
# binaries | ||
{% for each_bin in ["decode", "encode", "export_vocab", "normalize", "train"] %} | ||
- spm_{{ each_bin }} --help | ||
{% endfor %} |
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.
See here for binaries
-#define ABSL_FLAG(Type, name, defautl_value, help) \ | ||
- absl::Flag<Type> FLAGS_##name(#name, #Type, help, defautl_value); | ||
+#define STPC_FLAG(Type, name, default_value, help) \ | ||
+ sentencepiece::Flag<Type> FLAGS_##name(#name, #Type, help, default_value); |
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 might be ways to avoid patch 6, but sentencepiece definitely does not use abseil in the way that's prescribed by abseil - it's already heavily blurring the lines of third_party
with sentencepiece-specific glue code, but redefining the ABSL_FLAG
macro was the last straw at the time that just made me rip out this whole piece and place it somewhere else. Perhaps there's a less nuclear way.
@@ -0,0 +1,884 @@ | |||
From 9f225f6f83ccea1909974ee95da9b724d017dad3 Mon Sep 17 00:00:00 2001 |
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.
Will you be able to maintain this patch "manually"? Seems like the changes here could be better persisted as a well-formed sed
command.
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 planning to get some of these changes upstream in some form...
Looks good in general. The comments were mostly there to hint at places where you could ease your maintenance. |
given you got xonchy's attention, i think you are in good hands! Ill refrain from further comments. |
In most cases, you can build the package without installing it to PREFIX. Then manually install components to PREFIX using a bash script for each recipe output. Editing CMake is typically only required if you are trying to separate libs into multiple outputs because you have to separate the CMake config files (but binaries don't have config files). |
@carterbox |
It could be named
Can't comment on value add. Not familiar enough with the sizes of the binaries or use patterns of this package. |
Not a bad idea IMO. Thoughts @xhochy? |
@carterbox, I implemented your idea, PTAL. Still interested if you'd also have some thoughts on this approach @xhochy :) |
@conda-forge-admin, please rerender |
…nda-forge-pinning 2022.12.15.19.46.12
OK. No more suggestions after that last one. Looks very good! Great job, @h-vetinari. |
Co-authored-by: Daniel Ching <carterbox@users.noreply.github.com>
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.
Great job, @h-vetinari! Thanks for being persistent.
Probably time to give up this hopeless battle for the shared windows libs
Closes #32
Closes #30
Closes #26
Closes #25