{"record":{"id":"1b9fda6b5ada5e19","repo":"jordansissel/fpm","slug":"using-deprecated-flag-install-location-please","errorCode":null,"errorMessage":"Using deprecated flag: --install-location. Please use --prefix instead.","messagePattern":"Using deprecated flag: --install-location\\. Please use --prefix instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/fpm/package/virtualenv.rb","lineNumber":23,"sourceCode":"require \"fpm/package/dir\"\n\n# Support for python virtualenv packages.\n#\n# This supports input, but not output.\n#\nclass FPM::Package::Virtualenv < FPM::Package\n  # Flags '--foo' will be accessable  as attributes[:virtualenv_foo]\n\n  option \"--pypi\", \"PYPI_URL\",\n  \"PyPi Server uri for retrieving packages.\",\n  :default => \"https://pypi.python.org/simple\"\n  option \"--package-name-prefix\", \"PREFIX\", \"Name to prefix the package \" \\\n  \"name with.\", :default => \"virtualenv\"\n\n  option \"--install-location\", \"DIRECTORY\", \"DEPRECATED: Use --prefix instead.\" \\\n    \"  Location to which to install the virtualenv by default.\",\n    :default => \"/usr/share/python\" do |path|\n    logger.warn(\"Using deprecated flag: --install-location. Please use \" \\\n                  \"--prefix instead.\")\n    File.expand_path(path)\n  end\n\n  option \"--fix-name\", :flag, \"Should the target package name be prefixed?\",\n  :default => true\n  option \"--other-files-dir\", \"DIRECTORY\", \"Optionally, the contents of the \" \\\n  \"specified directory may be added to the package. This is useful if the \" \\\n  \"virtualenv needs configuration files, etc.\", :default => nil\n  option \"--pypi-extra-url\", \"PYPI_EXTRA_URL\",\n    \"PyPi extra-index-url for pointing to your priviate PyPi\",\n    :multivalued => true, :attribute_name => :virtualenv_pypi_extra_index_urls,\n    :default => nil\n\n  option \"--setup-install\", :flag, \"After building virtualenv run setup.py install \"\\\n  \"useful when building a virtualenv for packages and including their requirements from \"\\\n  \"requirements.txt\"\n","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/package/virtualenv.rb#L5-L41","documentation":"The virtualenv input target's --install-location option is deprecated in favor of the generic --prefix. The handler still expands and returns the path (File.expand_path), so the old flag keeps working, but every use logs this warning. --prefix is the supported way to choose where the virtualenv is installed inside the package.","triggerScenarios":"Running `fpm -s virtualenv -t deb --install-location /opt/venvs/app ...` instead of `--prefix /opt/venvs/app`.","commonSituations":"Recipes written before --prefix was standardized across fpm targets; scripts hardcoding /usr/share/python-style default locations from older deployments.","solutions":["Replace --install-location with --prefix","Verify the resulting package contents after the swap: --prefix changes the install root, so inspect the deb/rpm file list","Remove the flag entirely if the default location is acceptable"],"exampleFix":"# before\nfpm -s virtualenv -t deb -n myapp --install-location /opt/myapp flask\n\n# after\nfpm -s virtualenv -t deb -n myapp --prefix /opt/myapp flask","handlingStrategy":"validation","validationCode":"if grep -rnE -- '--install-location([ =]|$)' build/; then\n  echo 'ERROR: use --prefix instead of --install-location' >&2\n  exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer generic fpm options (--prefix) over target-specific location flags","After swapping to --prefix, verify the install root with `dpkg -c` / `rpm -qlp` since layout may shift"],"tags":["virtualenv","deprecated-flag","prefix","cli-options"],"backgroundTag":"deprecated-option-warning","analyzedSha":"b6d77ba72a560b687723376a0e5115c3a92634ad","analyzedAt":"2026-08-21T16:39:02.570Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}