Skip to content

All dpm <command> commands should include an optional parameter representing project path #12

@dasormeter

Description

@dasormeter

Problem Statement

I want to be able to run dpm commands without requiring that I first cd into the directory that contains my project's daml.yaml or multi-package.yaml

example
dpm new blah - create a new project in directory blah with daml.yaml and my daml project files

dpm build <path-to-blah> -- there is currently no way to do this. I have to cd to blah and then run dpm build

Requirement

Allow path to package dir to be passed as an optional parameter on all commands, assuming PWD as the default if it is not passed

So ideally we should harmonize to a single parameter that cators for both the multi package and daml yaml cases

dpm build --project-root blah or similar

Implementation

Currently there is a package-root parameter that is part of the dpm build component only that logically addresses this case, but it is not functional with dpm

❯ dpm new blah
Created a new project in "blah" based on the template "skeleton".

❯ dpm build --package-root blah
Running single package build of blah as no multi-package.yaml was found.
damlc: "Failed to find DPM package resolution for /Users/brianhealey/g/blah. This should never happen, contact support."

Also, there is a different parameter name when a multi package yaml is used rather than a single package daml.yaml

dpm build --help
There are 3 parameters related to this now that should be removed / replaced

  --package-root ARG       Path to the root of a package containing daml.yaml.
                           You should prefer the DAML_PACKAGE environment
                           variable over this option.See
                           https://docs.digitalasset.com/build/3.4/dpm/configuration.html#configuration-options
                           for more details.
  --project-root ARG       Path to the root of a package containing daml.yaml.
                           You should prefer the DAML_PACKAGE environment
                           variable over this option.See
                           https://docs.digitalasset.com/build/3.4/dpm/configuration.html#configuration-options
                           for more details.(project-root is deprecated, please
                           use --package-root)
  --multi-package-path FILE
                           Path to the multi-package.yaml file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions