https://kotlinlang.org logo
#touchlab-tools
Title
# touchlab-tools
h

Håkon Pettersen

11/08/2023, 3:09 PM
Another question regarding our KMMBridge workflow. Build Main fails at this stage:
Copy code
> Task :updatePackageSwift FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':updatePackageSwift'.
> java.io.FileNotFoundException: /Package.swift (Read-only file system)
yml-files posted in the thread above. Anyone familiar with this issue?
k

kpgalligan

11/08/2023, 3:27 PM
KMMBridge config? Stack trace?
It looks like your
Package.swift
path is pointing at your file system root
Copy code
/Package.swift (Read-only file system)
By default, KMMBridge reads your git repo root with git to find the root. If that fails (no git installed or not a git repo), it should write a warning and produce
./Package.swift
. I'm curious about your
kmmbridge
block. The only way I can think of that you ran into this is :
Copy code
kmmbridge {
    spm("")
    // Etc
}
h

Håkon Pettersen

11/08/2023, 6:11 PM
Thanks for helping out again, Kevin. Config:
Copy code
kmmbridge {
    mavenPublishArtifacts()
    spm()
}
Stack trace here:
k

kpgalligan

11/08/2023, 6:29 PM
It seems like we need to figure out why it's using the file system root as the repo route rather than the git repo root. You could try and specify
spm("./")
, although you shouldn't need to.
Now, looking at the script, after
Build Main
you'll have issues with the autoversion, but one thing at a time I guess.
h

Håkon Pettersen

11/08/2023, 6:44 PM
We had no issues running the example-project, which used auto-versioning. For our usecase we wanted to disable auto-versioning, so we did some modifications to the script. We can attempt to revert the changes we made to the script to allow for auto-versioning again and see if that resolves it.
k

kpgalligan

11/08/2023, 6:51 PM
It's more that you're using autoversion tasks after the build, but not the ones before, which will expect certain things to have been done already. I haven't looked at exactly what they'll do as your script is presented, and maybe it'll be OK? As an example, you're not creating a build branch, but you are passing that in to
autoversion-finishrelease
.
autoversion-tagmarker-cleanup
is only used to clean up marker tags, which you're not creating anymore, and you're also not using
fetch-tags: true
on checkout.
autoversion-tagmarker-cleanup
won't fail, but it doesn't do anything. Also
Delete branch
is there, but it's never created.
h

Håkon Pettersen

11/16/2023, 8:27 AM
Specifying
spm("./")
resolved the
/Package.swift (Read-only file system)
issue. We've also streamlined our workflow by removing unnecessary auto-versioning steps. Everything is functioning as expected now. KMMBridge is working like a charm, thanks for an amazing tool @kpgalligan!
👍 1