MCPcopy Create free account
hub / github.com/celer-pkg/celer / buildMeta

Method buildMeta

configs/port_pkgcache.go:82–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80}
81
82func (p Port) buildMeta() (string, error) {
83 // Try find prebuilt meta from cache first.
84 key := fmt.Sprintf("%s|%t", p.NameVersion(), p.DevDep || p.HostDep)
85 if v, ok := buildMetaCache.Load(key); ok {
86 r := v.(metaResult)
87 return r.meta, r.err
88 }
89
90 // Computer meta and save into cache.
91 platformName := expr.If(p.DevDep || p.HostDep, p.ctx.Platform().GetHostName(), p.ctx.Platform().GetName())
92 port := pkgcache.Port{
93 NameVersion: p.NameVersion(),
94 Platform: platformName,
95 Project: p.ctx.Project().GetName(),
96 DevDep: p.DevDep,
97 HostDev: p.HostDep,
98 BuildConfig: p.toPkgCacheBuildConfig(p.MatchedConfig, p.portFile),
99 Callbacks: p,
100 }
101
102 // Don't cache ErrRepoNotExit — the repo may be cloned later in the same run.
103 result, err := port.BuildMeta()
104 if err == nil || !errors.Is(err, errors.ErrRepoNotExit) {
105 buildMetaCache.Store(key, metaResult{meta: result, err: err})
106 }
107 return result, err
108}
109
110func (c Port) GenPlatformTomlString() (string, error) {
111 if c.DevDep || c.HostDep {

Callers 4

InstallFromPackageMethod · 0.95
doInstallFromSourceMethod · 0.95
InstalledMethod · 0.95
buildhashMethod · 0.95

Calls 11

NameVersionMethod · 0.95
toPkgCacheBuildConfigMethod · 0.95
BuildMetaMethod · 0.95
IfFunction · 0.92
IsFunction · 0.92
SprintfMethod · 0.80
GetHostNameMethod · 0.65
PlatformMethod · 0.65
GetNameMethod · 0.65
ProjectMethod · 0.65
StoreMethod · 0.65

Tested by

no test coverage detected