Modify

Ticket #6691 (closed Feature Requests: fixed)

Opened 2 years ago

Last modified 2 years ago

Add option to emit file dependencies to quickbook

Reported by: mgaunard Owned by: danieljames
Milestone: To Be Determined Component: quickbook
Version: Boost Development Trunk Severity: Cosmetic
Keywords: Cc:

Description

This is a feature request: add an option to emit the list of files included directly or indirectly from a qbk file (not counting xincludes).

This would make it easier to integrate Quickbook in build systems.

Attachments

Change History

comment:1 Changed 2 years ago by danieljames

  • Owner changed from djowel to danieljames
  • Status changed from new to assigned

Shouldn't be too hard. Is there any particular form that would be convenient?

comment:2 Changed 2 years ago by mgaunard

One file per line would be most convenient for my personal usage. The path to the files should be either absolute or relative to the current working directory.

comment:3 Changed 2 years ago by danieljames

(In [77442]) Quickbook: Rough stab at outputting dependencies. Refs #6691

Adds --output-deps flag. To write out dependencies to deps.txt:

quickbook --output-deps deps.txt source.qbk

If --output-deps is specified, quickbook won't generate an output file unless one is specified with --output-file. If there is an error it will return an error code, but it will still write out all the opened files.

Known issues:

  • If the same file is included/imported twice it may or may not list it twice. Should be consistent.
  • Doesn't include SVG files. It probably should as they can affect the output.
  • Need to check some of the path issues for things such as xinclude paths which depend on the output file path.
  • Needs tests and documentation.

comment:4 Changed 2 years ago by danieljames

(In [77490]) Quickbook: Track dependencies in state. Refs #6691

  • Use cananoical filenames where possible.
  • Remove duplicates.
  • Include SVG files.
  • Less hacky.

comment:5 Changed 2 years ago by danieljames

I was just writing the tests and I realised that I missed a case. If a file is added before the currently used file on the include path it will replace that file, so this really should include the location of non-existent files that would change the build. Should they be marked differently?

There are also plans to add support for loading files using globs (implemented on the quickbook-dev branch, but I've backed it out on trunk as there are problems with the implementation). If the happens then the file list will need to include globs as well, will that be a problem?

comment:6 Changed 2 years ago by danieljames

(In [77598]) Quickbook: Further dependencies development. Refs #6691

  • Include relevant locations on path where file wasn't found.
  • Improve include_search while I'm at it.
  • Normalize paths for non-existent files.
  • Tests, not integrated with Boost.Build yet. Needs to check that python is available then run the script with the location of the quickbook executable.

comment:7 Changed 2 years ago by danieljames

(In [77973]) Quickbook: Deal with checked paths that aren't present. Refs #6691.

I think that the dependencies should just be files that were loaded, so I changed it to do that, but added an extra (hidden for now) option to list all paths that were checked, staring with a + for files that are present, and - for files that are absent.

Also fixed a bug with the path resolver.

comment:8 Changed 2 years ago by danieljames

  • Status changed from assigned to closed
  • Resolution set to fixed

(In [78210]) Quickbook: Merge from trunk. Fixes #6691, #6794

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.