Search code examples
palantir-foundryfoundry-code-repositories

Why is Foundry Code Repo building using an older library?


My build works fine in preview mode but is failing when building and is highlighting an error in an old tag version of the shared library that I use in my code.

I have two version of the shared library Tag (2.2.0, 2.2.1) and I pinned 2.2.* as version for the run.

The build should normally work fine as in preview mode since version 2.2.1 has no error.

I believe the problem is related to a wrong, different use of versions of a library between build and preview. Why do I have this behavior?


Solution

  • By specifying 2.2.* as run version, the algorithm will try to select the most recent version of the library (using tag increment number, 2.2.1 in your case) to solve the environment. But if it appears that the most recent compatible version with all dependencies is 2.2.0, this will be used for the build.

    This may differ from the preview where the algorithm can select version 2.2.1.

    It therefore seems that in your case the algorithm has selected version 2.2.0 instead of version 2.2.1 (which has no error ) for the build.

    To check which version your build is really used, you can go to your .lock file (which lists all the versions of the packages used for the build). See screenshot below for package fields-lib for instance. enter image description here If you want to use version 2.2.1, you can force it in your meta.yml. And when you pin a specific version that is supposed to be used in the preview as well. If it is not the case an advice is to click the “refresh dependencies” text then code assist will relaunch and re-resolve the envrionment with conda (which is slow, but should respect the pin)

    So to debug this kind of issue you can :

    • Look at the Lock File to find out which version of your libraries are really used
    • Pin the version you want to use as workaround