File tree Expand file tree Collapse file tree 9 files changed +156
-36
lines changed Expand file tree Collapse file tree 9 files changed +156
-36
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,21 @@ const LibraryForFileLocking = {
40
40
}
41
41
42
42
// Handle PROXYFS nodes which wrap other nodes.
43
- if ( ! node ?. mount ?. opts ?. fs ?. lookupPath ) {
43
+ if ( ! node ?. mount ?. opts ?. fs ?. lookupPath || ! node ?. mount ?. type ?. realPath ) {
44
44
return false ;
45
45
}
46
46
47
- const vfsPath = NODEFS . realPath ( node ) ;
48
- const underlyingNode = node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
49
- return ! ! underlyingNode ?. isSharedFS ;
47
+ // Only NODEFS can be shared between workers at the moment.
48
+ if ( node . mount . type !== NODEFS ) {
49
+ return false ;
50
+ }
51
+ const vfsPath = node . mount . type . realPath ( node ) ;
52
+ try {
53
+ const underlyingNode = node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
54
+ return ! ! underlyingNode ?. isSharedFS ;
55
+ } catch ( e ) {
56
+ return false ;
57
+ }
50
58
} ,
51
59
is_path_to_shared_fs ( path ) {
52
60
const { node } = FS . lookupPath ( path ) ;
Original file line number Diff line number Diff line change @@ -5659,13 +5659,27 @@ export function init(RuntimeName, PHPLoader) {
5659
5659
if ( node ?. isSharedFS ) {
5660
5660
return true ;
5661
5661
}
5662
+
5662
5663
// Handle PROXYFS nodes which wrap other nodes.
5663
- if ( ! node ?. mount ?. opts ?. fs ?. lookupPath ) {
5664
+ if (
5665
+ ! node ?. mount ?. opts ?. fs ?. lookupPath ||
5666
+ ! node ?. mount ?. type ?. realPath
5667
+ ) {
5668
+ return false ;
5669
+ }
5670
+
5671
+ // Only NODEFS can be shared between workers at the moment.
5672
+ if ( node . mount . type !== NODEFS ) {
5673
+ return false ;
5674
+ }
5675
+ const vfsPath = node . mount . type . realPath ( node ) ;
5676
+ try {
5677
+ const underlyingNode =
5678
+ node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
5679
+ return ! ! underlyingNode ?. isSharedFS ;
5680
+ } catch ( e ) {
5664
5681
return false ;
5665
5682
}
5666
- const vfsPath = NODEFS . realPath ( node ) ;
5667
- const underlyingNode = node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
5668
- return ! ! underlyingNode ?. isSharedFS ;
5669
5683
} ,
5670
5684
is_path_to_shared_fs ( path ) {
5671
5685
const { node } = FS . lookupPath ( path ) ;
Original file line number Diff line number Diff line change @@ -5659,13 +5659,27 @@ export function init(RuntimeName, PHPLoader) {
5659
5659
if ( node ?. isSharedFS ) {
5660
5660
return true ;
5661
5661
}
5662
+
5662
5663
// Handle PROXYFS nodes which wrap other nodes.
5663
- if ( ! node ?. mount ?. opts ?. fs ?. lookupPath ) {
5664
+ if (
5665
+ ! node ?. mount ?. opts ?. fs ?. lookupPath ||
5666
+ ! node ?. mount ?. type ?. realPath
5667
+ ) {
5668
+ return false ;
5669
+ }
5670
+
5671
+ // Only NODEFS can be shared between workers at the moment.
5672
+ if ( node . mount . type !== NODEFS ) {
5673
+ return false ;
5674
+ }
5675
+ const vfsPath = node . mount . type . realPath ( node ) ;
5676
+ try {
5677
+ const underlyingNode =
5678
+ node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
5679
+ return ! ! underlyingNode ?. isSharedFS ;
5680
+ } catch ( e ) {
5664
5681
return false ;
5665
5682
}
5666
- const vfsPath = NODEFS . realPath ( node ) ;
5667
- const underlyingNode = node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
5668
- return ! ! underlyingNode ?. isSharedFS ;
5669
5683
} ,
5670
5684
is_path_to_shared_fs ( path ) {
5671
5685
const { node } = FS . lookupPath ( path ) ;
Original file line number Diff line number Diff line change @@ -5659,13 +5659,27 @@ export function init(RuntimeName, PHPLoader) {
5659
5659
if ( node ?. isSharedFS ) {
5660
5660
return true ;
5661
5661
}
5662
+
5662
5663
// Handle PROXYFS nodes which wrap other nodes.
5663
- if ( ! node ?. mount ?. opts ?. fs ?. lookupPath ) {
5664
+ if (
5665
+ ! node ?. mount ?. opts ?. fs ?. lookupPath ||
5666
+ ! node ?. mount ?. type ?. realPath
5667
+ ) {
5668
+ return false ;
5669
+ }
5670
+
5671
+ // Only NODEFS can be shared between workers at the moment.
5672
+ if ( node . mount . type !== NODEFS ) {
5673
+ return false ;
5674
+ }
5675
+ const vfsPath = node . mount . type . realPath ( node ) ;
5676
+ try {
5677
+ const underlyingNode =
5678
+ node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
5679
+ return ! ! underlyingNode ?. isSharedFS ;
5680
+ } catch ( e ) {
5664
5681
return false ;
5665
5682
}
5666
- const vfsPath = NODEFS . realPath ( node ) ;
5667
- const underlyingNode = node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
5668
- return ! ! underlyingNode ?. isSharedFS ;
5669
5683
} ,
5670
5684
is_path_to_shared_fs ( path ) {
5671
5685
const { node } = FS . lookupPath ( path ) ;
Original file line number Diff line number Diff line change @@ -5677,13 +5677,27 @@ export function init(RuntimeName, PHPLoader) {
5677
5677
if ( node ?. isSharedFS ) {
5678
5678
return true ;
5679
5679
}
5680
+
5680
5681
// Handle PROXYFS nodes which wrap other nodes.
5681
- if ( ! node ?. mount ?. opts ?. fs ?. lookupPath ) {
5682
+ if (
5683
+ ! node ?. mount ?. opts ?. fs ?. lookupPath ||
5684
+ ! node ?. mount ?. type ?. realPath
5685
+ ) {
5686
+ return false ;
5687
+ }
5688
+
5689
+ // Only NODEFS can be shared between workers at the moment.
5690
+ if ( node . mount . type !== NODEFS ) {
5691
+ return false ;
5692
+ }
5693
+ const vfsPath = node . mount . type . realPath ( node ) ;
5694
+ try {
5695
+ const underlyingNode =
5696
+ node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
5697
+ return ! ! underlyingNode ?. isSharedFS ;
5698
+ } catch ( e ) {
5682
5699
return false ;
5683
5700
}
5684
- const vfsPath = NODEFS . realPath ( node ) ;
5685
- const underlyingNode = node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
5686
- return ! ! underlyingNode ?. isSharedFS ;
5687
5701
} ,
5688
5702
is_path_to_shared_fs ( path ) {
5689
5703
const { node } = FS . lookupPath ( path ) ;
Original file line number Diff line number Diff line change @@ -5677,13 +5677,27 @@ export function init(RuntimeName, PHPLoader) {
5677
5677
if ( node ?. isSharedFS ) {
5678
5678
return true ;
5679
5679
}
5680
+
5680
5681
// Handle PROXYFS nodes which wrap other nodes.
5681
- if ( ! node ?. mount ?. opts ?. fs ?. lookupPath ) {
5682
+ if (
5683
+ ! node ?. mount ?. opts ?. fs ?. lookupPath ||
5684
+ ! node ?. mount ?. type ?. realPath
5685
+ ) {
5686
+ return false ;
5687
+ }
5688
+
5689
+ // Only NODEFS can be shared between workers at the moment.
5690
+ if ( node . mount . type !== NODEFS ) {
5691
+ return false ;
5692
+ }
5693
+ const vfsPath = node . mount . type . realPath ( node ) ;
5694
+ try {
5695
+ const underlyingNode =
5696
+ node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
5697
+ return ! ! underlyingNode ?. isSharedFS ;
5698
+ } catch ( e ) {
5682
5699
return false ;
5683
5700
}
5684
- const vfsPath = NODEFS . realPath ( node ) ;
5685
- const underlyingNode = node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
5686
- return ! ! underlyingNode ?. isSharedFS ;
5687
5701
} ,
5688
5702
is_path_to_shared_fs ( path ) {
5689
5703
const { node } = FS . lookupPath ( path ) ;
Original file line number Diff line number Diff line change @@ -5677,13 +5677,27 @@ export function init(RuntimeName, PHPLoader) {
5677
5677
if ( node ?. isSharedFS ) {
5678
5678
return true ;
5679
5679
}
5680
+
5680
5681
// Handle PROXYFS nodes which wrap other nodes.
5681
- if ( ! node ?. mount ?. opts ?. fs ?. lookupPath ) {
5682
+ if (
5683
+ ! node ?. mount ?. opts ?. fs ?. lookupPath ||
5684
+ ! node ?. mount ?. type ?. realPath
5685
+ ) {
5686
+ return false ;
5687
+ }
5688
+
5689
+ // Only NODEFS can be shared between workers at the moment.
5690
+ if ( node . mount . type !== NODEFS ) {
5691
+ return false ;
5692
+ }
5693
+ const vfsPath = node . mount . type . realPath ( node ) ;
5694
+ try {
5695
+ const underlyingNode =
5696
+ node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
5697
+ return ! ! underlyingNode ?. isSharedFS ;
5698
+ } catch ( e ) {
5682
5699
return false ;
5683
5700
}
5684
- const vfsPath = NODEFS . realPath ( node ) ;
5685
- const underlyingNode = node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
5686
- return ! ! underlyingNode ?. isSharedFS ;
5687
5701
} ,
5688
5702
is_path_to_shared_fs ( path ) {
5689
5703
const { node } = FS . lookupPath ( path ) ;
Original file line number Diff line number Diff line change @@ -5677,13 +5677,27 @@ export function init(RuntimeName, PHPLoader) {
5677
5677
if ( node ?. isSharedFS ) {
5678
5678
return true ;
5679
5679
}
5680
+
5680
5681
// Handle PROXYFS nodes which wrap other nodes.
5681
- if ( ! node ?. mount ?. opts ?. fs ?. lookupPath ) {
5682
+ if (
5683
+ ! node ?. mount ?. opts ?. fs ?. lookupPath ||
5684
+ ! node ?. mount ?. type ?. realPath
5685
+ ) {
5686
+ return false ;
5687
+ }
5688
+
5689
+ // Only NODEFS can be shared between workers at the moment.
5690
+ if ( node . mount . type !== NODEFS ) {
5691
+ return false ;
5692
+ }
5693
+ const vfsPath = node . mount . type . realPath ( node ) ;
5694
+ try {
5695
+ const underlyingNode =
5696
+ node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
5697
+ return ! ! underlyingNode ?. isSharedFS ;
5698
+ } catch ( e ) {
5682
5699
return false ;
5683
5700
}
5684
- const vfsPath = NODEFS . realPath ( node ) ;
5685
- const underlyingNode = node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
5686
- return ! ! underlyingNode ?. isSharedFS ;
5687
5701
} ,
5688
5702
is_path_to_shared_fs ( path ) {
5689
5703
const { node } = FS . lookupPath ( path ) ;
Original file line number Diff line number Diff line change @@ -5677,13 +5677,27 @@ export function init(RuntimeName, PHPLoader) {
5677
5677
if ( node ?. isSharedFS ) {
5678
5678
return true ;
5679
5679
}
5680
+
5680
5681
// Handle PROXYFS nodes which wrap other nodes.
5681
- if ( ! node ?. mount ?. opts ?. fs ?. lookupPath ) {
5682
+ if (
5683
+ ! node ?. mount ?. opts ?. fs ?. lookupPath ||
5684
+ ! node ?. mount ?. type ?. realPath
5685
+ ) {
5686
+ return false ;
5687
+ }
5688
+
5689
+ // Only NODEFS can be shared between workers at the moment.
5690
+ if ( node . mount . type !== NODEFS ) {
5691
+ return false ;
5692
+ }
5693
+ const vfsPath = node . mount . type . realPath ( node ) ;
5694
+ try {
5695
+ const underlyingNode =
5696
+ node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
5697
+ return ! ! underlyingNode ?. isSharedFS ;
5698
+ } catch ( e ) {
5682
5699
return false ;
5683
5700
}
5684
- const vfsPath = NODEFS . realPath ( node ) ;
5685
- const underlyingNode = node . mount . opts . fs . lookupPath ( vfsPath ) ?. node ;
5686
- return ! ! underlyingNode ?. isSharedFS ;
5687
5701
} ,
5688
5702
is_path_to_shared_fs ( path ) {
5689
5703
const { node } = FS . lookupPath ( path ) ;
You can’t perform that action at this time.
0 commit comments