Skip to content
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

Info about rust release #386

Merged
merged 13 commits into from
Nov 13, 2021
Merged

Info about rust release #386

merged 13 commits into from
Nov 13, 2021

Conversation

Andrey1994
Copy link
Member

No description provided.

Signed-off-by: Andrey Parfenov <a1994ndrey@gmail.com>
Signed-off-by: Andrey Parfenov <a1994ndrey@gmail.com>
Signed-off-by: Andrey Parfenov <a1994ndrey@gmail.com>
Signed-off-by: Andrey Parfenov <a1994ndrey@gmail.com>
Signed-off-by: Andrey Parfenov <a1994ndrey@gmail.com>
Signed-off-by: Andrey Parfenov <a1994ndrey@gmail.com>
@Andrey1994 Andrey1994 requested a review from trobanga November 7, 2021 23:11
@trobanga
Copy link
Contributor

trobanga commented Nov 8, 2021

The example needs an update according to #385:

let board = board_shim::BoardShim::new(BoardIds::SyntheticBoard, params).unwrap();

@Andrey1994
Copy link
Member Author

Andrey1994 commented Nov 8, 2021

publishing to crates.io is blocked by rust-lang/crates.io#40 possible solutions are:

  • consider other registries(https://doc.rust-lang.org/cargo/reference/registries.html), unfortunately, GitHub packages don't provide a registry for rust but maybe there are other options
  • ask for a quote higher than 10MB
  • don't publish crates for now
  • change a script to download tar with released libraries like its done for julia, but its a bad option and I don't like it even in julia

Building C\C++ code from Rust is not an option.

@trobanga
Copy link
Contributor

trobanga commented Nov 9, 2021

Building C\C++ code from Rust is not an option.

Why not? In my first version I did exactly that.

@trobanga
Copy link
Contributor

trobanga commented Nov 9, 2021

  • I don't think another registry is a good solution because crates.io is the default. I don't even know about others.
  • it will be hard to argue for a higher quote because the preferred way is to build from source. I think it has many advantages over providing libs e.g. build for other platforms
  • I also don't like the idea to dowload it from somewhere else

@Andrey1994
Copy link
Member Author

Andrey1994 commented Nov 9, 2021

#386 (comment) first of all because technically it's exactly the same as downloading binary files since source code should be downloaded from github first but in addition it requires compilation

Also, this way rust users will need to install CMake, Visual Studio, and some very specific components for Visual Studio(correct winsdk version, atl package, smth from UWP to work with BLE, etc).
And since it requires manual installation of Visual Studio and other software with the same success users can compile C\C++ code by themselves first and I don't see any benefits of using package registry.

Finally, it's extra work to reproduce CMake options in Rust build script.

@trobanga
Copy link
Contributor

trobanga commented Nov 9, 2021

But you are downloading ~30MB now of which 2 / 3 you don't need because they are for different platforms. If you do that for all your dependencies it will blow up.
Then the problem you are describing is specific to windows. One option could be to ship only Windows binaries and for other platforms build from source. I don't know how large the win bins are but with that it might be possible to stay below 10MB.

Adding CMake options to the build script isn't really that much and it's a one time thing.

@Andrey1994
Copy link
Member Author

It's just 20MB for all platforms and also it can be separated by OS if at a certain point these files will be too big. 20MB is literally nothing and it's way easier to download it than wait for compilation.

Numpy whl is 14MB, TensorFlow whl for CPU is almost 500MB for example and everybody is using it as a precompiled binary, even in Tensorflow for Rust they download binaries by default(https://github.com/tensorflow/rust#usage), 10MB limitation in a package registry is very weird as for me

@trobanga
Copy link
Contributor

trobanga commented Nov 9, 2021

for TF you only download the binary for your platform. What you want is to ship binaries for Windows, Linux, and Mac. Two third of that payload you don't need. I don't know how it is for crates.io but it's likely they pay for their traffic so it's reasonably for them to keep it small. Also, if you have many dependencies it adds up. Image 10 dependencies with 60MB each...

Building from source has pros and cons but I think the pros outweigh

@Andrey1994 Andrey1994 merged commit 32c28d8 into gh-pages Nov 13, 2021
@delete-merged-branch delete-merged-branch bot deleted the info_release branch November 13, 2021 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants