Skip to content

Commit 5ba499a

Browse files
authored
Merge pull request #4160 from eval-exec/exec/remove-disable_faketime_cfg
Remove useless `--cfg disable_faketime` from `RUSTFLAGS`
2 parents 8dffa39 + 966a18a commit 5ba499a

File tree

9 files changed

+7
-21
lines changed

9 files changed

+7
-21
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,19 @@ build-for-profiling: ## Build binary with for profiling.
140140

141141
.PHONY: prod
142142
prod: ## Build binary for production release.
143-
RUSTFLAGS="$${RUSTFLAGS} --cfg disable_faketime" cargo build ${VERBOSE} ${CKB_BUILD_TARGET} --profile prod --features "with_sentry,with_dns_seeding"
143+
cargo build ${VERBOSE} ${CKB_BUILD_TARGET} --profile prod --features "with_sentry,with_dns_seeding"
144144

145145
.PHONY: prod_portable
146146
prod_portable: ## Build binary for portable production release.
147-
RUSTFLAGS="$${RUSTFLAGS} --cfg disable_faketime" cargo build ${VERBOSE} ${CKB_BUILD_TARGET} --profile prod --features "with_sentry,with_dns_seeding,portable"
147+
cargo build ${VERBOSE} ${CKB_BUILD_TARGET} --profile prod --features "with_sentry,with_dns_seeding,portable"
148148

149149
.PHONY: prod-docker
150150
prod-docker:
151-
RUSTFLAGS="$${RUSTFLAGS} --cfg disable_faketime --cfg docker" cargo build --verbose ${CKB_BUILD_TARGET} --profile prod --features "with_sentry,with_dns_seeding"
151+
RUSTFLAGS="$${RUSTFLAGS} --cfg docker" cargo build --verbose ${CKB_BUILD_TARGET} --profile prod --features "with_sentry,with_dns_seeding"
152152

153153
.PHONY: prod-test
154154
prod-test:
155-
RUSTFLAGS="$${RUSTFLAGS} --cfg disable_faketime" RUSTDOCFLAGS="--cfg disable_faketime" CKB_FEATURES="with_sentry,with_dns_seeding" $(MAKE) test
155+
CKB_FEATURES="with_sentry,with_dns_seeding" $(MAKE) test
156156

157157
.PHONY: prod-with-debug
158158
prod-with-debug:

chain/src/tests/block_assembler.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ fn create_cellbase(number: BlockNumber, epoch: &EpochExt) -> TransactionView {
128128
.build()
129129
}
130130

131-
#[cfg(not(disable_faketime))]
132131
#[test]
133132
fn test_block_template_timestamp() {
134133
let mut _faketime_guard = ckb_systemtime::faketime();

devtools/windows/make.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function Disable-DebugSymbols {
5757
}
5858

5959
function run-prod {
60-
Set-Env RUSTFLAGS "--cfg disable_faketime"
60+
Set-Env RUSTFLAGS ""
6161
cargo build @Verbose --release
6262
}
6363

network/src/tests/peer_store.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ fn test_update_status() {
8282
);
8383
}
8484

85-
#[cfg(not(disable_faketime))]
8685
#[test]
8786
fn test_ban_peer() {
8887
let _faketime_guard = ckb_systemtime::faketime();
@@ -122,7 +121,6 @@ fn test_ban_peer() {
122121
assert_eq!(peer_store.ban_list().count(), 1)
123122
}
124123

125-
#[cfg(not(disable_faketime))]
126124
#[test]
127125
fn test_attempt_ban() {
128126
let _faketime_guard = ckb_systemtime::faketime();
@@ -156,7 +154,6 @@ fn test_attempt_ban() {
156154
);
157155
}
158156

159-
#[cfg(not(disable_faketime))]
160157
#[test]
161158
fn test_fetch_addrs_to_attempt() {
162159
let _faketime_guard = ckb_systemtime::faketime();
@@ -189,7 +186,6 @@ fn test_fetch_addrs_to_attempt() {
189186
.is_empty());
190187
}
191188

192-
#[cfg(not(disable_faketime))]
193189
#[test]
194190
fn test_fetch_addrs_to_attempt_or_feeler() {
195191
let _faketime_guard = ckb_systemtime::faketime();
@@ -217,7 +213,6 @@ fn test_fetch_addrs_to_attempt_or_feeler() {
217213
assert_eq!(peer_store.fetch_addrs_to_feeler(2).len(), 1);
218214
}
219215

220-
#[cfg(not(disable_faketime))]
221216
#[test]
222217
fn test_fetch_addrs_to_attempt_in_last_minutes() {
223218
let _faketime_guard = ckb_systemtime::faketime();

sync/src/tests/inflight_blocks.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ fn inflight_blocks_state() {
8787
);
8888
}
8989

90-
#[cfg(not(disable_faketime))]
9190
#[test]
9291
fn inflight_blocks_timeout() {
9392
let _faketime_guard = ckb_systemtime::faketime();
@@ -140,7 +139,6 @@ fn inflight_blocks_timeout() {
140139
);
141140
}
142141

143-
#[cfg(not(disable_faketime))]
144142
#[test]
145143
fn inflight_trace_number_state() {
146144
let _faketime_guard = ckb_systemtime::faketime();

sync/src/tests/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mod inflight_blocks;
1717
mod net_time_checker;
1818
mod orphan_block_pool;
1919
mod sync_shared;
20-
#[cfg(not(disable_faketime))]
20+
2121
mod synchronizer;
2222
mod types;
2323
mod util;

sync/src/tests/synchronizer/functions.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,6 @@ fn test_sync_process() {
695695
);
696696
}
697697

698-
#[cfg(not(disable_faketime))]
699698
#[test]
700699
fn test_header_sync_timeout() {
701700
let _faketime_guard = ckb_systemtime::faketime();
@@ -747,7 +746,6 @@ fn test_header_sync_timeout() {
747746
)
748747
}
749748

750-
#[cfg(not(disable_faketime))]
751749
#[test]
752750
fn test_chain_sync_timeout() {
753751
let _faketime_guard = ckb_systemtime::faketime();
@@ -945,7 +943,6 @@ fn test_chain_sync_timeout() {
945943
}
946944
}
947945

948-
#[cfg(not(disable_faketime))]
949946
#[test]
950947
fn test_n_sync_started() {
951948
let _faketime_guard = ckb_systemtime::faketime();
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
mod contextual_block_verifier;
2-
#[cfg(not(disable_faketime))]
2+
33
mod uncle_verifier;

verification/src/tests/header_verifier.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ pub fn test_version() {
6161
assert!(verifier.verify().is_ok());
6262
}
6363

64-
#[cfg(not(disable_faketime))]
6564
#[test]
6665
fn test_timestamp() {
6766
let _faketime_guard = ckb_systemtime::faketime();
@@ -82,7 +81,6 @@ fn test_timestamp() {
8281
assert!(timestamp_verifier.verify().is_ok());
8382
}
8483

85-
#[cfg(not(disable_faketime))]
8684
#[test]
8785
fn test_timestamp_too_old() {
8886
let _faketime_guard = ckb_systemtime::faketime();
@@ -111,7 +109,6 @@ fn test_timestamp_too_old() {
111109
);
112110
}
113111

114-
#[cfg(not(disable_faketime))]
115112
#[test]
116113
fn test_timestamp_too_new() {
117114
let _faketime_guard = ckb_systemtime::faketime();

0 commit comments

Comments
 (0)