(nameVersion string, native bool)
| 260 | } |
| 261 | |
| 262 | func (p Port) GetBuildConfig(nameVersion string, native bool) (*pkgcache.BuildConfig, error) { |
| 263 | key := fmt.Sprintf("%s|%t", nameVersion, native) |
| 264 | if v, ok := buildConfigCache.Load(key); ok { |
| 265 | return v.(*pkgcache.BuildConfig), nil |
| 266 | } |
| 267 | |
| 268 | var port = Port{DevDep: native, HostDep: native} |
| 269 | if err := port.Init(p.ctx, nameVersion); err != nil { |
| 270 | return nil, err |
| 271 | } |
| 272 | |
| 273 | config := p.toPkgCacheBuildConfig(port.MatchedConfig, port.portFile) |
| 274 | buildConfigCache.Store(key, &config) |
| 275 | return &config, nil |
| 276 | } |
| 277 | |
| 278 | // CheckHostSupported Host supported means that the port can be built natively. |
| 279 | func (p Port) CheckHostSupported(nameVersion string) bool { |
no test coverage detected