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

Recipe versioning #61

Open
sage-etcher opened this issue May 10, 2024 · 1 comment
Open

Recipe versioning #61

sage-etcher opened this issue May 10, 2024 · 1 comment

Comments

@sage-etcher
Copy link

sage-etcher commented May 10, 2024

I'm unsure if this should be posted under Recipes, Compile, or Scripts. if this is the wrong place for it feel free to move it or lmk.

Feature Request

Having an internal versioning system for recipes, as a way to check if the recipe you used has had any changes since you compiled the program.

Potentially through logging the recipe's source and commit to a Resources file.

Issue

Say I install Bash 5.1 from Recipe, and then a few days later an issue is found+fixed in the recipe. Currently I'd have no way of knowing (w/o manual checking of dates) if I used the version before or after the Recipe's change.

This issue is found first hand with the installed version of Bzip2 1.0.8 provided in Gobo017, having used an outdated Recipe file, leading to some programs failing to find it's shared library.

Proposed Method

Having Compile (or an adjacent script) log some information about the Recipe, for exanple using git log [FOLDER_PATH] |head -1 > $target/Resources/RecipeCommit to get the commit.

Then be able to check it against the current version in Recipes as follows:

local name="$1"     # program name
local version="$2"  # program version

local recipesfolder="/Data/Compile/Recipes/${name}/${version}"
local installedfolder="/Programs/${name}/${version}"

local recipescommit=$(git log "${recipesfolder}" |head -1)
local installedcommit=$(cat "${installedfolder}/Resources/RecipeCommit")
if [[ "${recipescommit}" == "${installedcommit}" ]]
then
   echo "up to date"
else
   echo "out of date"
fi

Ideally, a bit more than just the commit would be logged, potentially the git repository/fork, branch, and commit; just something concrete, fast to generate, and easy to compare.

@mwh
Copy link
Member

mwh commented May 11, 2024

Recipes used to have -r1, -r2 suffixes for exactly that, but they were dropped I think in the Git migration. That does mean that the tooling likely still has full support for them and it would be possible to revive those (though it's not clear whether that's the right way to go about things still).

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

No branches or pull requests

2 participants