File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ impl PartialEq for LockFile {
4848 self . packages == other. packages && self . version == other. version
4949 }
5050}
51+ /// Compares a [`LockFile`] against a `(version, packages)` snapshot. This is used to
52+ /// detect whether a build would mutate the lock file (e.g. before publishing) without
53+ /// having to hold a second [`LockFile`].
5154impl PartialEq < ( u64 , BTreeSet < LockedPackage > ) > for LockFile {
5255 fn eq ( & self , other : & ( u64 , BTreeSet < LockedPackage > ) ) -> bool {
5356 self . packages == other. 1 && self . version == other. 0
Original file line number Diff line number Diff line change @@ -285,8 +285,12 @@ impl PublishArgs {
285285 } ) ;
286286 }
287287
288+ // Sanitize the package ref for use as a filename prefix: `namespace:name`
289+ // contains characters (`:`, `/`) that are invalid in filenames on some
290+ // platforms (notably Windows).
291+ let prefix: String = build_ref. to_string ( ) . replace ( [ ':' , '/' ] , "_" ) ;
288292 let tmp = tempfile:: Builder :: new ( )
289- . prefix ( & build_ref . to_string ( ) )
293+ . prefix ( & prefix )
290294 . suffix ( ".wasm" )
291295 . tempfile ( )
292296 . context ( "Failed to create temporary file for built WIT package" ) ?;
You can’t perform that action at this time.
0 commit comments