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 246881

Summary: Code assistance fails to locate header files mounted with NFS
Product: cnd Reporter: AE56
Component: Code ModelAssignee: Vladimir Voskresensky <vv159170>
Status: RESOLVED DUPLICATE    
Severity: normal CC: comaniac0422, Marc_W
Priority: P3    
Version: 8.0   
Hardware: Macintosh (x86)   
OS: Mac OS X   
See Also: https://netbeans.org/bugzilla/show_bug.cgi?id=268070
Issue Type: DEFECT Exception Reporter:
Attachments: Code Assistance/Dump C/C++ Code Model Diagnostic/Preprocessor States
patch to apply after code freeze

Description AE56 2014-09-04 18:43:47 UTC
On, OSX 10.7.5, I am attempting to build a C++ project remotely on a RedHat 6 server.  My home drive is path-mapped using NFS mounts.  Netbeans shows all the project source and header files in the project tree view, but code assistance fails, reporting those same header files as missing.  

If I re-mount the same network shares with SMB, code assistance then works correctly.
Comment 1 Alexander Simon 2014-09-15 08:25:43 UTC
As I understand you have a project located in the home directory.
You build the project on a remote host.
The remote host can access to source files by path mapping.

Please provide more details:
1. Path mapping.
2. If you open your project, does IDE reports missing headers?
3. Does IDE report missing headers after build?
4. Does IDE report missing headers after reparse project (project pop-up menu Code Assistance->Reparse Project)?
5. Provide details about missing header (navigate to broken include directive and press Ctrl+Alt).
Comment 2 AE56 2014-09-15 14:00:47 UTC
(In reply to Alexander Simon from comment #1)
> As I understand you have a project located in the home directory.
> You build the project on a remote host.
> The remote host can access to source files by path mapping.

Correct.

> 
> Please provide more details:
> 1. Path mapping.

The path on the remote machine is /home/aevers.  This is mounted via nfs on the mac at /Volumes/aevers.  Project source files are navigable and editable on the mac.

The command to mount:

sudo mount -o rw,hard,intr,rsize=8192,wsize=8192,timeo=900,retrans=3,proto=tcp  -t nfs rio:/lvm/home07/aevers /Volumes/aevers

The NFS volume rio:/lvm/home07/aevers is automounted as /home/aevers when I log in to the remote build host, which is tarzan.

> 2. If you open your project, does IDE reports missing headers?

IDE reports "Some #include/#error directives failed."  Project icon has blue question mark icon in the Projects tree.

> 3. Does IDE report missing headers after build?

Gcc does not report errors.  IDE continues to report, "Some #include/#error directives failed."

> 4. Does IDE report missing headers after reparse project (project pop-up
> menu Code Assistance->Reparse Project)?

Yes, same.  

> 5. Provide details about missing header (navigate to broken include
> directive and press Ctrl+Alt).

One example project TestServer, repoorts:

    Unresolved directive  
    #include "TestServer.h"

Then lists a bunch of directories with absolute paths on the /Volumes/aevers volume.  The directory that contains TestServer.h is in the list and is black.

TestServer.h is in the main project directory, shows up in the Project tree, and can be opened if double-clicked in the project tree.

Note that this project builds via cmake and was originally created as a Netbeans project via the "New C++ project from existing sources" dialog."
Comment 3 Alexander Simon 2014-09-15 15:36:18 UTC
Please open source file with broken include directive and attach output of Project pop-up menu Code Assistance/Dump C/C++ Code Model Diagnostic/Preprocessor States
Comment 4 AE56 2014-09-15 16:07:30 UTC
Created attachment 149228 [details]
Code Assistance/Dump C/C++ Code Model Diagnostic/Preprocessor States
Comment 5 Alexander Simon 2014-09-15 16:47:50 UTC
(In reply to AE56 from comment #4)
> Created attachment 149228 [details]
> Code Assistance/Dump C/C++ Code Model Diagnostic/Preprocessor States
Thank you, please provide text of broken include directive and #pwd and #ls of directory where included file located.
Comment 6 AE56 2014-09-15 17:03:18 UTC
(In reply to Alexander Simon from comment #5)
> (In reply to AE56 from comment #4)
> > Created attachment 149228 [details]
> > Code Assistance/Dump C/C++ Code Model Diagnostic/Preprocessor States
> Thank you, please provide text of broken include directive 

Cannot find include file "HfssServer.h"

> and #pwd 

/Volumes/aevers/repositories/hfm/projects/hfss/apps/HfssServer

> and #ls
> of directory where included file located.

CMakeLists.txt  HfssServer.cpp  HfssServer.h    Options.xml     build/          build.sh*       main.cpp        nbproject/
Comment 7 Marc_W 2015-11-10 08:18:45 UTC
I have the same issue and I have tested it with version 8.1, but it isn't solved. Are there any updates on this issue?
Comment 8 comaniac0422 2016-09-16 17:38:54 UTC
Same issue with 8.1.
Also, the relative path problem is still there and I think it is the root of this problem. When you add or new a source file from a remote directory (whatever it's a mounted directory on OS X or network directory on Windows), it always adds the file with an absolute path. The setting of "Always relative" in Tools -> Options -> C/C++ is not working. 

As a result, NetBeans cannot find the header file that mentioned in your source code such as #include "header.h", because "header.h" is a relative path. However, files in the project have the absolute file path such as "/home/aevers/header.h" (I borrow AE56's case here).

To my knowledge, this problem has existed for a couple of years (you can find this question on StackOverview and somewhere else) but no one knows how to solve it.
Comment 9 Vladimir Voskresensky 2016-09-20 11:59:54 UTC
Hello, sorry for the long delay.
It's hard to investigate the bug without system where we can reproduce the issue ourselves. May be you can help us.

We have a guess that case-sensitivity of file system can be involved here.
Could you, please, inform about case-sensitive configuration of your OS?
And what is the case-sensitivity of mounted network directories?

Could you try the following:
If you have your sources on path /Volumes/aevers/repositories
please, create on the same volument tmp directory (i.e. /Volumes/aevers/tmp).
Then start NB with extra option -J-Djava.io.tmpdir=/Volumes/aevers/tmp

If it will help, I will recommend to change your system configuration property to always use case-sensitive file systems.
Comment 10 Vladimir Voskresensky 2016-09-20 12:02:26 UTC
Created attachment 162129 [details]
patch to apply after code freeze
Comment 11 Vladimir Voskresensky 2017-04-03 16:27:18 UTC

*** This bug has been marked as a duplicate of bug 269098 ***