Skip to content

Commit

Permalink
fix(ci): switch back to lts node
Browse files Browse the repository at this point in the history
This also tests  ipfs/npm-kubo#74
removing the need for hack from #2662
  • Loading branch information
lidel committed Jun 7, 2024
1 parent be18c2e commit 0f3d2c5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '18.17.1'
node-version: 'lts/*'

- name: Read ipfs-webui CID from package.json
id: read-webui-version
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '18.17.1'
node-version: 'lts/*'

- name: Read ipfs-webui CID from package.json
id: read-webui-version
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '18.17.1'
node-version: 'lts/*'

- name: Read ipfs-webui CID from package.json
id: read-webui-version
Expand Down
29 changes: 29 additions & 0 deletions patches/kubo+0.29.0-rc2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/node_modules/kubo/bin/ipfs b/node_modules/kubo/bin/ipfs
index 70b8f92..4d3c24c 100644
--- a/node_modules/kubo/src/download.js
+++ b/node_modules/kubo/src/download.js
@@ -204,7 +204,23 @@ async function link ({ depBin, version }) {
}

console.info('Linking', depBin, 'to', localBin)
- fs.symlinkSync(depBin, localBin)
+ try {
+ fs.symlinkSync(depBin, localBin)
+ } catch (err) {
+ // Try to recover when creating symlink on modern Windows fails (https://github.com/ipfs/npm-kubo/issues/68)
+ if (isWin && typeof err === 'object' && err !== null && 'code' in err && err.code === 'EPERM') {
+ console.info('Symlink creation failed due to insufficient privileges. Attempting to copy file instead...')
+ try {
+ fs.copyFileSync(depBin, localBin)
+ console.info('Copying', depBin, 'to', localBin)
+ } catch (copyErr) {
+ console.error('File copy also failed:', copyErr)
+ throw copyErr
+ }
+ } else {
+ throw err
+ }
+ }

if (isWin) {
// On Windows, update the shortcut file to use the .exe

0 comments on commit 0f3d2c5

Please sign in to comment.