Code Monkey home page Code Monkey logo

Comments (3)

twpayne avatar twpayne commented on July 1, 2024

This approach is not currently possible because.chezmoiexternal.toml uses paths as keys and TOML does not allow duplicate keys.

You need to make the keys unique, which you would normally do by including the version number in the path. Unfortunately, it looks like the .NET SDKs do not include the version number in the root path (e.g. it puts files in ./packs/Microsoft.NETCore.App.Ref/8.0.1/, not in ./8.0.1/packs/Microsoft.NETCore.App.Ref/). Furthermore the .NET SDKs include files in the root path (like ./ThirdPartyNotices.txt) so trying to install multiple .NET SDKs in the same directory will lead to conflicts in these files.

The .NET SDKs are also 200MB compressed and 566MB uncompressed so you should not manage them with a chezmoi external because it will make chezmoi apply very slow as it has to both unpack the archive and check that the uncompressed contents match the 566MB of files on disk every time you run chezmoi apply.

So, use a run_once_ script to install the SDKs instead. I would create one run_once_ script for each version of the .NET SDK.

from chezmoi.

halostatue avatar halostatue commented on July 1, 2024

What you want to do is not supported by externals. The definition of externals is a map where each key must be unique and does not support multiple URLs (if such were supported, it would not be clear to me whether those should be interpreted as "download and extract from all of these files" or "download and extract from one of these files; the others are mirror fallbacks").

I don't know anything about the .NET SDK, but some quick searching suggests that a .NET Core SDK is ~/.local/share/dotnet/sdk/VERSION. If the archives contain sdk/VERSION, then you should specify this as:

[".local/share/dotnet/sdk/VERSION1"]
url = "version1URL"
type = "archive"
stripComponents = 2

[".local/share/dotnet/sdk/VERSION2"]
url = "version2URL"
type = "archive"
stripComponent = 2

If the archives just contain VERSION, then stripComponents = 1.

from chezmoi.

garbetjie avatar garbetjie commented on July 1, 2024

Ah, okay. Thanks for the feedback! I suspected it wasn't possible, but I was also aware of the fact that I simply may not have found the correct way to do it.

It sounds like the run_once_ script is the way to go.

from chezmoi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.