Skip to content

Commit 878ee14

Browse files
swinslowcfriedt
authored andcommitted
west: spdx: Fix --init for Windows builds
Currently, west spdx --init uses os.mknod to create an empty file to enable the Cmake file-based API system. As reported in #39311, Python on Windows does not implement os.mknod. This commit switches to using open()/close() instead of os.mknod() to address this issue. Signed-off-by: Steve Winslow <[email protected]>
1 parent 89e701d commit 878ee14

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/west_commands/zspdx/sbom.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ def setupCmakeQuery(build_dir):
5555
# file exists, we're good
5656
return True
5757
else:
58-
# file doesn't exist, let's create it
59-
os.mknod(queryFilePath)
58+
# file doesn't exist, let's create an empty file
59+
cm_fd = open(queryFilePath, "w")
60+
cm_fd.close()
6061
return True
6162

6263
# main entry point for SBOM maker

0 commit comments

Comments
 (0)