Skip to content

Commit ed8e18b

Browse files
Merge pull request #710 from denoland/main
Create a new pull request by comparing changes across two branches
2 parents 3eba60b + b7fb5a5 commit ed8e18b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2301
-1789
lines changed

.github/workflows/ci.generate.ts

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ const ci = {
360360
needs: ["pre_build"],
361361
if: "${{ needs.pre_build.outputs.skip_build != 'true' }}",
362362
"runs-on": "${{ matrix.runner }}",
363-
"timeout-minutes": 180,
363+
"timeout-minutes": 240,
364364
defaults: {
365365
run: {
366366
// GH actions does not fail fast by default on
@@ -716,19 +716,6 @@ const ci = {
716716
"df -h",
717717
].join("\n"),
718718
},
719-
{
720-
name: "Build denort release",
721-
if: [
722-
"matrix.job == 'test' &&",
723-
"matrix.profile == 'release' &&",
724-
"github.repository == 'denoland/deno'",
725-
].join("\n"),
726-
run: [
727-
"df -h",
728-
"cargo build --profile=release-slim --locked --bin denort",
729-
"df -h",
730-
].join("\n"),
731-
},
732719
{
733720
// Run a minimal check to ensure that binary is not corrupted, regardless
734721
// of our build mode
@@ -775,11 +762,10 @@ const ci = {
775762
"cd target/release",
776763
"zip -r deno-${{ matrix.arch }}-unknown-linux-gnu.zip deno",
777764
"shasum -a 256 deno-${{ matrix.arch }}-unknown-linux-gnu.zip > deno-${{ matrix.arch }}-unknown-linux-gnu.zip.sha256sum",
778-
"./deno types > lib.deno.d.ts",
779-
"cd ../release-slim",
780-
"zip -r ../release/denort-${{ matrix.arch }}-unknown-linux-gnu.zip denort",
781-
"cd ../release",
765+
"strip denort",
766+
"zip -r denort-${{ matrix.arch }}-unknown-linux-gnu.zip denort",
782767
"shasum -a 256 denort-${{ matrix.arch }}-unknown-linux-gnu.zip > denort-${{ matrix.arch }}-unknown-linux-gnu.zip.sha256sum",
768+
"./deno types > lib.deno.d.ts",
783769
].join("\n"),
784770
},
785771
{
@@ -804,9 +790,8 @@ const ci = {
804790
"cd target/release",
805791
"zip -r deno-${{ matrix.arch }}-apple-darwin.zip deno",
806792
"shasum -a 256 deno-${{ matrix.arch }}-apple-darwin.zip > deno-${{ matrix.arch }}-apple-darwin.zip.sha256sum",
807-
"cd ../release-slim",
808-
"zip -r ../release/denort-${{ matrix.arch }}-apple-darwin.zip denort",
809-
"cd ../release",
793+
"strip denort",
794+
"zip -r denort-${{ matrix.arch }}-apple-darwin.zip denort",
810795
"shasum -a 256 denort-${{ matrix.arch }}-apple-darwin.zip > denort-${{ matrix.arch }}-apple-darwin.zip.sha256sum",
811796
]
812797
.join("\n"),
@@ -823,8 +808,7 @@ const ci = {
823808
run: [
824809
"Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno.exe -DestinationPath target/release/deno-${{ matrix.arch }}-pc-windows-msvc.zip",
825810
"Get-FileHash target/release/deno-${{ matrix.arch }}-pc-windows-msvc.zip -Algorithm SHA256 | Format-List > target/release/deno-${{ matrix.arch }}-pc-windows-msvc.zip.sha256sum",
826-
827-
"Compress-Archive -CompressionLevel Optimal -Force -Path target/release-slim/denort.exe -DestinationPath target/release/denort-${{ matrix.arch }}-pc-windows-msvc.zip",
811+
"Compress-Archive -CompressionLevel Optimal -Force -Path target/release/denort.exe -DestinationPath target/release/denort-${{ matrix.arch }}-pc-windows-msvc.zip",
828812
"Get-FileHash target/release/denort-${{ matrix.arch }}-pc-windows-msvc.zip -Algorithm SHA256 | Format-List > target/release/denort-${{ matrix.arch }}-pc-windows-msvc.zip.sha256sum",
829813
].join("\n"),
830814
},

.github/workflows/ci.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- pre_build
4949
if: '${{ needs.pre_build.outputs.skip_build != ''true'' }}'
5050
runs-on: '${{ matrix.runner }}'
51-
timeout-minutes: 180
51+
timeout-minutes: 240
5252
defaults:
5353
run:
5454
shell: bash
@@ -419,15 +419,6 @@ jobs:
419419
df -h
420420
cargo build --release --locked --all-targets
421421
df -h
422-
- name: Build denort release
423-
if: |-
424-
!(matrix.skip) && (matrix.job == 'test' &&
425-
matrix.profile == 'release' &&
426-
github.repository == 'denoland/deno')
427-
run: |-
428-
df -h
429-
cargo build --profile=release-slim --locked --bin denort
430-
df -h
431422
- name: Check deno binary
432423
if: '!(matrix.skip) && (matrix.job == ''test'')'
433424
run: 'target/${{ matrix.profile }}/deno eval "console.log(1+2)" | grep 3'
@@ -457,11 +448,10 @@ jobs:
457448
cd target/release
458449
zip -r deno-${{ matrix.arch }}-unknown-linux-gnu.zip deno
459450
shasum -a 256 deno-${{ matrix.arch }}-unknown-linux-gnu.zip > deno-${{ matrix.arch }}-unknown-linux-gnu.zip.sha256sum
460-
./deno types > lib.deno.d.ts
461-
cd ../release-slim
462-
zip -r ../release/denort-${{ matrix.arch }}-unknown-linux-gnu.zip denort
463-
cd ../release
451+
strip denort
452+
zip -r denort-${{ matrix.arch }}-unknown-linux-gnu.zip denort
464453
shasum -a 256 denort-${{ matrix.arch }}-unknown-linux-gnu.zip > denort-${{ matrix.arch }}-unknown-linux-gnu.zip.sha256sum
454+
./deno types > lib.deno.d.ts
465455
- name: Pre-release (mac)
466456
if: |-
467457
!(matrix.skip) && (matrix.os == 'macos' &&
@@ -477,9 +467,8 @@ jobs:
477467
cd target/release
478468
zip -r deno-${{ matrix.arch }}-apple-darwin.zip deno
479469
shasum -a 256 deno-${{ matrix.arch }}-apple-darwin.zip > deno-${{ matrix.arch }}-apple-darwin.zip.sha256sum
480-
cd ../release-slim
481-
zip -r ../release/denort-${{ matrix.arch }}-apple-darwin.zip denort
482-
cd ../release
470+
strip denort
471+
zip -r denort-${{ matrix.arch }}-apple-darwin.zip denort
483472
shasum -a 256 denort-${{ matrix.arch }}-apple-darwin.zip > denort-${{ matrix.arch }}-apple-darwin.zip.sha256sum
484473
- name: Pre-release (windows)
485474
if: |-
@@ -491,7 +480,7 @@ jobs:
491480
run: |-
492481
Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno.exe -DestinationPath target/release/deno-${{ matrix.arch }}-pc-windows-msvc.zip
493482
Get-FileHash target/release/deno-${{ matrix.arch }}-pc-windows-msvc.zip -Algorithm SHA256 | Format-List > target/release/deno-${{ matrix.arch }}-pc-windows-msvc.zip.sha256sum
494-
Compress-Archive -CompressionLevel Optimal -Force -Path target/release-slim/denort.exe -DestinationPath target/release/denort-${{ matrix.arch }}-pc-windows-msvc.zip
483+
Compress-Archive -CompressionLevel Optimal -Force -Path target/release/denort.exe -DestinationPath target/release/denort-${{ matrix.arch }}-pc-windows-msvc.zip
495484
Get-FileHash target/release/denort-${{ matrix.arch }}-pc-windows-msvc.zip -Algorithm SHA256 | Format-List > target/release/denort-${{ matrix.arch }}-pc-windows-msvc.zip.sha256sum
496485
- name: Upload canary to dl.deno.land
497486
if: |-

Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,6 @@ incremental = true
251251
lto = true
252252
opt-level = 'z' # Optimize for size
253253

254-
[profile.release-slim]
255-
inherits = "release"
256-
panic = "abort"
257-
strip = "symbols"
258-
259254
# Build release with debug symbols: cargo build --profile=release-with-debug
260255
[profile.release-with-debug]
261256
inherits = "release"

cli/cache/cache_db.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ impl CacheDBHash {
2525
Self(hash)
2626
}
2727

28-
pub fn from_source(source: impl std::hash::Hash) -> Self {
28+
pub fn from_hashable(hashable: impl std::hash::Hash) -> Self {
2929
Self::new(
3030
// always write in the deno version just in case
3131
// the clearing on deno version change doesn't work
3232
FastInsecureHasher::new_deno_versioned()
33-
.write_hashable(source)
33+
.write_hashable(hashable)
3434
.finish(),
3535
)
3636
}

cli/cache/incremental.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,16 @@ pub static INCREMENTAL_CACHE_DB: CacheDBConfiguration = CacheDBConfiguration {
3434
pub struct IncrementalCache(IncrementalCacheInner);
3535

3636
impl IncrementalCache {
37-
pub fn new<TState: std::hash::Hash>(
37+
pub fn new(
3838
db: CacheDB,
39-
state: &TState,
39+
state_hash: CacheDBHash,
4040
initial_file_paths: &[PathBuf],
4141
) -> Self {
42-
IncrementalCache(IncrementalCacheInner::new(db, state, initial_file_paths))
42+
IncrementalCache(IncrementalCacheInner::new(
43+
db,
44+
state_hash,
45+
initial_file_paths,
46+
))
4347
}
4448

4549
pub fn is_file_same(&self, file_path: &Path, file_text: &str) -> bool {
@@ -67,12 +71,11 @@ struct IncrementalCacheInner {
6771
}
6872

6973
impl IncrementalCacheInner {
70-
pub fn new<TState: std::hash::Hash>(
74+
pub fn new(
7175
db: CacheDB,
72-
state: &TState,
76+
state_hash: CacheDBHash,
7377
initial_file_paths: &[PathBuf],
7478
) -> Self {
75-
let state_hash = CacheDBHash::from_source(state);
7679
let sql_cache = SqlIncrementalCache::new(db, state_hash);
7780
Self::from_sql_incremental_cache(sql_cache, initial_file_paths)
7881
}
@@ -112,13 +115,13 @@ impl IncrementalCacheInner {
112115

113116
pub fn is_file_same(&self, file_path: &Path, file_text: &str) -> bool {
114117
match self.previous_hashes.get(file_path) {
115-
Some(hash) => *hash == CacheDBHash::from_source(file_text),
118+
Some(hash) => *hash == CacheDBHash::from_hashable(file_text),
116119
None => false,
117120
}
118121
}
119122

120123
pub fn update_file(&self, file_path: &Path, file_text: &str) {
121-
let hash = CacheDBHash::from_source(file_text);
124+
let hash = CacheDBHash::from_hashable(file_text);
122125
if let Some(previous_hash) = self.previous_hashes.get(file_path) {
123126
if *previous_hash == hash {
124127
return; // do not bother updating the db file because nothing has changed
@@ -262,7 +265,7 @@ mod test {
262265
let sql_cache = SqlIncrementalCache::new(conn, CacheDBHash::new(1));
263266
let file_path = PathBuf::from("/mod.ts");
264267
let file_text = "test";
265-
let file_hash = CacheDBHash::from_source(file_text);
268+
let file_hash = CacheDBHash::from_hashable(file_text);
266269
sql_cache.set_source_hash(&file_path, file_hash).unwrap();
267270
let cache = IncrementalCacheInner::from_sql_incremental_cache(
268271
sql_cache,

cli/cache/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ impl Loader for FetchCacher {
298298
module_info: &deno_graph::ModuleInfo,
299299
) {
300300
log::debug!("Caching module info for {}", specifier);
301-
let source_hash = CacheDBHash::from_source(source);
301+
let source_hash = CacheDBHash::from_hashable(source);
302302
let result = self.module_info_cache.set_module_info(
303303
specifier,
304304
media_type,

cli/cache/module_info.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl<'a> ModuleInfoCacheModuleAnalyzer<'a> {
194194
source: &Arc<str>,
195195
) -> Result<ModuleInfo, deno_ast::ParseDiagnostic> {
196196
// attempt to load from the cache
197-
let source_hash = CacheDBHash::from_source(source);
197+
let source_hash = CacheDBHash::from_hashable(source);
198198
if let Some(info) =
199199
self.load_cached_module_info(specifier, media_type, source_hash)
200200
{
@@ -228,7 +228,7 @@ impl<'a> deno_graph::ModuleAnalyzer for ModuleInfoCacheModuleAnalyzer<'a> {
228228
media_type: MediaType,
229229
) -> Result<ModuleInfo, deno_ast::ParseDiagnostic> {
230230
// attempt to load from the cache
231-
let source_hash = CacheDBHash::from_source(&source);
231+
let source_hash = CacheDBHash::from_hashable(&source);
232232
if let Some(info) =
233233
self.load_cached_module_info(specifier, media_type, source_hash)
234234
{

cli/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,9 @@ fn resolve_flags_and_init(
447447
}
448448
};
449449

450-
deno_telemetry::init(crate::args::otel_runtime_config())?;
451-
util::logger::init(flags.log_level, Some(flags.otel_config()));
450+
let otel_config = flags.otel_config();
451+
deno_telemetry::init(crate::args::otel_runtime_config(), &otel_config)?;
452+
util::logger::init(flags.log_level, Some(otel_config));
452453

453454
// TODO(bartlomieju): remove in Deno v2.5 and hard error then.
454455
if flags.unstable_config.legacy_flag_enabled {

cli/mainrt.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ fn main() {
8989
let future = async move {
9090
match standalone {
9191
Ok(Some(data)) => {
92-
deno_telemetry::init(crate::args::otel_runtime_config())?;
92+
deno_telemetry::init(
93+
crate::args::otel_runtime_config(),
94+
&data.metadata.otel_config,
95+
)?;
9396
util::logger::init(
9497
data.metadata.log_level,
9598
Some(data.metadata.otel_config.clone()),

cli/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl CliCjsCodeAnalyzer {
6868
specifier: &ModuleSpecifier,
6969
source: &str,
7070
) -> Result<CliCjsAnalysis, AnyError> {
71-
let source_hash = CacheDBHash::from_source(source);
71+
let source_hash = CacheDBHash::from_hashable(source);
7272
if let Some(analysis) =
7373
self.cache.get_cjs_analysis(specifier.as_str(), source_hash)
7474
{

0 commit comments

Comments
 (0)