2
votes

I have a Jenkins build server and would like to make the PDBs generated with the build available on a symbol server.

Ideally, the PDB files would be kept while the build that generated them is still archived, as there are different schedules for third-party libraries, stable releases, nightly builds etc., and we'd like to keep debug information at least for those builds we can still install.

My current line of thinking would be a job that

  1. is started whenever another job finishes

    • Can this be somehow made implicit, to avoid having to modify lots of different jobs; is it perhaps possible to trigger on files with an extension of *.pdb being archived as artifacts?
    • Can this be integrated with matrix builds so successful sub-builds trigger the archival already?
  2. imports all PDB artifacts from all jobs

    Again, is there a way to collect PDBs from all jobs without having to explicitly configure the list of jobs we want to collect from, to avoid this becoming inconsistent?

  3. finds out which ones are new

    Can this be queried from Jenkins somehow (the Changes tab lists the modified artifacts from referenced projects, is it somehow possible to skip copying an unchanged artifact, and/or get the information on which artifacts are changed into the build steps, so we can avoid needless work?

  4. submits these to the symbol server

  5. queries the symbol server for existing PDBs

  6. checks whether these are still known as artifacts from a build

    Can this be done using artifact fingerprints? Can I query Jenkins with an MD5 sum directly? Are fingerprint entries expunged from Jenkins' database, so I can find out that the build that generated the file has expired?

  7. expires these that aren't.

I'm open to alternative strategies if there is a better way to do that.

1

1 Answers

2
votes

a job that is started whenever another job finishes

I would store the PDBs as part of the original job, not in a new job. Storing PDBs should not take too long.

imports all PDB artifacts from all jobs

I don't think there is a plugin that would manage system wise PDB collection. See before: collect the PDBs immediately.

finds out which ones are new

PDBs will differ in every build, even if the source code was the same. A DLL and PDB include timestamp information.

Again: collect PDBs immediately and you'll know that they are new. No need for date checking.

Other than that, if you'd try to submit the same PDB to the symbol server again, it'd either reject it or replace it by an identical version. In both cases there's nothing to worry about.

submits these to the symbol server

Yes.

queries the symbol server for existing PDBs

This is something for a new job, e.g. a nightly cleanup build.

checks whether these are still known as artifacts from a build

Please consider that someone still works with a local copy of a nightly build that has already been deleted.

Other than that, a PDB has a timestamp and the build has a timestamp too. Maybe those differ by a few minutes, so perhaps you need to implement something yourself. debugdir may help here.

Just make sure you don't delete official releases accidentally. If you know in advance that you build an official release, you could e.g. set up an "all symbols" server and an "official symbols" server.

expires these that aren't.

Maybe. Please check if it's worth all the effort. Disk space is cheap and you probably don't need a super fast disk. Perhaps you can just keep all versions without any problems.