{"record":{"id":"7b963f00bf0d1b15","repo":"jordansissel/fpm","slug":"a-source-directory-cannot-be-the-root-of-your-temp","errorCode":null,"errorMessage":"A source directory cannot be the root of your temporary directory (#{::Dir.tmpdir}). fpm uses the temporary directory to stage files during packaging, so this setting would have caused fpm to loop creating staging directories and copying them into your package! Oops! If you are confused, maybe you could check your TMPDIR, TMP, or TEMP environment variables?","messagePattern":"A source directory cannot be the root of your temporary directory \\(#(.+?)\\)\\. fpm uses the temporary directory to stage files during packaging, so this setting would have caused fpm to loop creating staging directories and copying them into your package! Oops! If you are confused, maybe you could check your TMPDIR, TMP, or TEMP environment variables\\?","errorType":"exception","errorClass":"FPM::InvalidPackageConfiguration","httpStatus":null,"severity":"error","filePath":"lib/fpm/package/dir.rb","lineNumber":128,"sourceCode":"  # Copy a file or directory to a destination\n  #\n  # This is special because it respects the full path of the source.\n  # Aditionally, hardlinks will be used instead of copies.\n  #\n  # Example:\n  #\n  #     clone(\"/tmp/hello/world\", \"/tmp/example\")\n  #\n  # The above will copy, recursively, /tmp/hello/world into\n  # /tmp/example/hello/world\n  def clone(source, destination)\n    logger.debug(\"Cloning path\", :source => source, :destination => destination)\n    # Edge case check; abort if the temporary directory is the source.\n    # If the temporary dir is the same path as the source, it causes\n    # fpm to recursively (and forever) copy the staging directory by\n    # accident (#542).\n    if File.expand_path(source) == File.expand_path(::Dir.tmpdir)\n      raise FPM::InvalidPackageConfiguration,\n        \"A source directory cannot be the root of your temporary \" \\\n        \"directory (#{::Dir.tmpdir}). fpm uses the temporary directory \" \\\n        \"to stage files during packaging, so this setting would have \" \\\n        \"caused fpm to loop creating staging directories and copying \" \\\n        \"them into your package! Oops! If you are confused, maybe you could \" \\\n        \"check your TMPDIR, TMP, or TEMP environment variables?\"\n    end\n\n    # For single file copies, permit file destinations\n    fileinfo = File.lstat(source)\n    destination_is_directory = File.directory?(destination)\n    if fileinfo.file? && !destination_is_directory\n      if destination[-1,1] == \"/\"\n        copy(source, File.join(destination, source))\n      else\n        copy(source, destination)\n      end\n    elsif fileinfo.symlink?","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/package/dir.rb#L110-L146","documentation":"Error \"A source directory cannot be the root of your temporary directory (#{::Dir.tmpdir}). fpm uses the temporary directory to stage files during packaging, so this setting would have caused fpm to loop creating staging directories and copying them into your package! Oops! If you are confused, maybe you could check your TMPDIR, TMP, or TEMP environment variables?\" thrown in jordansissel/fpm.","triggerScenarios":"Thrown at lib/fpm/package/dir.rb:128 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b6d77ba72a560b687723376a0e5115c3a92634ad","analyzedAt":"2026-08-21T16:39:02.570Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}