victori / slack4adium

Slack support for Adium
6 stars 2 forks source link

Not tracking upstream closely enough #2

Open fredcooke opened 6 years ago

fredcooke commented 6 years ago

Hi, I have MacOS and XCODE etc available to me and want to use this, however it appears to be quite out of date already, and the build instructions are a bit light. If you can help me ramp up, maybe I can maintain available binaries for everyone in a more timely/automatic way? What's certain is that the "releases" link doesn't have much. If there was one per commit or per push to the master of @dylex's repo, that'd be ideal. Thoughts?

fredcooke commented 6 years ago

For example, cloned, make, fail - xcode needs configuring with:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

Retry, failed, looked in slack-libpurple, no code despite some message from submodules about update. Cloned that source into that directory nesting it, and:

/Users/fred/repos/public/slack4adium/slack-libpurple/slack-api.c:1:10: fatal error: 
      'debug.h' file not found
#include <debug.h>
         ^~~~~~~~~

** BUILD FAILED **

The following build commands failed:
    CompileC build/slack4adium.build/Release/slack4adium.build/Objects-normal/x86_64/slack-im.o slack-libpurple/slack-im.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
make: *** [compile] Error 65

And submodules status looks like:

-0369e5eb81e7c32f8735f87e291f36df0dd11c2e adium
-d855c29d182f6646b26c68b0c8474d677832d28f slack-libpurple

Which makes me think I need Adium sources from somewhere, too. Which I then cloned, then realised that submodule init and update are both required to make the repo usable. Did the init, then swapped the precloned ones back in place, tried an update complained about some outdated hashes, did a status, showed current hashes, tried make again:

/Users/fred/repos/public/slack4adium/slack-libpurple/json.c:906:11: warning: 
      variable 'root' may be uninitialized when used here
      [-Wconditional-uninitialized]
   return root;
          ^~~~
/Users/fred/repos/public/slack4adium/slack-libpurple/json.c:228:28: note: 
      initialize the variable 'root' to silence this warning
   json_value * top, * root, * alloc = 0;
                           ^
                            = NULL
1 warning generated.

** BUILD FAILED **

The following build commands failed:
    CompileC build/slack4adium.build/Release/slack4adium.build/Objects-normal/x86_64/AISlackPlugin.o slack4adium/AISlackPlugin.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
make: *** [compile] Error 65

At which point I'm lost. Maybe some make file option to disable -Werror or something?

floyd-fuh commented 5 years ago

A big "yes, me too" here! If the author could indicate with which commits (of this repo and slack-libpurple) and dependencies it should work that would be very helpful.

Btw. Slack is basically using @victori as a scapegoat. Look at https://.slack.com/account/gateways where Slack shamelessly writes:

There are community-authored open source tools that provide an IRC-like experience on top of Slack APIs. Although they are not directly supported or built by Slack, you can use these resources to access your Slack workspace. 

[...]
slack-libpurple is a module for libpurple XMPP clients, such as Adium

Note that they write Adium here, which basically means this project...

DavidShepherdson commented 5 years ago

I just wanted to note that I've managed to get this to build and work with Xcode 10.1 on 'Mojave' 10.14.2!

Here's a brief summary of what I did to get it to this point.

  1. Cloned this repository.
  2. In the terminal, make init to get the sub-modules for adium and slack-libpurple initialised.
  3. Once the sub-modules were initialised, moved the 'adium' directory aside, since I couldn't get it to compile, and instead cloned the latest Adium source from https://bitbucket.org/adium/adium.
    • Made sure the cloned Mercurial repository was in the same place as the original 'adium' directory.
    • Switched to the 'adium-1.5.10.4' branch in the Mercurial repository.
  4. Opened the Adium Xcode project in Xcode, and let it auto-fix most of the project-related warnings. The exceptions were that I turned off the suggestions to add more compiler warnings (since I figured there were enough already! plus this wasn't going to affect whether or not it would build) and did not allow the proposed changes to do with weak references in the Auto-Hyperlink project (because I found these led to errors when building).
  5. Changed the build targets for the Auto-Hyperlinks framework to use 64-bit rather than 32-bit.
  6. Replaced one of the '.xib' files in the Adium project with a version from the original Git sub-module that was cloned in step 2, specifically ContactListChangeUserPictureMenu.xib. I found that Adium wouldn't compile with the version included from the Mercurial repository (saying that it targeted a too-old version of Mac OS X), and when I tried to fix this by opening it in Xcode and changing the target option, Xcode crashed. So I copied in the version from the Git sub-module instead, and this was enough to get Adium building.
  7. In the terminal, cd adium and then make. It all built! (After the changes described above, that is.)
  8. In the terminal, cd .. (back to the main 'slack-adium' directory) and then make. It all built!

It's possible I've oversimplified or missed a step here, because unfortunately I didn't make notes when I was doing it, so this list has been cobbled together from log output and Git and Mercurial diffs, but I think this was the gist of it.

In any case, I now have a binary slack4adium.AdiumPlugin, and have confirmed it is working in Adium for me. Not sure if there's some way I can provide that binary here as a quick-fix for people who don't want to wade through the above steps to get it building locally. I may see if I can do that via forking this repository and committing the changes I made (though that won't help for the Adium-side changes, obviously, unless I fork that too...). But I thought it worth giving these notes in the meantime, in case anybody else wants to have a try!

floyd-fuh commented 5 years ago

I don't want to criticize anyone and I'm glad that there are these Open Source projects that do the job Slack is too lazy to do. However, if you are thinking about using this plugin, you should read https://github.com/dylex/slack-libpurple/pull/67 and decide for yourself if you want to run this plugin. I personally decided against it, because of potential buffer overflows.

dylex commented 5 years ago

Just for the record, that PR was not merged, so I'm not exactly sure what the specific concern is.

michael-j-oconnor commented 5 years ago

@DavidShepherdson, Does your recompiled plugin work with group chats? Especially with Slack pulling the plug on IRC/Jabber support, that's what I'm missing.

DavidShepherdson commented 5 years ago

@michael-j-oconnor: The company I work for decided to switch to Slack from the internal Jabber server we'd been using previously, so I was in a similar boat -- that's why I was trying to get this up and running.

I worked very hard on getting group chats functioning in Adium, but in the end I just couldn't make it happen. From memory, I could get them to show up in the buddy list, sometimes, but I couldn't make joining actually work. I went deep into trying to debug this, including taking the exact same build of the underlying plug-in code and loading it in Pidgin for Mac -- where it worked fine. But in Adium, it would either crash or just never make the API calls to Slack to get it working. I could see it getting the listing of available groups/channels, and populating the internal data structures with all the right ids and so on, but it would never actually associate that with the buddy list or chat-joining code, and I couldn't see anything wrong to explain why not. (In addition, Adium kept crashing whenever I tried to launch it via the debugger in Xcode, so I had to do all of this with print statements and running it from a terminal to see the console output…)

In the end, I decided I had spent much too long on it without making any apparent progress, so I very reluctantly abandoned this and switched my attention to hacking the CSS etc. in the native/browser-based Slack client to be a bit less annoying, and throwing together some custom bots and REST clients to fill in some of the missing pieces like offline logging and scriptable status.

The very best of luck to you if you're going to try to get it working! Unfortunately it was just beyond me (or how long I could spend on it) at the time.