Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Windows:Link): Initial fix that passes the link phase #1613

Merged
merged 7 commits into from
Jul 1, 2024

Conversation

RicardasN
Copy link
Collaborator

@RicardasN RicardasN commented Jun 19, 2024

Description

  • Updated rename function as on Windows it required moving files, simple renaming was not enough.

Related issues

Npm releases

n/a

Screenshots

image

@RicardasN RicardasN marked this pull request as ready for review June 20, 2024 06:56
@RicardasN RicardasN added the e2e label Jun 20, 2024
Copy link
Collaborator

@GabrieleKaceviciute GabrieleKaceviciute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested on Windows 10 Pro, Node v18.19.0 ->

C:\Users\dev\Desktop\hello-renative>rnv link

┌─────────────────────────────────────────────────────────────────┐
│ ██████╗ ███████╗███╗   ██╗ █████╗ ████████╗██╗██╗   ██╗███████╗ │
│ ██╔══██╗██╔════╝████╗  ██║██╔══██╗╚══██╔══╝██║██║   ██║██╔════╝ │
│ ██████╔╝█████╗  ██╔██╗ ██║███████║   ██║   ██║██║   ██║█████╗   │
│ ██╔══██╗██╔══╝  ██║╚██╗██║██╔══██║   ██║   ██║╚██╗ ██╔╝██╔══╝   │
│ ██║  ██║███████╗██║ ╚████║██║  ██║   ██║   ██║ ╚████╔╝ ███████╗ │
│ ╚═╝  ╚═╝╚══════╝╚═╝  ╚═══╝╚═╝  ╚═╝   ╚═╝   ╚═╝  ╚═══╝  ╚══════╝ │
│ RNV v:1.0.0-rc.19 | renative.org | 21/06/2024, 11:21:47         │
│ $ rnv link                                                      │
└─────────────────────────────────────────────────────────────────┘
info: Current engine: @rnv/engine-core (C:\Users\dev\Desktop\renative\packages\engine-core\lib)
task: ○ link ↺1
info: Found following source packages:

C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\adapter (unlinked)
C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\cli (unlinked)
C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\config-templates (unlinked)
C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\core (unlinked)
C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\engine-core (unlinked)
C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\sdk-telemetry (unlinked)
C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\sdk-utils (unlinked)
C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\template-starter (unlinked)

? Found following packages to link? @rnv/adapter, @rnv/cli, @rnv/config-templates, @rnv/core, @rnv/engine-core, @rnv/sdk
-telemetry, @rnv/sdk-utils, @rnv/template-starter
info: Linking packages...
error: ⨯  Error: EPERM: operation not permitted, symlink 'C:\Users\dev\Desktop\renative\packages\adapter' -> 'C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\adapter'
    at Object.symlinkSync (node:fs:1814:3)
    at fsSymlinkSync (C:\Users\dev\Desktop\renative\packages\core\src\system\fs.ts:59:8)
    at _linkPackage (C:\Users\dev\Desktop\renative\packages\engine-core\src\tasks\linking\taskLink.ts:36:22)
    at C:\Users\dev\Desktop\renative\packages\engine-core\src\tasks\linking\taskLink.ts:84:13
    at Array.forEach (<anonymous>)
    at C:\Users\dev\Desktop\renative\packages\engine-core\src\tasks\linking\taskLink.ts:83:34
    at step (C:\Users\dev\Desktop\renative\node_modules\tslib\tslib.js:195:27)
    at Object.next (C:\Users\dev\Desktop\renative\node_modules\tslib\tslib.js:176:57)
    at fulfilled (C:\Users\dev\Desktop\renative\node_modules\tslib\tslib.js:166:62)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

┌─────────────────────────────────────────────────────────────────┐
│ ⨯ SUMMARY | 21/06/2024, 11:21:49 | rnv@1.0.0-rc.19              │
│ $ rnv link                                                      │
├─────────────────────────────────────────────────────────────────┤
│ Project: hello-renative@0.1.0                                   │
│ Workspace: rnv                                                  │
│ Engine: @rnv/engine-core                                        │
│ Build Scheme (-s): debug                                        │
│ Env Info: win32 | x64 | node v18.19.0                           │
│ Executed Time: 0h:0m:1s:538ms                                   │
│ error: ⨯  Error: EPERM: operation not permitted, symlink 'C:\Users\dev\Desktop\renative\packages\adapter' -> 'C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\adapter'
    at Object.symlinkSync (node:fs:1814:3)
    at fsSymlinkSync (C:\Users\dev\Desktop\renative\packages\core\src\system\fs.ts:59:8)
    at _linkPackage (C:\Users\dev\Desktop\renative\packages\engine-core\src\tasks\linking\taskLink.ts:36:22)
    at C:\Users\dev\Desktop\renative\packages\engine-core\src\tasks\linking\taskLink.ts:84:13
    at Array.forEach (<anonymous>)
    at C:\Users\dev\Desktop\renative\packages\engine-core\src\tasks\linking\taskLink.ts:83:34
    at step (C:\Users\dev\Desktop\renative\node_modules\tslib\tslib.js:195:27)
    at Object.next (C:\Users\dev\Desktop\renative\node_modules\tslib\tslib.js:176:57)
    at fulfilled (C:\Users\dev\Desktop\renative\node_modules\tslib\tslib.js:166:62)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

└─────────────────────────────────────────────────────────────────┘
(node:424) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead
(Use `node --trace-deprecation ...` to show where the warning was created)

C:\Users\dev\Desktop\hello-renative>

@RicardasN
Copy link
Collaborator Author

RicardasN commented Jun 21, 2024

C:\Users\dev\Desktop\hello-renative>rnv link

┌─────────────────────────────────────────────────────────────────┐
│ ██████╗ ███████╗███╗   ██╗ █████╗ ████████╗██╗██╗   ██╗███████╗ │
│ ██╔══██╗██╔════╝████╗  ██║██╔══██╗╚══██╔══╝██║██║   ██║██╔════╝ │
│ ██████╔╝█████╗  ██╔██╗ ██║███████║   ██║   ██║██║   ██║█████╗   │
│ ██╔══██╗██╔══╝  ██║╚██╗██║██╔══██║   ██║   ██║╚██╗ ██╔╝██╔══╝   │
│ ██║  ██║███████╗██║ ╚████║██║  ██║   ██║   ██║ ╚████╔╝ ███████╗ │
│ ╚═╝  ╚═╝╚══════╝╚═╝  ╚═══╝╚═╝  ╚═╝   ╚═╝   ╚═╝  ╚═══╝  ╚══════╝ │
│ RNV v:1.0.0-rc.19 | renative.org | 21/06/2024, 11:21:47         │
│ $ rnv link                                                      │
└─────────────────────────────────────────────────────────────────┘
info: Current engine: @rnv/engine-core (C:\Users\dev\Desktop\renative\packages\engine-core\lib)
task: ○ link ↺1
info: Found following source packages:

C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\adapter (unlinked)
C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\cli (unlinked)
C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\config-templates (unlinked)
C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\core (unlinked)
C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\engine-core (unlinked)
C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\sdk-telemetry (unlinked)
C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\sdk-utils (unlinked)
C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\template-starter (unlinked)

? Found following packages to link? @rnv/adapter, @rnv/cli, @rnv/config-templates, @rnv/core, @rnv/engine-core, @rnv/sdk
-telemetry, @rnv/sdk-utils, @rnv/template-starter
info: Linking packages...
error: ⨯  Error: EPERM: operation not permitted, symlink 'C:\Users\dev\Desktop\renative\packages\adapter' -> 'C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\adapter'
    at Object.symlinkSync (node:fs:1814:3)
    at fsSymlinkSync (C:\Users\dev\Desktop\renative\packages\core\src\system\fs.ts:59:8)
    at _linkPackage (C:\Users\dev\Desktop\renative\packages\engine-core\src\tasks\linking\taskLink.ts:36:22)
    at C:\Users\dev\Desktop\renative\packages\engine-core\src\tasks\linking\taskLink.ts:84:13
    at Array.forEach (<anonymous>)
    at C:\Users\dev\Desktop\renative\packages\engine-core\src\tasks\linking\taskLink.ts:83:34
    at step (C:\Users\dev\Desktop\renative\node_modules\tslib\tslib.js:195:27)
    at Object.next (C:\Users\dev\Desktop\renative\node_modules\tslib\tslib.js:176:57)
    at fulfilled (C:\Users\dev\Desktop\renative\node_modules\tslib\tslib.js:166:62)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

┌─────────────────────────────────────────────────────────────────┐
│ ⨯ SUMMARY | 21/06/2024, 11:21:49 | rnv@1.0.0-rc.19              │
│ $ rnv link                                                      │
├─────────────────────────────────────────────────────────────────┤
│ Project: hello-renative@0.1.0                                   │
│ Workspace: rnv                                                  │
│ Engine: @rnv/engine-core                                        │
│ Build Scheme (-s): debug                                        │
│ Env Info: win32 | x64 | node v18.19.0                           │
│ Executed Time: 0h:0m:1s:538ms                                   │
│ error: ⨯  Error: EPERM: operation not permitted, symlink 'C:\Users\dev\Desktop\renative\packages\adapter' -> 'C:\Users\dev\Desktop\hello-renative\node_modules\@rnv\adapter'
    at Object.symlinkSync (node:fs:1814:3)
    at fsSymlinkSync (C:\Users\dev\Desktop\renative\packages\core\src\system\fs.ts:59:8)
    at _linkPackage (C:\Users\dev\Desktop\renative\packages\engine-core\src\tasks\linking\taskLink.ts:36:22)
    at C:\Users\dev\Desktop\renative\packages\engine-core\src\tasks\linking\taskLink.ts:84:13
    at Array.forEach (<anonymous>)
    at C:\Users\dev\Desktop\renative\packages\engine-core\src\tasks\linking\taskLink.ts:83:34
    at step (C:\Users\dev\Desktop\renative\node_modules\tslib\tslib.js:195:27)
    at Object.next (C:\Users\dev\Desktop\renative\node_modules\tslib\tslib.js:176:57)
    at fulfilled (C:\Users\dev\Desktop\renative\node_modules\tslib\tslib.js:166:62)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

└─────────────────────────────────────────────────────────────────┘
(node:424) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead
(Use `node --trace-deprecation ...` to show where the warning was created)

C:\Users\dev\Desktop\hello-renative>

Cleaned everything and cannot reproduce the error, am I doing anything wrong? I am testing on Windows 10 22H PC.
https://drive.google.com/file/d/1Yo4znrb1niCKpOEGnqOuulVNktjvJvdR/view?usp=drive_link

@GabrieleKaceviciute
Copy link
Collaborator

@RicardasN steps seems the same ->

C:\Users\dev\Desktop>rnv new

┌─────────────────────────────────────────────────────────────────┐
│ ██████╗ ███████╗███╗   ██╗ █████╗ ████████╗██╗██╗   ██╗███████╗ │
│ ██╔══██╗██╔════╝████╗  ██║██╔══██╗╚══██╔══╝██║██║   ██║██╔════╝ │
│ ██████╔╝█████╗  ██╔██╗ ██║███████║   ██║   ██║██║   ██║█████╗   │
│ ██╔══██╗██╔══╝  ██║╚██╗██║██╔══██║   ██║   ██║╚██╗ ██╔╝██╔══╝   │
│ ██║  ██║███████╗██║ ╚████║██║  ██║   ██║   ██║ ╚████╔╝ ███████╗ │
│ ╚═╝  ╚═╝╚══════╝╚═╝  ╚═══╝╚═╝  ╚═╝   ╚═╝   ╚═╝  ╚═══╝  ╚══════╝ │
│ RNV v:1.0.0-rc.19 | renative.org | 21/06/2024, 11:20:57         │
│ $ rnv new                                                       │
└─────────────────────────────────────────────────────────────────┘
info: Current engine: @rnv/engine-core (C:\Users\dev\Desktop\renative\packages\engine-core\lib)
task: ○ new ↺1
? What's your project Name? (folder will be created) hello-renative
? What workspace to use? rnv
? What template to use? @rnv/template-starter (local) - \Users\dev\Desktop\renative\packages\template-starter
info: Found local template: @rnv/template-starter@1.0.0-rc.19
√ Executing: yarn
√ Executing: yarn add @rnv/config-templates@1.0.0-rc.19 --dev
? How to create config renative.json? Extend template (cleaner, overridable)
? What's your project Title? My Renative App
? What's your App ID? com.mycompany.hellorenative
? What's your project version? 0.1.0
? What platforms would you like to use? web, ios, android
? Do you want to set-up git in your new project? Yes
info: Your project does not have a git repo. Creating one...DONE
√ Executing: git init
info: Missing directory C:\Users\dev\Desktop\hello-renative\buildHooks.js. COPYING from TEMPLATE...DONE
info: Missing directory C:\Users\dev\Desktop\hello-renative\src\app.js. COPYING from TEMPLATE...DONE
info: Missing directory C:\Users\dev\Desktop\hello-renative\src\entry.js. COPYING from TEMPLATE...DONE
info: Missing file C:\Users\dev\Desktop\hello-renative\src\config.tsx.js. COPYING from TEMPLATE...DONE
info: Missing file C:\Users\dev\Desktop\hello-renative\index.js.js. COPYING from TEMPLATE...DONE
info: Missing file C:\Users\dev\Desktop\hello-renative\tsconfig.json.js. COPYING from TEMPLATE...DONE
info: Missing file C:\Users\dev\Desktop\hello-renative\babel.config.js.js. COPYING from TEMPLATE...DONE
info: Missing directory C:\Users\dev\Desktop\hello-renative\typings.js. COPYING from TEMPLATE...DONE
info: Missing file C:\Users\dev\Desktop\hello-renative\.gitignore.js. COPYING from TEMPLATE...DONE
info: Missing directory C:\Users\dev\Desktop\hello-renative\appConfigs\app.js. COPYING from TEMPLATE...DONE
info: Missing directory C:\Users\dev\Desktop\hello-renative\appConfigs\base\assets.js. COPYING from TEMPLATE...DONE
info: Missing directory C:\Users\dev\Desktop\hello-renative\appConfigs\base\fonts.js. COPYING from TEMPLATE...DONE
info: Missing file C:\Users\dev\Desktop\hello-renative\Gemfile.js. COPYING from TEMPLATE...DONE
info: Missing file C:\Users\dev\Desktop\hello-renative\metro.config.js.js. COPYING from TEMPLATE...DONE
info: Missing file C:\Users\dev\Desktop\hello-renative\react-native.config.js.js. COPYING from TEMPLATE...DONE
info: Missing file C:\Users\dev\Desktop\hello-renative\next.config.js.js. COPYING from TEMPLATE...DONE
info: Missing file C:\Users\dev\Desktop\hello-renative\next-env.d.ts.js. COPYING from TEMPLATE...DONE
info: Missing directory C:\Users\dev\Desktop\hello-renative\src\pages.js. COPYING from TEMPLATE...DONE
info: .rnv/schemas folder missing. CREATING...DONE
info: Updating appConfig app with title: My Renative App and id: com.mycompany.hellorenative
? Project is ready. Do you want to install all dependencies now? Yes
√ Executing: yarn
task: ✔ new
┌─────────────────────────────────────────────────────────────────┐
│ ✔ SUMMARY | 21/06/2024, 11:21:36 | rnv@1.0.0-rc.19              │
│ $ rnv new                                                       │
├─────────────────────────────────────────────────────────────────┤
│ Project: hello-renative@0.1.0                                   │
│ Workspace: rnv                                                  │
│ Engine: @rnv/engine-core                                        │
│ Template: @rnv/template-starter                                 │
│ Build Scheme (-s): debug                                        │
│ Env Info: win32 | x64 | node v18.19.0                           │
│ Executed Time: 0h:0m:38s:550ms                                  │
│
  Generated Project Summary:
  -------------------------
  Project Name (--projectName): hello-renative
  Package name: hello-renative
  Project Version (--appVersion): 0.1.0
  Workspace (--workspace): rnv
  App Title (--title): My Renative App
  App ID (--id): com.mycompany.hellorenative
  Project Template (--template): \Users\dev\Desktop\renative\packages\template-starter
  Git Enabled (--gitEnabled): true
  Enabled Platforms: web, ios, android
  -------------------------
  ✔ Your project is ready! Run it with:

  cd hello-renative
  npx rnv run
└─────────────────────────────────────────────────────────────────┘

C:\Users\dev\Desktop>cd hello-renative
C:\Users\dev\Desktop\renative>git status
On branch fix/windows-link
Your branch is up to date with 'origin/fix/windows-link'.

@pauliusguzas
Copy link
Collaborator

On my personal win pc works, minion same result as @GabrieleKaceviciute

packages/core/src/system/fs.ts Outdated Show resolved Hide resolved
@RicardasN RicardasN requested a review from Marius456 June 28, 2024 11:45
@Marius456 Marius456 added e2e and removed e2e labels Jun 28, 2024
@pavjacko pavjacko merged commit d4822c5 into release/1.0 Jul 1, 2024
11 of 21 checks passed
@pavjacko pavjacko deleted the fix/windows-link branch July 1, 2024 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants