matthiasblaesing commented on issue #8781:
URL: https://github.com/apache/netbeans/issues/8781#issuecomment-5897478939

   Steps to reproduce locally:
   
   ```shell
   cd c:\temp
   mkdir comp-test
   mkdir comp-test\lib
   mkdir comp-test\consumer
   cd comp-test\lib
   composer init
   ```
   
   Package name: demo/lib
   Everything else empty/default
   
   ```shell
   cd ..
   cd consumer
   composer init
   ```
   
   Package name: consumer
   Everything else empty/default
   
   Update composer.json in `consumer`:
   
   ```json
   {
     // ...
     "repositories": [{
       "type": "path",
       "url": "../lib"
     }],
     "require": {
        "demo/lib": "dev-main"
     }
     // ...
   }
   ```
   
   run "composer install" in consumer 
   
   The problem ist most probably caused by this:
   
   ```
   jshell> new 
File("C:/Temp/comp-test/consumer/vendor/demo/lib/composer.json").getAbsolutePath();
   $2 ==> "C:\\Temp\\comp-test\\consumer\\vendor\\demo\\lib\\composer.json"
   
   jshell> new 
File("C:/Temp/comp-test/consumer/vendor/demo/lib/composer.json").getCanonicalPath();
   $3 ==> "C:\\Temp\\comp-test\\lib\\composer.json"
   ```
   
   On linux the problem is not observed as there the file normalization uses 
`getAbsolutePath`, while the windows implementation uses `getCanonicalPath`. 
`getCanonicalPath` normalizes the path and resolves the junction composer uses 
to reference the local directory.
   
   The file upload checks that files uploaded are "below" the project 
directory, which is true based on comparison of the normalized paths. We might 
need to do a tree search of the project directory to locate symlinks/junctions 
in it and record the "secondary" roots.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to