This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 199115 - Working directory cannot be changed for remote builds
Summary: Working directory cannot be changed for remote builds
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Remote (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-02 16:34 UTC by tmikov
Modified: 2011-07-06 14:12 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
my sample project; I wasn't able to reproduce the probelm with it (30.00 KB, application/x-tar)
2011-06-04 17:29 UTC, Vladimir Kvashin
Details
Updated sample project (20.00 KB, application/x-tar)
2011-06-04 21:37 UTC, tmikov
Details
Second ppdated sample showing the problem (1.69 KB, application/x-compressed-tar)
2011-06-05 00:50 UTC, tmikov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tmikov 2011-06-02 16:34:24 UTC
Hi,
After an upgrade to Netbeans 7.0 remote build doesn't work anymore if  buildCommandWorkingDir is not empty. If it is anything at all (for example ".."), it just changes to the remote home directory and the build naturally fails.

I tried setting absolute paths but the result is the same.

In local builds it still works fine.

As far as I can tell this is a regression from 6.9.1 where it worked perfectly.
Comment 1 Vladimir Kvashin 2011-06-04 17:28:53 UTC
I wasn't able to reproduce this so far.

I tried creating a project that needs a custom build directory, for me it builds both locally and remotely, in both 7.0 and current dev. version (see my test project in the attachment; make should be launched in "./src" subdirectory).

Please describe the structure of your project, this will hopefully help me to reproduce the situation. (If it was possible, I would even ask you to create a simple project that is similar to yours and demonstrates wrong behavior).
Comment 2 Vladimir Kvashin 2011-06-04 17:29:54 UTC
Created attachment 108725 [details]
my sample project; I wasn't able to reproduce the probelm with it
Comment 3 tmikov 2011-06-04 21:35:36 UTC
Hi, thanks for looking into this so quickly.

I experimented the sample project and finally managed to reproduce the problem with it. I think it happens only when the build working directory is outside of the project directory. 

Specifically, in your sample project I added a file "build.sh" to "wd-mkf/..". Its contents are:
#!/bin/sh
set -e
cd wd-mkf/src
make -f ../mk/Makefile $*

Then changed the build working directory to ".." and the build command to "./build.sh". (I am attaching an archive with the project). The build works locally but fails remotely. Note that the remote path mapper maps the parent directory, not just the project directory, so the remote machine has access to "build.sh".

Now it appears that the scope of the problem is smaller than what I thought initially, and this may seem like a contrived case, but for whatever it is worth it used to work in 6.9. 

In our project it is necessary because we have a huge "top level" project with a common SCONS build script in the top level directory. Each NB project is a subdirectory which must invoke the parent build. The trick is that it must be invoked from within the parent directory or otherwise Netbeans doesn't like the file paths in the error messages...
Comment 4 tmikov 2011-06-04 21:37:18 UTC
Created attachment 108726 [details]
Updated sample project 

The archive is one directory deeper.
Comment 5 tmikov 2011-06-05 00:48:00 UTC
Hi,
Please ignore my previous posts. I did further tests and the problem appears to be more subtle. It also depends on the exact configuration of the path mapper.

I managed to reproduce it in your sample project by doing the following steps (again, I will attach the updated sample):

1. Extract the project to $HOME/tmp

2. Change the build command to "echo $PWD" - we dont't care about the build, we just want to know that the directory is right.

3. Change the project source path from "." to "src"

4. On the remote machine mount $HOME/tmp/wd-mkf to the host $HOME/tmp/wd-mkf

5. Configure the path mapper to map $HOME/tmp/wd-mkf/ to $HOME/tmp/wd-mkf/

6. Perform a remote build

The output of "echo $PWD" is $HOME instead of $HOME/tmp/wd-mkf
Comment 6 tmikov 2011-06-05 00:50:35 UTC
Created attachment 108728 [details]
Second ppdated sample showing the problem

It requires the path mapper to be mapping the project directory (wd-mkf). If however the path mapper is configured to map the parent directory instead of the project directory, it works.
Comment 7 Vladimir Kvashin 2011-06-05 08:46:54 UTC
Thank you very much for your investigation. Now I see. (But please note that "echo $PWD" can mislead, so I changed it with /bin/pwd).
Comment 9 Quality Engineering 2011-06-06 04:49:53 UTC
Integrated into 'releases'
Changeset: http://hg.netbeans.org/releases/rev/
User: 
Log:
Comment 10 Quality Engineering 2011-06-07 03:00:52 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/
User: 
Log:
Comment 11 Alexander Pepin 2011-07-06 14:12:40 UTC
Should be added to test scenarios.