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

WIP autoproj versioning functionality #28

Merged
merged 61 commits into from
Mar 3, 2015
Merged

WIP autoproj versioning functionality #28

merged 61 commits into from
Mar 3, 2015

Conversation

doudou
Copy link
Member

@doudou doudou commented Nov 27, 2014

IMPORTANT: this requires the misc_cleanup branch of autobuild to be present. I'm trying to get it reviewed and merged bit-by-bit ...

This pull request implements the support in autoproj for versioning, that is the ability to replicate an installation 1:1 without having to fear for changing software or package sets.

The following subcommands are planned:

  • creation of autoproj/overrides.d in which versioning files are saved
  • autoproj versions: generates a version file in which all packages are "pinned"
  • autoproj commit: generates a version file within the current autoproj configuration and commit it (assumes that autoproj/ is under git)
  • autoproj tag: generates a version file, and creates a commit+tag in the current autoproj/ git repository but leaves autoproj/ unchanged
  • auto-log: saves a log of all the updates done to the installation
  • autoproj log: displays the log
  • autoproj reset: resets the install to a known state from the log

@doudou
Copy link
Member Author

doudou commented Dec 1, 2014

NOTE: you'll need to apply the misc_cleanup branch on your autobuild checkout

@doudou
Copy link
Member Author

doudou commented Dec 22, 2014

While there probably are bugs, the state of the code as-is seem fine to me and I have not experienced any problem in the day-to-day operations (provided the latest commit is applied ... which fixes usage of overrides.yml). I'd like to merge this in master. @jakobs: what do you think ?

@jakobs
Copy link
Member

jakobs commented Jan 5, 2015

I don't have a problem in general with working on master. However, I am currently a bit confused to the state of the branches. There are a lot of different branches for e.g. autobuild. Which one is the right one to use here? Also, it would be nice to discuss and describe the functionality of the new commands in a wiki.

@doudou
Copy link
Member Author

doudou commented Jan 5, 2015

Yeah ... Right. Fair enough.

So, this currently requires rock-core/autobuild#14.

As for the wiki, just created this https://rock.opendfki.de/wiki/WikiStart/OngoingWork/RockFlavorsOrReleases. I thought I published it on the rock-dev ML but it seems that I did not. I'm going to send an email there.

@doudou
Copy link
Member Author

doudou commented Jan 6, 2015

and rebased on current master

@jakobs
Copy link
Member

jakobs commented Jan 9, 2015

autoproj commit does not work with bash and sh:
the autoproj commit script requires the acd shell function. However, its not exported in bash, and it seems it cannot be imported for sh.

@jakobs
Copy link
Member

jakobs commented Jan 9, 2015

I also had another bug related to the cachinfo. Created a pull request for that (#33)

@doudou
Copy link
Member Author

doudou commented Jan 14, 2015

autoproj commit does not work with bash and sh

That acd is not available on bash and sh would be a bug in itself. I have some bash machines here where it works, though, so I don't know what happens.

In any case, autoproj commit should definitely NOT depend on acd being present.

@doudou
Copy link
Member Author

doudou commented Feb 5, 2015

I've rebased the branch on the new master (I've merged some smaller PRs that were sitting around for a month or so). I had also to rebase the improve_handling_of_detached_head branch on autobuild. These two branches are all that we need now

jakobs and others added 18 commits March 3, 2015 10:34
expand_path does not like given nil, which leads to an error before the
actual error message can be displayed.
this is to reflect that an autoproj command does not necessarily
need to be a build command.
before, the snapshot functionality was used, but this is often too much,
just to recover the version of the package. Changed the snapshot to use
the version method.
similar to snapshot, this will return a list of packages and their
respective version information. Unlike snapshot it does not actually
snapshot any files.
The files need to be placed in an overrides folder. This only applies to
the LocalPackageSet. The old overrides.yml is still used at the end
of the overrides chain.
still not what it should be. missing is handling of package sets.
Given that the most common operation is to merge two full snapshots,
it makes sense IMO
In addition, the dir is renamed to overrides.d to match the current
pattern on Linux tooling (sudoers.d, system.d, ...)
This commit separates the version generation from the package sets
from the one from packages (as most probably users will want to control
this). Moreover, it separates the work previously done by #commit into
the version generation (snapshot_*) and saving the new versions
(#versions)

The renaming of #versions into #snapshot_* is by consistency with
the Autobuild::Package API in which the method is called snapshot.
The separation between 'version_control' and 'overrides' was
done in autoproj-snapshot because it was overwriting the overrides.yml
file. Since we don't have such problem with the files in overrides.d/,
we only need to define overrides (which greatly simplifies things).

In addition, it is now assumed that the files in overrides.d only
contains overrides information, and remove the toplevel hash. The
'overrides' field in autoproj/overrides.yml is still parsed as-is.

snapshot_package_sets now uses the package set's importer repository ID
(e.g. github:rock-core/package_set) as name.
…ge_sets identical

Package set snapshotting was until now adding the whole VCS definition
while the package snapshot was only adding the pinning information.
Make snapshot_package_set have the same behaviour than snapshot_packages
Sylvain Joyeux and others added 26 commits March 3, 2015 10:34
This is to make clear what they actually are. The repository ID
by itself is confusing
This is to ensure that it properly overrides all version info set
in the package sets (and thus ensure that the commit is available)
This ensures that we can easily compare two versions files from
different point in time.
in case ruby version is less than 2.1.0, the cachinfo parameters have to
presented as individual arguments. Passing the array directly resulted
in a bad syntax for the git command line.
acd is a shell function, which might not be present. Since we
only need to go to the installation root, using autoproj locate
directly is good enough
The user would be shown the raw error before. He now gets a more
descriptive message as well as in which file the error is.
Ruby 1.9's YAML engine saves non-UTF8 strings as !binary and then
uuencodes them (as yaml requires utf8). 2.0+ seems to be nicer and
checks if the string is a valid utf8 string before doing that.

Encode all snapshot strings to utf8 before feeding them to YAML.
pkg here is just a string
This tests for exclusion even before we import the package,
as the autobuild code might already contain relevant information
(e.g. build tool, package type, ...)
doudou added a commit that referenced this pull request Mar 3, 2015
WIP autoproj versioning functionality
@doudou doudou merged commit 2372e18 into master Mar 3, 2015
@doudou doudou deleted the versioning branch March 3, 2015 13:35
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