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

Revert datagen fs feature #3359

Merged
merged 3 commits into from
Apr 20, 2023
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
7 changes: 2 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# Changelog


## icu4x 1.2.1 & 1.2.2 (Apr 17, 2023)
## icu4x 1.2.1 (Apr 17, 2023)

Note: A subset of crates received patch releases in the 1.2 stream.

- `icu_capi`
- Fixed [#3344](https://github.com/unicode-org/icu4x/pull/3344), `buffer_provider` feature accidentally pulling in extra crates
- `icu_datagen` 1.2.1
- `icu_datagen`
- Fixed [#3339](https://github.com/unicode-org/icu4x/pull/3339), incorrect Cargo features
- `icu_datagen` 1.2.2
- Fixed [#3354](https://github.com/unicode-org/icu4x/pull/3354), ability to run datagen without support for `icu_provider_fs::FsDataProvider`
- `icu_locid_transform`
- Fixed [#3332](https://github.com/unicode-org/icu4x/issues/3332), missing `+?Sized` bound
- `icu_segmenter`
Expand Down
3 changes: 1 addition & 2 deletions provider/datagen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ icu_timezone = { version = "1.2.0", path = "../../components/timezone", features
icu_provider = { version = "1.2.0", path = "../core", features = ["std", "log_error_context", "datagen"]}
icu_provider_adapters = { version = "1.2.0", path = "../adapters", features = ["datagen"] }
icu_provider_blob = { version = "1.2.0", path = "../blob", features = ["export"] }
icu_provider_fs = { version = "1.2.0", path = "../fs", features = ["export"], optional = true }
icu_provider_fs = { version = "1.2.0", path = "../fs", features = ["export"] }

# Other
cached-path = { version = ">=0.5, <0.7", optional = true }
Expand Down Expand Up @@ -106,7 +106,6 @@ use_wasm = ["icu_codepointtrie_builder/wasm"]
# rule based segmenter data will not be generated.
use_icu4c = ["icu_codepointtrie_builder/icu4c"]
networking = ["dep:cached-path"]
fs = ["dep:icu_provider_fs"]

[[bin]]
name = "icu4x-datagen"
Expand Down
5 changes: 0 additions & 5 deletions provider/datagen/src/bin/datagen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ mod cli {

#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum, Debug)]
pub(crate) enum Format {
#[cfg_attr(feature = "fs", value(hide = true))]
Dir,
Blob,
Mod,
Expand Down Expand Up @@ -85,7 +84,6 @@ struct Cli {

#[arg(short, long, value_enum, default_value_t = cli::Syntax::Json)]
#[arg(help = "--format=dir only: serde serialization format.")]
#[cfg_attr(feature = "fs", arg(hide = true))]
syntax: cli::Syntax,

#[arg(short, long)]
Expand Down Expand Up @@ -335,9 +333,6 @@ fn main() -> eyre::Result<()> {
if v == cli::Format::DeprecatedDefault {
log::warn!("Defaulting to --format=dir. This will become a required parameter in the future.");
}
#[cfg(not(feature = "fs"))]
eyre::bail!("--format=dir only available with the `fs` Cargo feature");
#[cfg(feature = "fs")]
icu_datagen::Out::Fs {
output_path: matches
.output
Expand Down
9 changes: 0 additions & 9 deletions provider/datagen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,10 @@ impl CldrLocaleSubset {
/// [Out::Fs] serialization formats.
pub mod syntax {
#[doc(no_inline)]
#[cfg(feature = "fs")]
pub use icu_provider_fs::export::serializers::bincode::Serializer as Bincode;
#[doc(no_inline)]
#[cfg(feature = "fs")]
pub use icu_provider_fs::export::serializers::json::Serializer as Json;
#[doc(no_inline)]
#[cfg(feature = "fs")]
pub use icu_provider_fs::export::serializers::postcard::Serializer as Postcard;
}

Expand All @@ -125,7 +122,6 @@ use icu_provider::datagen::*;
use icu_provider::prelude::*;
use icu_provider_adapters::empty::EmptyDataProvider;
use icu_provider_adapters::filter::Filterable;
#[cfg(feature = "fs")]
use icu_provider_fs::export::serializers::AbstractSerializer;
use prelude::*;
use rayon::prelude::*;
Expand Down Expand Up @@ -319,9 +315,6 @@ impl Default for BakedOptions {
#[non_exhaustive]
pub enum Out {
/// Output to a file system tree
///
/// **Enabled with the `fs` Cargo feature.**
#[cfg(feature = "fs")]
Fs {
/// The root path.
output_path: PathBuf,
Expand Down Expand Up @@ -355,7 +348,6 @@ pub enum Out {
impl core::fmt::Debug for Out {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
#[cfg(feature = "fs")]
Self::Fs {
output_path,
serializer,
Expand Down Expand Up @@ -415,7 +407,6 @@ pub fn datagen(
.into_iter()
.map(|out| -> Result<Box<dyn DataExporter>, DataError> {
Ok(match out {
#[cfg(feature = "fs")]
Out::Fs {
output_path,
serializer,
Expand Down
4 changes: 1 addition & 3 deletions provider/datagen/src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,7 @@ impl SerdeCache {
for<'de> S: serde::Deserialize<'de> + 'static + Send + Sync,
{
self.read_and_parse(path, |bytes| {
serde_json::from_slice(bytes)
.map_err(std::io::Error::from)
.map_err(DataError::from)
serde_json::from_slice(bytes).map_err(DataError::from)
})
}

Expand Down
2 changes: 1 addition & 1 deletion tools/testdata-scripts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ edition = "2021"
[dependencies]
crlify = { path = "../../utils/crlify" }
databake = { path = "../../utils/databake" }
icu_datagen = { path = "../../provider/datagen", default-features = false, features = ["fs"] }
icu_datagen = { path = "../../provider/datagen", default-features = false }
icu_locid = { path = "../../components/locid", features = ["databake"] }
icu_provider = { path = "../../provider/core" }
repodata = { path = "../../provider/repodata" }
Expand Down