avencera / fast_rss Goto Github PK
View Code? Open in Web Editor NEWFast Elixir RSS feed parser, a NIF wrapper around the Rust RSS crate
Home Page: https://avencera.github.io/fast_rss/
License: Apache License 2.0
Fast Elixir RSS feed parser, a NIF wrapper around the Rust RSS crate
Home Page: https://avencera.github.io/fast_rss/
License: Apache License 2.0
Since this project uses Rustler, I was curious if would you be open/interested in contributions to set up rusteler_precompiled
.
I am not sure the benefits (end-users not needing to have the Rust toolchain setup) would outweigh the costs (I think this is mostly the updated release flow) for you, so I wanted to ask.
elixir-explorer/explorer#123 is an example of setting rustler_precompiled
up for the Explorer package for reference of the scope of code changes.
Hi, my project is getting this error when trying to compile fast_rss:
==> fast_rss
Compiling NIF crate :fastrss (native/fastrss)...
could not compile dependency :fast_rss, "mix compile" failed. You can recompile this dependency with "mix deps.compile fast_rss", update it with "mix deps.update fast_rss" or clean it with "mix deps.clean fast_rss"
** (ErlangError) Erlang error: :enoent
(elixir) lib/system.ex:791: System.cmd("cargo", ["rustc", "--release"], [cd: "/Users/longpham/PlainJoe/mere-elixir/deps/fast_rss/native/fastrss", stderr_to_stdout: true, env: [{"CARGO_TARGET_DIR", "/Users/longpham/PlainJoe/mere-elixir/_build/dev/rustler_crates/fastrss"}], into: %IO.Stream{device: :standard_io, line_or_bytes: :line, raw: false}])
lib/mix/tasks/compile.rustler.ex:59: Mix.Tasks.Compile.Rustler.compile_crate/1
(elixir) lib/enum.ex:1336: Enum."-map/2-lists^map/1-0-"/2
lib/mix/tasks/compile.rustler.ex:15: Mix.Tasks.Compile.Rustler.run/1
(mix) lib/mix/task.ex:331: Mix.Task.run_task/3
(mix) lib/mix/tasks/compile.all.ex:73: Mix.Tasks.Compile.All.run_compiler/2
(mix) lib/mix/tasks/compile.all.ex:53: Mix.Tasks.Compile.All.do_compile/4
(mix) lib/mix/tasks/compile.all.ex:24: anonymous fn/1 in Mix.Tasks.Compile.All.run/1
I have installed the rustler compiler. This just started happening but I have not made any changes. Please advise. Thanks.
Hi, I started receiving this warning message:
[warning] The on_load function for module Elixir.FastRSS.Native returned:
{:error, {:upgrade, ~c"Upgrade not supported by this NIF library."}}
Hi! Have trouble parsing one of my feeds.
Simplified example for reproducing:
FastRSS.parse("<?xml version=\"1.0\" encoding=\"windows-1251\"?>\n<rss version=\"2.0\">\n<channel>\n<image>\n<url>https://www.pravda.com.ua/images/up.gif</url>\n<title>Українська правда</title>\n</image></channel></rss>")
{:ok,
...
"title" => "Українська правда",
...
}
Hi, was looking to use this library but unfortunately cannot get it to work. Any help would be appreciated!
fast_rss does not compile with OTP 24
> mix new test
> cd test
mix.exs
: defp deps do
[
+ {:fast_rss, "~> 0.3.4"}
]
end
> mix deps.get
> mix deps.compile
error: failed to run custom build command for `rustler v0.21.1`
Caused by:
process didn't exit successfully: `../test/_build/dev/rustler_crates/fastrss/release/build/rustler-626542afcb83fdb7/build-script-build` (exit status: 101)
--- stderr
thread 'main' panicked at 'Erlang version 2.16 not handled, please file a a bug report.', ~/.cargo/registry/src/github.com-1ecc6299db9ec823/rustler-0.21.1/build.rs:50:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
could not compile dependency :fast_rss, "mix compile" failed. You can recompile this dependency with "mix deps.compile fast_rss", update it with "mix deps.update fast_rss" or clean it with "mix deps.clean fast_rss"
** (RuntimeError) Rust NIF compile error (rustc exit code 101)
(rustler 0.21.1) lib/mix/tasks/compile.rustler.ex:68: Mix.Tasks.Compile.Rustler.compile_crate/1
(elixir 1.12.3) lib/enum.ex:1582: Enum."-map/2-lists^map/1-0-"/2
(rustler 0.21.1) lib/mix/tasks/compile.rustler.ex:15: Mix.Tasks.Compile.Rustler.run/1
(mix 1.12.3) lib/mix/task.ex:394: anonymous fn/3 in Mix.Task.run_task/3
(mix 1.12.3) lib/mix/tasks/compile.all.ex:92: Mix.Tasks.Compile.All.run_compiler/2
(mix 1.12.3) lib/mix/tasks/compile.all.ex:72: Mix.Tasks.Compile.All.compile/4
(mix 1.12.3) lib/mix/tasks/compile.all.ex:59: Mix.Tasks.Compile.All.with_logger_app/2
(mix 1.12.3) lib/mix/tasks/compile.all.ex:36: Mix.Tasks.Compile.All.run/1
> erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
"24"
> rustc --version
rustc 1.58.0 (02072b482 2022-01-11)
> cargo -V
cargo 1.58.0 (7f08ace4f 2021-11-24)
fast_rss can not be compiled on Apple silicon machines. (tested MacBook Air M1 and Mac Mini M1)
git clone https://github.com/avencera/fast_rss.git
cd fast_rss/native/fast_rss
cargo build
Compiling fastrss v0.3.4 (/Users/xyz/projects/fast_rss/native/fastrss)
error: linking with `cc` failed: exit code: 1
| = note: "cc" "-arch" "arm64" "-L"
...
"_enif_make_ulong", referenced from:
rustler_sys::rustler_sys_api::enif_make_uint64::h91baac3b2385276e in librustler-59c101a7d2d24b76.rlib(rustler-59c1
01a7d2d24b76.rustler.dwm3a0p8-cgu.11.rcgu.o)
"_enif_map_iterator_destroy", referenced from:
rustler::wrapper::map::map_iterator_destroy::h77beffe1b4aee532 in librustler-59c101a7d2d24b76.rlib(rustler-59c101a
7d2d24b76.rustler.dwm3a0p8-cgu.5.rcgu.o)
"_enif_inspect_binary", referenced from:
rustler::types::binary::Binary::from_term::h1ec1d456e999be0f in librustler-59c101a7d2d24b76.rlib(rustler-59c101a7d
2d24b76.rustler.dwm3a0p8-cgu.7.rcgu.o)
"_enif_make_long", referenced from:
rustler_sys::rustler_sys_api::enif_make_int64::heaf33182494c79e0 in librustler-59c101a7d2d24b76.rlib(rustler-59c10
1a7d2d24b76.rustler.dwm3a0p8-cgu.11.rcgu.o)
"_enif_get_int", referenced from:
rustler::types::primitive::_$LT$impl$u20$rustler..types..Decoder$u20$for$u20$i32$GT$::decode::hd3eae8639ed4e1ad in
librustler-59c101a7d2d24b76.rlib(rustler-59c101a7d2d24b76.rustler.dwm3a0p8-cgu.2.rcgu.o)
rustler::types::primitive::_$LT$impl$u20$rustler..types..Decoder$u20$for$u20$i8$GT$::decode::h30347873db0b3fbf in
librustler-59c101a7d2d24b76.rlib(rustler-59c101a7d2d24b76.rustler.dwm3a0p8-cgu.2.rcgu.o)
rustler::types::primitive::_$LT$impl$u20$rustler..types..Decoder$u20$for$u20$i16$GT$::decode::hcfeee7acfd34ef25 in
librustler-59c101a7d2d24b76.rlib(rustler-59c101a7d2d24b76.rustler.dwm3a0p8-cgu.2.rcgu.o)
"_enif_get_long", referenced from:
rustler_sys::rustler_sys_api::enif_get_int64::hc07907041ed94abb in librustler-59c101a7d2d24b76.rlib(rustler-59c101
a7d2d24b76.rustler.dwm3a0p8-cgu.11.rcgu.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: aborting due to previous error
error: could not compile `fastrss`
cargo 1.50.0 (f04e7fab7 2021-02-04)
~/p/f/n/fastrss ❯❯❯ rustc --version
rustc 1.50.0 (cb75ad5db 2021-02-10)
I've noticed that bench
was a total separate Elixir project within fast_rss
. Is there a reason why it was implemented that way?
Is it possible to move benchmark Elixir project within bench
folder into fast_rss
project instead where all dependencies used for benchmark tagged for :bench
environment?
It seems that the checksums file on hex.pm is called checksum-Elixir.FastRss.Native.exs instead of checksum-Elixir.FastRSS.Native.exs, so upgrading gives this error:
== Compilation error in file lib/fast_rss.ex ==
** (RuntimeError) Error while downloading precompiled NIF: the precompiled NIF file does not exist in the checksum file. Please consider run: `mix rustler_precompiled.download FastRSS.Native --only-local` to generate the checksum file..
You can force the project to build from scratch with:
config :rustler_precompiled, :force_build, fast_rss: true
In order to force the build, you also need to add Rustler as a dependency in your `mix.exs`:
{:rustler, ">= 0.0.0", optional: true}
lib/fast_rss.ex:13: (module)
lib/fast_rss.ex:6: (module)
This was caused by #17. It seems that the RELEASE.md file has been updated but not the checksums filename.
Best regards,
Thiago Romano
I got curious about what Crate is being used, but I was unable to find it in the README.
Hi, I'm getting this error; the suggested workaround does not work: how should I proceed? Thanks!
== Compilation error in file lib/fast_rss.ex ==
** (RuntimeError) Error while downloading precompiled NIF: the precompiled NIF file does not exist in the checksum file. Please consider run: `mix rustler_precompiled.download FastRSS.Native --only-local` to generate the checksum file..
Are there any plans to support parsing of Atom feeds?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.