Bug 574780 - Compare Failed: Linked resources are not supported by this application.
Summary: Compare Failed: Linked resources are not supported by this application.
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 5.13   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-10 04:38 EDT by Ed Willink CLA
Modified: 2021-07-28 05:17 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2021-07-10 04:38:26 EDT
During a Rebase on Head, the Compare Editor is activated to resolve conflicts; good.

But this now give a Compare Failed popup as below.


eclipse.buildId=4.20.0.I20210611-1600
java.version=11.0.11
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -clean -data file:/E:/Development/Chital/Workspace/

  Git integration for Eclipse	5.12.0.202106070735	org.eclipse.egit.feature.group	Eclipse EGit
    Java implementation of Git	5.12.0.202106070339-r	org.eclipse.jgit.feature.group	Eclipse JGit
    Java implementation of Git - GPG support using BouncyCastle	5.12.0.202106070339-r	org.eclipse.jgit.gpg.bc.feature.group	Eclipse JGit
    Java implementation of Git - optional Http support using Apache httpclient	5.12.0.202106070339-r	org.eclipse.jgit.http.apache.feature.group	Eclipse JGit
    Java implementation of Git - ssh support using Apache MINA sshd	5.12.0.202106070339-r	org.eclipse.jgit.ssh.apache.feature.group	Eclipse JGit


java.io.IOException: Linked resources are not supported by this application.
	at org.eclipse.egit.ui.internal.merge.GitMergeEditorInput.createHiddenResource(GitMergeEditorInput.java:769)
	at org.eclipse.egit.ui.internal.merge.GitMergeEditorInput.createWithHiddenResource(GitMergeEditorInput.java:754)
	at org.eclipse.egit.ui.internal.merge.GitMergeEditorInput.buildDiffContainer(GitMergeEditorInput.java:655)
	at org.eclipse.egit.ui.internal.merge.GitMergeEditorInput.prepareInput(GitMergeEditorInput.java:497)
	at org.eclipse.compare.CompareEditorInput.run(CompareEditorInput.java:475)
	at org.eclipse.compare.internal.CompareUIPlugin.prepareInput(CompareUIPlugin.java:594)
	at org.eclipse.compare.internal.CompareEditor$1.run(CompareEditor.java:338)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.eclipse.core.internal.resources.ResourceException: Linked resources are not supported by this application.
	at org.eclipse.core.internal.resources.Resource.assertLinkRequirements(Resource.java:170)
	at org.eclipse.core.internal.resources.Resource.createLink(Resource.java:636)
	at org.eclipse.egit.core.internal.efs.HiddenResources.linkFile(HiddenResources.java:329)
	at org.eclipse.egit.core.internal.efs.HiddenResources.createFile(HiddenResources.java:108)
	at org.eclipse.egit.ui.internal.merge.GitMergeEditorInput.createHiddenResource(GitMergeEditorInput.java:761)
	... 7 more
Comment 1 Thomas Wolf CLA 2021-07-12 11:54:32 EDT
Eclipse has too many settings :-(

Turns out there is a preference for disabling linking: General->Workspace->Linked Resources.

Of course our new "clever" way of using hidden linked resources linked to an EFS URI to handle merging better doesn't work at all if linking is disabled.

Linked resources are enabled by default AFAIK. But when disabled, we have a problem.

Until we've figured out what to do, the work around is to make sure that "Enable Linked Resources" is enabled in the Eclipse preferences.
Comment 2 Ed Willink CLA 2021-07-12 13:41:02 EDT
The workspaces on my two machines have different linked resources settings, so I must have changed one of them at some time.

When I try to enable linked resources, I get a pop-up strongly discouraging enabling them until I have read the documentation.

Over the years I have been burned many times by inadequate linked resources implementations, particularly in non-Unix contexts, but more generally because linked resources do not copy / backup consistently and over-populate work lists with duplicates, so I have a strong prejudice whenever given the choice to disable linking.

I encourage you to rethink your 'clever' linked hidden resources.
Comment 3 Eclipse Genie CLA 2021-07-19 15:10:59 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/183189
Comment 5 Ed Willink CLA 2021-07-28 05:17:59 EDT
The Gerrit comment is:

"Therefore just enable creating linked resources by force and reset the
preference afterwards unless it has been changed again in the meantime."

This seems like a very discourteous solution.

If Eclipse has a preference and the user has set it, it should remain as set by the user, not tweaked for convenience and restored later. What guarantees that a concurrent application is unaffected? What guarantees restoration if Eclipse crashes/is terminated while the setting is corrupted?