Project

General

Profile

Support #6087

Fcl expansion doesn't handle absolute path includes.

Added by Herbert Greenlee over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
User Code
Target version:
-
Start date:
04/30/2014
Due date:
% Done:

100%

Estimated time:
Spent time:
Scope:
Internal
Experiment:
MicroBooNE
SSI Package:
Duration:

Description

Normally fcl expansion expects to find #included fcl files on $FHICL_FILE_PATH. It should also be possible to #include files using an absolute path, beginning with "/" or "." (like c preprocessor). Absolute path #include's don't work currently. Some might say this is a feature, but I say it is a bug. There are clearly use cases where you want to #include files not on $FHICL_FILE_PATH.

$ ART_DEBUG_CONFIG=1;lar -c subrun_wrapper.fcl
Failed to parse the configuration file 'subrun_wrapper.fcl' with exception
---- search_path BEGIN
  Can't find file "./wrapper.fcl" 
---- search_path END

Art has completed and will exit with status 7002.
$ ls -l wrapper.fcl 
-rw-r--r-- 1 greenlee microboone 413 Apr 30 16:45 wrapper.fcl
$ cat subrun_wrapper.fcl
#include "./wrapper.fcl" 

source.firstSubRun: 3

Above example also fails if normalized path beginning with "/" is used.


Related issues

Has duplicate art - Bug #6094: Fcl expansion doesn't handle absolute path includes.Rejected05/01/2014

History

#1 Updated by Lynn Garren over 6 years ago

Herb, would you clarify which release of larsoft (and by extension the art release) you are using?

#2 Updated by Christopher Green over 6 years ago

  • Description updated (diff)

This is neither a bug nor a feature: it is a requirement as specified by the stakeholders whose input was used to create art. We can discuss this at the stakeholders meeting, but the motivation was to prevent non-portable configurations from being checked in and/or being used in production.

As it happens, all you need to do is build your own lar-like exec that uses a different look-up policy in its artapp equivalent. See art:art/Framework/Art/art.cc.in and art:art/Framework/Art/artapp.cc.in. For examples of policies, see art:art/Utilities/FirstAbsoluteOrLookupWithDotPolicy.h, artdaq:artdaq/Utilities/SimpleLookupPolicy.h, and cetlib/cetlib/filepath_maker.h.

However, I strongly advise against allowing this modified exec in a production setting, or even making it generally available: experience with data file specifications on NOvA (different, but close enough for this comparison) suggest that you will start to see checked-in FHiCL files very quickly which will prevent use of your software in other environments than the one required by the absolute PATH. Seriously, you'd be buying yourself more problems than you're solving. We recommend using a suitable base path to FHICL_FILE_PATH and use a relative path instead.

#3 Updated by Lynn Garren over 6 years ago

  • Status changed from New to Closed

#4 Updated by Lynn Garren over 6 years ago

  • Project changed from LArSoft to art

#5 Updated by Christopher Green over 6 years ago

  • Tracker changed from Bug to Support
  • Category set to User Code
  • Status changed from Closed to Resolved
  • Assignee set to Christopher Green
  • % Done changed from 0 to 100
  • Scope set to Internal
  • Experiment MicroBooNE added
  • Experiment deleted (-)

#6 Updated by Christopher Green over 6 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF