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

Add a vcs module, with Git and Subversion support. #33

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

tee3
Copy link
Contributor

@tee3 tee3 commented May 31, 2021

Proposed changes

See boostorg/build#135

Types of changes

See boostorg/build#135

Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Documentation content changes
  • Other (please describe):

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I searched the discussions
  • I searched the closed and open issues
  • I read the contribution guidelines
  • I added myself to the copyright attributions for significant changes
  • I checked that tests pass locally with my changes
  • I added tests that prove my fix is effective or that my feature works
  • I added necessary documentation (if appropriate)

Further comments

This stalled as it requires changes to the engine as described by @swatanabe in the original pull request. I am not sure if this is feasible or not.

tee3 added 19 commits May 31, 2021 12:51
This provides a mechanism to interact with VCS-controlled projects.  It
currently supports Git and Subversion.  The main interesting feature
here is a rule to generate a version string.  There are other rules for
querying a directory for its properties that may also prove generally
useful.

There are also rules to 'fetch' from a repository into a directory and
'checkout' a symbolic reference from a directory.  These could be used
to forcibly get a specific revision of a package from a repository.  It
could also be used to create a proper source package management system
within Boost.Build.

There are two examples to show how this module might be used.

The documentation build has not been tested.  However, a
reStructuredText document that should be identical to the BoostBook file
is included in the doc directory for reference.

There are no tests, but there are two examples that do quite a bit of
work to test the module, but do not verify the results.

This has been tested on Linux, OS X, and Windows.  The 'type' rule fails
on Windows due to `path.exists' rule failing.  This needs to be
investigated.

This does not implement these functions in Python.  It should be
straightforward to do so.
The BoostBook for the vcs module was missing several sections and had
a few glaring mistakes.
This is clearer than using the literal section in these cases.
While this is not as portable as including the code directly, this
matches the BoostBook documentation approach and makes ensuring that
the reStructredText documentation is identical to the DocBook
documentation.
This change makes it easier to see the rules provided by the vcs
module.
Some of the syntax in the SHELL commands is not compatible with VMS.
This adds a test to test the functionality of all vcs functionality.

* type
* fetch
* checkout,
* ref
* generate-version-string.

This tests all backends.

* Git
* Subversion
This change fixes the GitHub URL for the Boost.Build project.  The
previous URL was correct except that it ceased to work for Subversion
checkouts some time ago.
This change removes the assumption that the working copy has been
checked out via a supported vcs.  Using the actual location of the
example/vcs directory in the example was not very useful and made
running the example from the test harness impossible.
This change minimizes any confusion caused by unnecessary warnings.
This change ensures that stderr is not printed when an exact match, as
expected, is not found.  The stderr from git was confusing to users.
@tee3
Copy link
Contributor Author

tee3 commented May 31, 2021

@grafikrobot

  1. Do you think this would be a useful addition? I saw that there is package manager support in B2 now, but I have never figured out how to use it, nor Conan. Does this package manager support make this module obsolete?
  2. If this is still something that might be useful, have the changes to LOCATE described in the original pull request been done? Can they be?
  3. Do you have a better design for this that I could try to implement?
  4. I am by no means a B2 expert, but I have managed to build some useful modules for my purposes (interfacing to the Xilinx tools, toolsets for TI compilers, etc.). I'm sure they could all be better, but I have learned a lot in the process. I would be willing to do the work on this module to make it work within the B2 targets, etc. if there was a chance it would be useful.
  5. There is a very small subset of this vcs module that could be useful. It can generate a version string looking at the underlying vcs repository. I use this to generate versions in my professional work and it is really useful and seems to work properly in all cases. I would be willing to break that out to start if you feel it is useful.
  6. If you have a better idea on how to accomplish this or feel it is not useful, I am fine with closing the pull request

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

Successfully merging this pull request may close these issues.

None yet

2 participants