Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor cache #24

Closed
wants to merge 2 commits into from
Closed

Conversation

GZGavinZhao
Copy link
Member

@GZGavinZhao GZGavinZhao commented Aug 26, 2022

Related to #23.

  • Refactor caching
  • Clean the top-level build cache directory instead of individual cache directories

Before we have to manually hard code cache directories. Now, future
developers can simply define another `Cache` struct in
`builder/cache.go` to add another cache.

Signed-off-by: Gavin Zhao <[email protected]>
@joebonrichie
Copy link
Contributor

This looks good to be. Only thing is the solbuild delete-cache -a will need to know about the legacy directories.

// LegacySccacheDirectory is the root owned ccache directory for pspec.xml
LegacySccacheDirectory = "/var/lib/solbuild/sccache/legacy"
// CacheDirectory is where we store build cache for all packages.
CacheDirectory = "/var/lib/solbuild/cache"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

	// Obsolete cache directories. These are only still specified so that the
	// `delete-cache -a` subcommand will remove them. In the future they will
	// be removed.
	ObsoleteCcacheDirectory = "/var/lib/solbuild/ccache/ypkg"
	ObsoleteLegacyCcacheDirectory = "/var/lib/solbuild/ccache/legacy"
	ObsoleteSccacheDirectory = "/var/lib/solbuild/sccache/ypkg"
	ObsoleteLegacySccacheDirectory = "/var/lib/solbuild/sccache/legacy"

builder.PackageCacheDirectory,
source.SourceDir,
builder.CacheDirectory,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

			builder.ObsoleteCcacheDirectory,
			builder.ObsoleteLegacyCcacheDirectory,
			builder.ObsoleteSccacheDirectory,
			builder.ObsoleteLegacySccacheDirectory,

@joebonrichie
Copy link
Contributor

I also think it's safe to remove ccache/sccache support from legacy xml builds. In Solus we only have 4 pkgs that are using the old format and none of them really need ccache/sccache support.

@GZGavinZhao
Copy link
Member Author

GZGavinZhao commented Aug 25, 2023

Superseded by #36.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants