Skip to content

deno check: sync-types clobbers the global log level to suppress its output #36116

Description

@bartlomieju

Follow-up from #35938 review.

Native deno check runs sync_types_command as an internal step and wraps it
in log::set_max_level(LevelFilter::Error) to keep its progress/summary output
from preceding the type-check diagnostics:

let prev_level = log::max_level();
log::set_max_level(log::LevelFilter::Error);
let sync_result = sync_types_command(..., RootTsConfigMode::CheckMode).await;
log::set_max_level(prev_level);
sync_result?;

Mutating the global log level is a bad pattern (process-global, not scoped to
this call). It's also load-bearing in a subtle way: sync_types_command builds
its own module graph, so for an unresolvable/404 module it re-attempts the fetch
and emits a duplicate Download line; the clobber is currently what hides
that from deno check output (removing it breaks module_not_found,
missing_remote_root, import_non_existent_in_remote, etc.).

Proper fix, either:

  • thread a "quiet" flag through sync_types_command so it suppresses its own
    progress at the source instead of via the global logger, or
  • have native_check hand its already-built graph to sync_types_command so it
    doesn't rebuild/re-fetch at all (removes the duplicate-Download problem and
    the need to suppress anything).

Internal cleanup; we'll do it ourselves.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions