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

Fixes #21139: Update to Rust 1.61.0 and update dependencies #4283

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,18 @@ pipeline {
agent {
dockerfile {
filename 'ci/typos.Dockerfile'
additionalBuildArgs '--build-arg VERSION=1.0'
additionalBuildArgs '--build-arg VERSION=1.8'
}
}
steps {
dir('language') {
sh script: 'typos', label: 'check language typos'
sh script: 'typos --exclude "*.svg" --exclude "tests/" --exclude "docs/DESIGN_DECISIONS"', label: 'check language typos'
}
dir('webapp/sources/api-doc') {
sh script: 'typos', label: 'check webapp api doc typos'
}
dir('relay/sources/') {
sh script: 'typos --exclude "*.pem"', label: 'check relayd typos'
sh script: 'typos --exclude "*.pem" --exclude "*.cert" --exclude "*.priv" --exclude "*.pub" --exclude "*.signed" --exclude "*.log" --exclude "*.json"', label: 'check relayd typos'
}
}
post {
Expand Down
2 changes: 1 addition & 1 deletion ci/typos.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust
FROM rust:1.61
ARG VERSION

RUN cargo install -f typos-cli --version =$VERSION
73 changes: 41 additions & 32 deletions language/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion language/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ngrammatic = "0.3"
nom = "5"
nom_locate = "2"
regex = "1"
serde = { version = "1", features = ["derive" ] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
structopt = "0.3"
toml = "0.5"
Expand Down
2 changes: 1 addition & 1 deletion language/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.60.0-buster
FROM rust:1.61.0-buster

ARG USER_ID=1000
COPY ci/user.sh .
Expand Down
2 changes: 2 additions & 0 deletions language/_typos.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[default.extend-words]
# from garbage
daed = "daed"
ba = "ba"
9 changes: 9 additions & 0 deletions language/docs/DESIGN_DECISIONS
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,12 @@ TODO :
- uuid alias of variable names / outcomes
- variables de ressource
- use criterion to detect performance regression

// Questions :
// - compatibilité avec les techniques définissant des variables globales depuis une GM qui dépend d'une autre ?
// - usage du '!' -> "macros", enum expr, audit&test ?
// - sous typage explicite mais pas chiant
// - a qui s'applique vraiment les namespace ? variables, resources, enums, fonctions ? quels sont les default intelligents ?
// - a quoi ressemblent les iterators ?
// - arguments non ordonnés pour les resources et les states ?
// - usage des alias: pour les children, pour les (in)compatibilités, pour le générateur?
2 changes: 1 addition & 1 deletion language/docs/integration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Right now language is in a _testing_ state. It has been released alongside _Rudder 7.0_.

This means while _language_ CLI features are usable, its current state as part of the released product is mainly: working in parallel with our legacy genertion tools, to monitor how robust _language_ is and make sure it would not break things (and fix it when it would).
This means while _language_ CLI features are usable, its current state as part of the released product is mainly: working in parallel with our legacy generation tools, to monitor how robust _language_ is and make sure it would not break things (and fix it when it would).

We made sure this integration is made flowlessly for the end user and does not come with any breaking change. More about the way we are integrating it in the next section (_Testing Loop_).

Expand Down
2 changes: 1 addition & 1 deletion language/docs/operating-systems.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Since _language_ OS list is composed of `enums`, it meets the requirements that
- _sub-enums_ that expand their parent item: `items in linux` or `items in ubuntu_20`
- _aliases_ can be used to define any sub-enum, like: `enum alias focal = ubuntu_20_04`

NOTE: enums are compatible with metadatas, not only outter but also inner elements.
NOTE: enums are compatible with metadatas, not only outer but also inner elements.

More about <<enums,enums>>

Expand Down
2 changes: 1 addition & 1 deletion language/libs/cfengine_core.rd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@format=0

# TODO we should only keep variables that we intend to implement fo every target agent and not only cfengine
# TODO we should only keep variables that we intend to implement for every target agent and not only cfengine
# Otherwise they should be put in a cfengine namespace

# This file holds every cfengine special variable. These special variables are stored in a global context
Expand Down
2 changes: 1 addition & 1 deletion language/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.60.0
1.61.0
15 changes: 4 additions & 11 deletions language/src/bin/rudderc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@
//!
//! 4- json technique -> technique generate() -> JSON wrapper { dsc + rd + cf }

// Questions :
// - compatibilité avec les techniques définissant des variables globales depuis une GM qui dépend d'une autre ?
// - usage du '!' -> "macros", enum expr, audit&test ?
// - sous typage explicite mais pas chiant
// - a qui s'applique vraiment les namespace ? variables, resources, enums, fonctions ? quels sont les default intelligents ?
// - a quoi ressemblent les iterators ?
// - arguments non ordonnés pour les resources et les states ?
// - usage des alias: pour les children, pour les (in)compatibilités, pour le générateur?

// TODO a state S on an object A depending on a condition on an object B is invalid if A is a descendant of B
// TODO except if S is the "absent" state

Expand All @@ -47,13 +38,15 @@

#![allow(clippy::large_enum_variant)]

use std::process::exit;

use structopt::StructOpt;

use rudderc::{
command::{self, Command},
error::Error,
io::cli_parser::CLI,
};
use std::process::exit;
use structopt::StructOpt;

/// Rudder language compiler

Expand Down
2 changes: 1 addition & 1 deletion language/src/generator/cfengine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ impl CFEngine {
Statement::BlockDeclaration(def) => {
let mut res = vec![];

for st in &def.childs {
for st in &def.children {
res.append(&mut self.format_statement(
gc,
res_def,
Expand Down
23 changes: 13 additions & 10 deletions language/src/generator/dsc.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2019-2020 Normation SAS

mod syntax;
use std::{
collections::HashMap,
convert::TryFrom,
path::{Path, PathBuf},
str::FromStr,
};

use toml::Value as TomlValue;

use super::Generator;
use crate::{
command::CommandResult,
error::*,
Expand All @@ -18,13 +24,10 @@ use crate::{
parser::*,
technique::fetch_method_parameters,
};
use std::{
collections::HashMap,
convert::TryFrom,
path::{Path, PathBuf},
str::FromStr,
};
use toml::Value as TomlValue;

use super::Generator;

mod syntax;

type Condition = String;

Expand Down Expand Up @@ -383,7 +386,7 @@ impl DSC {
Statement::BlockDeclaration(def) => {
let mut res = vec![];

for st in &def.childs {
for st in &def.children {
res.append(&mut self.format_statement(
gc,
res_def,
Expand Down
18 changes: 10 additions & 8 deletions language/src/io/logs.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2019-2020 Normation SAS

mod levels;
pub use levels::LogLevel;
#[macro_use]
mod macros;
use std::fmt;
use std::sync::RwLock;

use lazy_static::lazy_static;
use serde::Serialize;
use std::fmt;
use std::sync::RwLock;

pub use levels::LogLevel;

mod levels;
#[macro_use]
mod macros;

// to keep LOGS usage as safe as possible, make sure it is only called from this file
// any outside module call is just a push that happens through macros
Expand Down Expand Up @@ -50,8 +52,8 @@ impl fmt::Display for Log {
}
}

/// Logs is used through our static, global variable LOGS throughought the program
/// all logs are pushed into it, be it errors, informations, debug
/// Logs is used through our static, global variable LOGS throughout the program
/// all logs are pushed into it, be it errors, information, debug
/// they are effectively printed at program exit using the output format, even in case of panic
// Logs content should stay private since we do not want unsafe code elsewhere in the program
#[derive(Serialize, Clone)]
Expand Down