You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Telemetry config generated on Linux platforms does not work on non-Linux platforms on 4.0 #84
If you use foundations' built-in telemetry settings to generate your application config, the memory profiler options are only included if the package is built for Linux. This didn't previously cause issues, but since 4.0 made it an error to include unknown config fields, running the service on non-Linux OSes such as macOS cause these configs to error.
Given that common development workflows may involve a mix of running an application on Docker and natively on e.g. macOS, it would probably be better if these options were just ignored when not applicable; potentially with a warning message indicating they have no effect.
However, I think we should teach the settings macro to recognise the OS feature gates and don't complain about unused fields in such cases. Contributions are welcome!
My concern there would be interactions; the simple case of "block of options that only exist on some platforms" is easy to cover, but the behaviour would be more complex in other cases which can be expressed#[cfg()] attributes, such as overlapping field definitions for specific platforms.
Since I'm opinionated, my feelings are the better resolutions are one of these options:
Make strict validation of config options an opt-in feature, rather than an opt-out one.
Keep strict validation as is, but discourage using #[cfg()] in settings structs in documentation (and discontinue their current use). This feels consistent with other documentation recommendations (e.g. using an enabled field rather than making sections Optional).
Activity
inikulin commentedon Nov 14, 2024
That's a valid concern. For now you can restore the old behaviour via a feature toggle: https://github.com/cloudflare/foundations/blob/main/foundations/Cargo.toml#L60C1-L60C40
However, it's not ergonomic as it was before, because now you would need to turn off default features and manually enabled those that you need.
However, I think we should teach the settings macro to recognise the OS feature gates and don't complain about unused fields in such cases. Contributions are welcome!
hgmich commentedon Nov 21, 2024
My concern there would be interactions; the simple case of "block of options that only exist on some platforms" is easy to cover, but the behaviour would be more complex in other cases which can be expressed
#[cfg()]attributes, such as overlapping field definitions for specific platforms.Since I'm opinionated, my feelings are the better resolutions are one of these options:
#[cfg()]in settings structs in documentation (and discontinue their current use). This feels consistent with other documentation recommendations (e.g. using anenabledfield rather than making sectionsOptional).