Skip to content

Commit

Permalink
refactor(stdune): move [Console] to own library
Browse files Browse the repository at this point in the history
[Console] isn't general purpose enough to live in [Stdune]

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

ps-id: ebd1cb41-98fd-4acc-b2a8-0a33ce911772
  • Loading branch information
rgrinberg committed Aug 11, 2022
1 parent e8f442a commit 88ebd2c
Show file tree
Hide file tree
Showing 27 changed files with 36 additions and 6 deletions.
1 change: 1 addition & 0 deletions bin/common.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
open Stdune
module Config = Dune_util.Config
module Console = Dune_console
module Colors = Dune_rules.Colors
module Clflags = Dune_engine.Clflags
module Graph = Dune_graph.Graph
Expand Down
1 change: 1 addition & 0 deletions bin/dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
dune_lang
fiber
stdune
dune_console
unix
dune_metrics
dune_digest
Expand Down
1 change: 1 addition & 0 deletions bin/import.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ open Stdune
open Dune_engine
module Digest = Dune_digest
module Metrics = Dune_metrics
module Console = Dune_console
module Term = Cmdliner.Term
module Manpage = Cmdliner.Manpage
module Stanza = Dune_lang.Stanza
Expand Down
1 change: 0 additions & 1 deletion bin/internal_dump.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
open Stdune
open Import
module Persistent = Dune_util.Persistent

Expand Down
1 change: 1 addition & 0 deletions boot/libs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ let local_libraries =
; ("vendor/incremental-cycles/src", Some "Incremental_cycles", false, None)
; ("src/dag", Some "Dag", false, None)
; ("src/fiber", Some "Fiber", false, None)
; ("src/dune_console", Some "Dune_console", false, None)
; ("src/memo", Some "Memo", false, None)
; ("src/dune_metrics", Some "Dune_metrics", false, None)
; ("src/dune_digest", Some "Dune_digest", false, None)
Expand Down
1 change: 0 additions & 1 deletion otherlibs/stdune/stdune.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module Array = Array
module Bytes = Bytes
module Char = Char
module Comparator = Comparator
module Console = Console
module Either = Either
module Exn = Exn
module Exn_with_backtrace = Exn_with_backtrace
Expand Down
1 change: 1 addition & 0 deletions src/dune_config/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(libraries
stdune
xdg
dune_console
dune_lang
dune_cache
dune_cache_storage
Expand Down
1 change: 1 addition & 0 deletions src/dune_config/dune_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ open Stdune
open Dune_lang.Decoder
module Scheduler = Dune_engine.Scheduler
module Sandbox_mode = Dune_engine.Sandbox_mode
module Console = Dune_console
module Stanza = Dune_lang.Stanza
module Config = Dune_util.Config
module String_with_vars = Dune_lang.String_with_vars
Expand Down
3 changes: 3 additions & 0 deletions src/dune_console/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(library
(name dune_console)
(libraries stdune))
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
open Stdune

module Backend = struct
module type S = sig
val print_user_message : User_message.t -> unit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
open Stdune

(** Manages the console *)

(** The console is a system than can report messages and a status to the user.
Expand Down
1 change: 1 addition & 0 deletions src/dune_engine/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
(libraries
unix
stdune
dune_console
dyn
fiber
incremental_cycles
Expand Down
1 change: 1 addition & 0 deletions src/dune_engine/import.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include Stdune
module Digest = Dune_digest
module Console = Dune_console
module Metrics = Dune_metrics
module Log = Dune_util.Log
module Re = Dune_re
Expand Down
1 change: 1 addition & 0 deletions src/dune_file_watcher/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(libraries
spawn
fsevents
dune_console
unix
stdune
threads.posix
Expand Down
1 change: 1 addition & 0 deletions src/dune_file_watcher/dune_file_watcher.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
open! Stdune
module Inotify_lib = Async_inotify_for_dune.Async_inotify
module Console = Dune_console

module Fs_memo_event = struct
type kind =
Expand Down
2 changes: 1 addition & 1 deletion src/dune_rules/dune
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
memo
ocaml
dune_re
console
dune_console
dune_digest
opam_file_format
dune_lang
Expand Down
1 change: 1 addition & 0 deletions src/dune_rules/import.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include Stdune
open Dune_util
module Digest = Dune_digest
module Console = Dune_console
module Config = Config
module Log = Log
module Persistent = Persistent
Expand Down
1 change: 1 addition & 0 deletions src/dune_util/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(libraries
stdune
xdg
dune_console
build_path_prefix_map
dune_sexp
memo
Expand Down
1 change: 1 addition & 0 deletions src/dune_util/import.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module Console = Dune_console
1 change: 1 addition & 0 deletions src/dune_util/log.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
open Stdune
module Console = Dune_console

module File = struct
type t =
Expand Down
1 change: 1 addition & 0 deletions src/dune_util/report_error.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
open Stdune
open Import

exception Already_reported

Expand Down
2 changes: 1 addition & 1 deletion src/memo/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(library
(name memo)
(libraries stdune dyn dune_graph dag fiber unix)
(libraries stdune dyn dune_graph dag fiber dune_console unix)
(synopsis "Incremental computation library that powers Dune"))
1 change: 1 addition & 0 deletions src/memo/memo.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
open! Stdune
open Fiber.O
module Graph = Dune_graph.Graph
module Console = Dune_console

module Debug = struct
let track_locations_of_lazy_values = ref false
Expand Down
9 changes: 8 additions & 1 deletion src/upgrader/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
(library
(name dune_upgrader)
(libraries stdune memo opam_file_format dune_lang dune_engine fiber)
(libraries
stdune
dune_console
memo
opam_file_format
dune_lang
dune_engine
fiber)
(synopsis "Internal Dune library, do not use!"))
1 change: 1 addition & 0 deletions src/upgrader/dune_upgrader.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ open! Stdune
engine *)
module Dune_project = Dune_engine.Dune_project
module Source_tree = Dune_engine.Source_tree
module Console = Dune_console
module Sub_dirs = Dune_engine.Sub_dirs

type rename_and_edit =
Expand Down
2 changes: 1 addition & 1 deletion test/expect-tests/common/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(library
(name dune_tests_common)
(modules dune_tests_common)
(libraries stdune dune_util))
(libraries stdune dune_console dune_util))
1 change: 1 addition & 0 deletions test/expect-tests/common/dune_tests_common.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
open Stdune
module Console = Dune_console

let print pp = Format.printf "%a@." Pp.to_fmt pp

Expand Down

0 comments on commit 88ebd2c

Please sign in to comment.