With this commit I have changed several components to be more efficient.
This can be less llvm-lines generated or less `clone()` calls.
### Config
- Re-ordered the `make_config` macro to be more efficient
- Created a custom Deserializer for `ConfigBuilder` less code and more efficient
- Use struct's for the `prepare_json` function instead of generating a custom JSON object.
This generates less code and is more efficient.
- Updated the `get_support_string` function to handle the masking differently.
This generates less code and also was able to remove some sub-macro-calls
### Error
- Added an extra new call to prevent duplicate Strings in generated macro code.
This generated less llvm-lines and seems to be more efficient.
- Created a custom Serializer for `ApiError` and `CompactApiError`
This makes that struct smaller in size, so better for memory, but also less llvm-lines.
### General
- Removed `once_lock` and replace it all with Rust's std LazyLock
- Added and fixed some Clippy lints which reduced `clone()` calls for example.
- Updated build profiles for more efficiency
Also added a new profile specifically for CI, which should decrease the build check
- Updated several GitHub Workflows for better security and use the new `ci` build profile
- Updated to Rust v1.90.0 which uses a new linker `rust-lld` which should help in faster building
- Updated the Cargo.toml for all crates to better use the `workspace` variables
- Added a `typos` Workflow and Pre-Commit, which should help in detecting spell error's.
Also fixed a few found by it.
Signed-off-by: BlackDex <black.dex@gmail.com>
You can append both `alpine` and `debian` with `-amd64`, `-arm64`, `-armv7` or `-armv6`, which will trigger a build for that specific platform.<br>
You can append both `alpine` and `debian` with `-amd64`, `-arm64`, `-armv7` or `-armv6`, which will trigger a build for that specific platform.<br>
This will also append those values to the tag so you can see the builded container when running `docker images`.
This will also append those values to the tag so you can see the built container when running `docker images`.
You can also append extra arguments after the target if you want. This can be useful for example to print what bake will use.
You can also append extra arguments after the target if you want. This can be useful for example to print what bake will use.
```bash
```bash
@ -162,7 +162,7 @@ You can append extra arguments after the target if you want. This can be useful
For the podman builds you can, just like the `bake.sh` script, also append the architecture to build for that specific platform.<br>
For the podman builds you can, just like the `bake.sh` script, also append the architecture to build for that specific platform.<br>
### Testing podman builded images
### Testing podman built images
The command to start a podman built container is almost the same as for the docker/bake built containers. The images start with `localhost/`, so you need to prepend that.
The command to start a podman built container is almost the same as for the docker/bake built containers. The images start with `localhost/`, so you need to prepend that.
(@supportstr$name:ident,$value:expr,Pass,option)=>{serde_json::to_value(&$value.as_ref().map(|_|String::from("***"))).unwrap()};// Optional pass, we map to an Option<String> with "***"
(@supportstr$name:ident,$value:expr,Pass,$none_action:ident)=>{"***".into()};// Required pass, we return "***"
(@supportstr$name:ident,$value:expr,$ty:ty,option)=>{serde_json::to_value(&$value).unwrap()};// Optional other or string, we convert to json
(@supportstr$name:ident,$value:expr,String,$none_action:ident)=>{$value.as_str().into()};// Required string value, we convert to json
(@supportstr$name:ident,$value:expr,$ty:ty,$none_action:ident)=>{($value).into()};// Required other value, we return as is or convert to json
// Loop through all privacy sensitive keys and mask them
formask_keyinPRIVACY_CONFIG{
ifletSome(value)=json.get_mut(*mask_key){
ifletSome(s)=value.as_str(){
*value=_privacy_mask(s).into();
}
}
}
json
json
})
})
}
}
pubfnget_overrides(&self)-> Vec<String>{
pubfnget_overrides(&self)-> Vec<&'staticstr>{
letoverrides={
letoverrides={
letinner=&self.inner.read().unwrap();
letinner=&self.inner.read().unwrap();
inner._overrides.clone()
inner._overrides.clone()
@ -333,55 +486,6 @@ macro_rules! make_config {
}
}
}
}
};
};
// Support string print
(@supportstr$name:ident,$value:expr,Pass,option)=>{serde_json::to_value($value.as_ref().map(|_|String::from("***"))).unwrap()};// Optional pass, we map to an Option<String> with "***"
(@supportstr$name:ident,$value:expr,Pass,$none_action:ident)=>{"***".into()};// Required pass, we return "***"
(@supportstr$name:ident,$value:expr,String,option)=>{// Optional other value, we return as is or convert to string to apply the privacy config
(@supportstr$name:ident,$value:expr,String,$none_action:ident)=>{// Required other value, we return as is or convert to string to apply the privacy config
ifPRIVACY_CONFIG.contains(&stringify!($name)){
_privacy_mask(&$value).into()
}else{
($value).into()
}
};
(@supportstr$name:ident,$value:expr,$ty:ty,option)=>{serde_json::to_value($value).unwrap()};// Optional other value, we return as is or convert to string to apply the privacy config
(@supportstr$name:ident,$value:expr,$ty:ty,$none_action:ident)=>{($value).into()};// Required other value, we return as is or convert to string to apply the privacy config