Skip to content

Rescript v10 building in watch mode fails with permission error #5617

Closed
@hellos3b

Description

@hellos3b

I've upgraded to rescript@10 and watch mode now fails with Error: EPERM: operation not permitted, open 'C:\Users\sebhe\Code\issue-rescript-permissions\.bsb.lock'

Full message:

PS C:\Users\sebhe\Code\issue-rescript-permissions> npm run dev

> issue-rescript-permissions@1.0.0 dev
> rescript build -w

Error: EPERM: operation not permitted, open 'C:\Users\sebhe\Code\issue-rescript-permissions\.bsb.lock'
    at Object.openSync (node:fs:585:3)
    at acquireBuild (C:\Users\sebhe\Code\issue-rescript-permissions\node_modules\rescript\rescript:207:10)
    at build (C:\Users\sebhe\Code\issue-rescript-permissions\node_modules\rescript\rescript:516:11)
    at in_watch_mode (C:\Users\sebhe\Code\issue-rescript-permissions\node_modules\rescript\rescript:587:5)
    at ChildProcess.<anonymous> (C:\Users\sebhe\Code\issue-rescript-permissions\node_modules\rescript\rescript:317:9)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) {
  errno: -4048,
  syscall: 'open',
  code: 'EPERM',
  path: 'C:\\Users\\sebhe\\Code\\issue-rescript-permissions\\.bsb.lock'
}

I am on Windows 11 and have had no issue with previous versions.

Steps I've taken to reproduce:

mkdir ./issue
cd ./issue
npm init -y
npm install rescript@10 -d
# > Copy bsconfig.json from documentation
# > Create src/HelloWorld.res
npm run dev # rescript build -w

System Info:

OS Name:                   Microsoft Windows 11 Home
OS Version:                10.0.22000 N/A Build 22000
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
System Manufacturer:       Microsoft Corporation
System Model:              Surface Laptop Studio
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 140 Stepping 1 GenuineIntel ~3110 Mhz
BIOS Version:              Microsoft Corporation 18.101.141, 12/15/2021

I created an empty project and tried it in there and got the same error message. I've pushed it to github and included the lib/bs file in case anything in there is helpful

https://github.com/hellos3b/issue-rescript-permissions

Running npm install rescript to go back to v9 resolves the issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions