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

Build with stable rust #33

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
toolchain: [ stable, nightly-2024-08-19 ]
runs-on: ${{ matrix.os }}
steps:
- name: VCS Checkout
uses: actions/checkout@v4
- name: Install latest nightly
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-08-19
toolchain: ${{ matrix.toolchain }}
- name: Setup Node.js 18
uses: actions/setup-node@v3
with:
Expand Down
22 changes: 22 additions & 0 deletions .run/Build Stable.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build Stable" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="buildProfileId" value="dev" />
<option name="command" value="build" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<envs>
<env name="RUSTC_WRAPPER" value="sccache" />
</envs>
<option name="emulateTerminal" value="false" />
<option name="channel" value="STABLE" />
<option name="requiredFeatures" value="true" />
<option name="allFeatures" value="false" />
<option name="withSudo" value="false" />
<option name="buildTarget" value="REMOTE" />
<option name="backtrace" value="SHORT" />
<option name="isRedirectInput" value="false" />
<option name="redirectInputPath" value="" />
<method v="2">
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
</method>
</configuration>
</component>
9 changes: 5 additions & 4 deletions .run/Build.run.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="buildProfileId" value="dev" />
<option name="command" value="build" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<envs>
<env name="RUSTC_WRAPPER" value="sccache" />
</envs>
<option name="emulateTerminal" value="false" />
<option name="channel" value="NIGHTLY" />
<option name="requiredFeatures" value="true" />
<option name="allFeatures" value="false" />
<option name="withSudo" value="false" />
<option name="buildTarget" value="REMOTE" />
<option name="backtrace" value="SHORT" />
<envs>
<env name="RUSTC_WRAPPER" value="sccache" />
</envs>
<option name="isRedirectInput" value="false" />
<option name="redirectInputPath" value="" />
<method v="2">
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
</method>
</configuration>
</component>
</component>
12 changes: 7 additions & 5 deletions .run/Test.run.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="buildProfileId" value="test" />
<option name="command" value="test" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<envs>
<env name="RUSTC_WRAPPER" value="sccache" />
</envs>
<option name="emulateTerminal" value="false" />
<option name="channel" value="NIGHTLY" />
<option name="requiredFeatures" value="true" />
<option name="allFeatures" value="false" />
<option name="emulateTerminal" value="false" />
<option name="withSudo" value="false" />
<option name="buildTarget" value="REMOTE" />
<option name="backtrace" value="FULL" />
<envs>
<env name="RUSTC_WRAPPER" value="sccache" />
</envs>
<option name="isRedirectInput" value="false" />
<option name="redirectInputPath" value="" />
<method v="2">
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
</method>
</configuration>
</component>
</component>
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ rand = "0.8"
rand_chacha = "0.3"
random-string = "1.0"
rust-embed = { version = "8.0", features = ["debug-embed", "compression"] }
rustc_version = "0.4"
semver = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
10 changes: 10 additions & 0 deletions plugins/arithmetic/crates/plugin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,27 @@ reactive-graph-runtime-model = { workspace = true }
reactive-graph-model-arithmetic = { version = "0.10.0", path = "../../crates/model" }
reactive-graph-model-result = { version = "0.10.0", path = "../../../result/crates/model" }

[build-dependencies]
rustc_version = { workspace = true }

[dev-dependencies]
default-test = { workspace = true }
reactive-graph-graph = { workspace = true, features = ["test"] }
reactive-graph-test-utils = { workspace = true }

[features]
default = []
rustc_nightly = []

[lib]
# Plugins use crate-type cdylib
# https://doc.rust-lang.org/reference/linkage.html
# https://users.rust-lang.org/t/what-is-the-difference-between-dylib-and-cdylib/28847/3
crate-type = ["cdylib"]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(rustc_nightly)'] }

[package.metadata.cargo-post.dependencies]
toml = "0.8"
serde = { version = "1.0", features = ["derive"] }
Expand Down
18 changes: 18 additions & 0 deletions plugins/arithmetic/crates/plugin/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
extern crate rustc_version;
use rustc_version::version_meta;
use rustc_version::Channel;
fn main() {
println!("cargo:rerun-if-changed=types");
// Set cfg flags depending on release channel
match version_meta().unwrap().channel {
Channel::Stable => {
println!("cargo:rustc-cfg=rustc_stable");
}
Channel::Beta => {
println!("cargo:rustc-cfg=rustc_beta");
}
Channel::Nightly => {
println!("cargo:rustc-cfg=rustc_nightly");
}
Channel::Dev => {
println!("cargo:rustc-cfg=rustc_dev");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ mod tests {
use reactive_graph_reactive_model_impl::ReactiveProperties;
use reactive_graph_runtime_model::ActionProperties::TRIGGER;

// TODO: This test should be moved to the reactive model
#[cfg(feature = "rustc_nightly")]
#[test]
fn rx_counter_test() {
let id = Uuid::new_v4();
Expand Down Expand Up @@ -85,6 +87,7 @@ mod tests {
assert_eq!(3, counter.result, "The behaviour should have been dropped.");
}

#[cfg(feature = "rustc_nightly")]
#[test]
fn rx_counter_2_test() {
let counter = Counter1::new(false, 0u64);
Expand Down
3 changes: 0 additions & 3 deletions plugins/arithmetic/crates/plugin/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(register_tool)]
#![register_tool(tarpaulin)]

pub mod behaviour;
pub mod plugin;
pub mod providers;
4 changes: 1 addition & 3 deletions plugins/base/crates/plugin/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#![feature(register_tool)]
#![feature(once_cell_try)]
#![register_tool(tarpaulin)]
// #![feature(once_cell_try)]
#![allow(clippy::map_entry)]

pub mod plugin;
Expand Down
3 changes: 0 additions & 3 deletions plugins/binary/crates/plugin/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(register_tool)]
#![register_tool(tarpaulin)]

pub mod behaviour;
pub mod plugin;
pub mod providers;
Expand Down
3 changes: 0 additions & 3 deletions plugins/color/crates/plugin/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(register_tool)]
#![register_tool(tarpaulin)]

pub mod behaviour;
pub mod plugin;
pub mod providers;
3 changes: 0 additions & 3 deletions plugins/comparison/crates/plugin/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(register_tool)]
#![register_tool(tarpaulin)]

pub mod behaviour;
pub mod plugin;
pub mod providers;
78 changes: 0 additions & 78 deletions plugins/config/crates/plugin/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,81 +1,3 @@
#![feature(register_tool)]
#![register_tool(tarpaulin)]

pub mod behaviour;
pub mod plugin;
pub mod providers;

// #![allow(clippy::map_entry)]
//
// #[macro_use]
// extern crate query_interface;
//
// use std::sync::Arc;
//
// use reactive_graph_core_di as di;
// use reactive_graph_graph as model;
// use reactive_graph_model_config as model_config;
// use reactive_graph_model_file as model_file;
// use reactive_graph_model_result as model_result;
// use reactive_graph_model_runtime as model_runtime;
// use reactive_graph_plugin_api as plugins;
// use reactive_graph_reactive as reactive;
//
// use log::error;
//
// use crate::di::profiles;
// use crate::di::Container;
// use crate::di::Provider;
// use crate::plugin::ConfigPlugin;
// use crate::plugins::Plugin;
// use crate::plugins::PluginDependency;
// use crate::plugins::PluginLoadingError;
//
// pub mod behaviour;
// pub mod plugin;
// pub mod providers;
//
// pub static PLUGIN_NAME: &str = env!("CARGO_PKG_NAME");
// pub static PLUGIN_DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION");
// pub static PLUGIN_VERSION: &str = env!("CARGO_PKG_VERSION");
//
// pub fn get<T>() -> Container<T> {
// Container::<T>::new()
// }
//
// pub fn construct_plugin() -> Result<Arc<dyn Plugin>, PluginLoadingError> {
// let mut container = get::<profiles::Default>();
// let container = &mut container;
// let plugin = Provider::<dyn ConfigPlugin>::create(container);
// let plugin = Arc::new(plugin);
// let plugin: Result<Arc<dyn Plugin>, _> = <dyn query_interface::Object>::query_arc(plugin);
// match plugin {
// Ok(plugin) => Ok(plugin),
// Err(_) => {
// error!("Failed to construct plugin {}", PLUGIN_NAME);
// Err(PluginLoadingError::PluginContainerInitializationError)
// }
// }
// }
//
// plugins::export_plugin!(register, get_dependencies, PLUGIN_NAME, PLUGIN_DESCRIPTION, PLUGIN_VERSION);
//
// #[allow(improper_ctypes_definitions)]
// extern "C" fn register(registrar: &mut dyn plugins::PluginRegistrar) {
// if let Err(error) = log4rs::init_file("config/logging.toml", Default::default()) {
// println!("Failed to configure logger in {}: {}", PLUGIN_NAME, error);
// }
// if let Ok(plugin) = construct_plugin() {
// registrar.register_plugin(Box::new(plugin));
// }
// }
//
// #[allow(improper_ctypes_definitions)]
// extern "C" fn get_dependencies() -> Vec<PluginDependency> {
// vec![
// PluginDependency::new("reactive-graph-plugin-base", ">=0.9.0, <0.10.0"),
// PluginDependency::new("reactive-graph-plugin-file", ">=0.9.0, <0.10.0"),
// PluginDependency::new("reactive-graph-plugin-trigger", ">=0.9.0, <0.10.0"),
// PluginDependency::new("reactive-graph-plugin-result", ">=0.9.0, <0.10.0"),
// ]
// }
3 changes: 0 additions & 3 deletions plugins/connector/crates/plugin/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(register_tool)]
#![register_tool(tarpaulin)]

pub mod behaviour;
pub mod plugin;
pub mod providers;
2 changes: 1 addition & 1 deletion plugins/connector/crates/plugin/src/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mod default_connector_test;
mod function_test;

#[tarpaulin::ignore]
#[cfg(not(tarpaulin_include))]
mod utils;
3 changes: 0 additions & 3 deletions plugins/date-time/crates/plugin/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(register_tool)]
#![register_tool(tarpaulin)]

pub mod api;
pub mod behaviour;
pub mod implementation;
Expand Down
3 changes: 0 additions & 3 deletions plugins/file/crates/plugin/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(register_tool)]
#![register_tool(tarpaulin)]

pub mod behaviour;
pub mod plugin;
pub mod providers;
72 changes: 0 additions & 72 deletions plugins/flow/crates/plugin/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,74 +1,2 @@
#![feature(register_tool)]
#![register_tool(tarpaulin)]

pub mod plugin;
pub mod providers;

// #![feature(register_tool)]
// #![register_tool(tarpaulin)]
// #![allow(clippy::map_entry)]
//
// #[macro_use]
// extern crate query_interface;
//
// use std::sync::Arc;
//
// use reactive_graph_core_di as di;
// use reactive_graph_plugin_api as plugins;
// use log::error;
//
// use crate::di::profiles;
// use crate::di::Container;
// use crate::di::Provider;
// use crate::plugin::FlowPlugin;
// use crate::plugins::Plugin;
// use crate::plugins::PluginDependency;
// use crate::plugins::PluginLoadingError;
//
// pub mod plugin;
// pub mod providers;
//
// pub static PLUGIN_NAME: &str = env!("CARGO_PKG_NAME");
// pub static PLUGIN_DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION");
// pub static PLUGIN_VERSION: &str = env!("CARGO_PKG_VERSION");
//
// pub fn get<T>() -> Container<T> {
// Container::<T>::new()
// }
//
// pub fn construct_plugin() -> Result<Arc<dyn Plugin>, PluginLoadingError> {
// let mut container = get::<profiles::Default>();
// let container = &mut container;
// let plugin = Provider::<dyn FlowPlugin>::create(container);
// let plugin = Arc::new(plugin);
// let plugin: Result<Arc<dyn Plugin>, _> = <dyn query_interface::Object>::query_arc(plugin);
// if plugin.is_err() {
// error!("Failed to construct plugin");
// return Err(PluginLoadingError::PluginContainerInitializationError);
// }
// Ok(plugin.unwrap())
// }
//
// plugins::export_plugin!(register, get_dependencies, PLUGIN_NAME, PLUGIN_DESCRIPTION, PLUGIN_VERSION);
//
// #[allow(improper_ctypes_definitions)]
// extern "C" fn register(registrar: &mut dyn plugins::PluginRegistrar) {
// if let Err(error) = log4rs::init_file("config/logging.toml", Default::default()) {
// println!("Failed to configure logger in {}: {}", PLUGIN_NAME, error);
// }
// if let Ok(plugin) = construct_plugin() {
// registrar.register_plugin(Box::new(plugin));
// }
// }
//
// #[allow(improper_ctypes_definitions)]
// extern "C" fn get_dependencies() -> Vec<PluginDependency> {
// vec![PluginDependency::new("reactive-graph-plugin-base", ">=0.9.0, <0.10.0")]
// }
//
// #[cfg(test)]
// use reactive_graph_core_builder as builder;
//
// #[cfg(test)]
// #[tarpaulin::ignore]
// pub mod tests;
Loading
Loading