Small changes in Scripts, cause a ripple effect of compilation of shaders and packages

I have a prefab for the player, the player prefab contains camera and XRI controllers.
I am attempting to remove the line rendering of the right hand controller.

Even a small change in one of the script, may cause an seemingly unrelated of endless compilation time, of XRI Packages or shaders not directly related to the change.
Just ending the task with task manager, and opening the editor again “fix” the issue. The compilation does not repeat itself until a new change in this specific prefab happen.

This is the code after the change, I simply comment out the public members and the related code, and it cause a ripple effect of shader compilation and XRI package compilation.

using UnityEngine;

public class VRPointerSet : MonoBehaviour
{
// public LineRenderer lineRenderer;
// public UnityEngine.XR.Interaction.Toolkit.Interactors.Visuals.XRInteractorLineVisual lineVisual;
// Start is called before the first frame update
void Start()
{
/* if (TmpConfiguration.IsVR())
{
lineRenderer.enabled = true;
lineVisual.enabled = true;
}*/
}

}

Is the code inside a package? Or is it in your Assets folder?

If it’s in Assets, it’s probably a bug. You can open Window/Analysis/Import Activity to see why Unity thinks it needed to reimport those assets, if you toggle “Show previous imports” in the options menu it’ll show imports from other sessions.

The issue is not that it reimport it, it’s also that it takes endless time(could wait 10 hours and it won’t finish)

This is the problematic shader graph, it’s inside a package.

What can I do though?

It is used for a skybox, which is part of the camera in the Player prefab.

Why it has to reimport it for every little change to the player prefab?

The import activity window is saying that it’s depending on a bunch of things. I’m guessing that there’s some kind of stupidity here where what flags the skybox is being compiled with depends on the settings of the camera, so whenever a prefab that contains the camera changes, it thinks it has to reimport the shader graph.

I’d report it as a bug. You might try to remove the camera from the player prefab to see if that solves things.

The dependencies list there is a bunch of meta file hashes, which is silly, but you can search for the guids there to see what objects it’s referencing.