antonio-antuan / rust-tdlib

Rust client for TDlib
MIT License
57 stars 11 forks source link

Use autogenerated tdlib libraries to enable CI #1

Closed dorak88783 closed 3 years ago

dorak88783 commented 3 years ago

Hi, I saw you disabled the CI steps in https://github.com/aCLr/rust-tdlib/blob/master/.github/workflows/rust.yml because of "tests disables in case of unavailable tdlib =(".

I just made a github action flow that compiles tdlib, it's at https://github.com/dorak88783/tdlib-builder. If you want you can use this to get a tdlib library available to run the tests. I have it working in a private repo. If you like this idea/flow I can try to make it work in this repo and make PR. What do you think?

antonio-antuan commented 3 years ago

I wanted to make this, but do not have enough time. Your action flow looks great but currently it uses tdlib 1.7.1. I'm just working on that version and it is not finished yet.

It would be better to specify particular tdlib version within particular rust-tdlib branch.

Also I think that if we will build tdlib each time it can take a lot of extra time. What if we will use a docker-image with already build tdlib?

dorak88783 commented 3 years ago

I think I could make it such that it compiles different versions, I can check. Which one do you prefer right now?

In my view, the TDlib library compilation only happens once, in this td-builder repository. You can just clone this repository in your action and get the library from there, which is quick. I didn't propose to copy my action flow to your action flow.

antonio-antuan commented 3 years ago

Ok. I almost finish 1.7.0 support and going to implement tests run with github actions as soon as possible.

antonio-antuan commented 3 years ago

@dorak88783 I have just tried to use library from your repo and build fails with /usr/bin/ld: cannot find -ltdjson. I think that the most right config may looks like that: RUSTFLAGS: "-C link-args=-Wl,-rpath,tdlib-builder/lib" Here is more logs: https://github.com/aCLr/rust-tdlib/runs/2222307705. Could you provide linker args that you use?

dorak88783 commented 3 years ago

It took me some time to get it working as well :) I now have

RUSTFLAGS: "-C link-args=-Wl,-rpath=./tdlib-builder/lib/,--verbose -L./tdlib-builder/lib/"

I think the -L argument is the only part missing from your command.

antonio-antuan commented 3 years ago

Great, I've just checked it on my laptop and it works fine thanks. I will integrate it in a couple of hours.

вт, 30 мар. 2021 г. в 10:37, dorak88783 @.***>:

It took me some time to get it working as well :) I now have

RUSTFLAGS: "-C link-args=-Wl,-rpath=./tdlib-builder/lib/,--verbose -L./tdlib-builder/lib/"

I think the -L argument is the only part missing from your command.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aCLr/rust-tdlib/issues/1#issuecomment-809990087, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRBAYG2JO347MNWL27SYITTGF5VFANCNFSM4XKWJBXQ .

antonio-antuan commented 3 years ago

ok, it's done. thanks for your help.