-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fix(compile): be more deterministic when compiling the same code in different directories #27395
fix(compile): be more deterministic when compiling the same code in different directories #27395
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
None | ||
}; | ||
let mut source_maps = Vec::with_capacity(graph.specifiers_count()); | ||
// todo(dsherret): transpile in parallel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open an issue about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll implement it sometime I'm in the code soon.
} else { | ||
self.shared.source_maps.get(file_name) | ||
} | ||
// todo(https://github.com/denoland/deno_core/pull/1007): don't clone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we release deno_core
before landing this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to not wait.
builder.append_le( | ||
self | ||
.data | ||
.iter() | ||
.map(|(_, data, maybe_transpiled)| { | ||
1 + 4 | ||
+ (data.len() as u64) | ||
+ 1 | ||
+ match maybe_transpiled { | ||
Some(transpiled) => 4 + (transpiled.len() as u64), | ||
None => 0, | ||
} | ||
}) | ||
.sum::<u64>(), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This serialization is now quite complex, I'm starting to feel we should add some unit tests for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also have you considered using serde_bincode
instead of hand rolling it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok. If there were any issues with it then the integration tests would fail.
I think this is more clear what's going on and allows for lazily deserializing certain parts.
Additionaly, this no longer unnecessarily stores the source twice for file specifiers and fixes some sourcemap issues.
Closes #27284