digital-asset / digital-asset/dpm
All `dpm <command>` commands should include an optional parameter representing project path
- Dominant language
- Go
- Stars
- 3
- Forks
- 2
- Avg merge
- 21h 16m
- Merged PRs (30d)
- 1
Description
## 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 ` -- 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
```
Contributor guide
Research direction
Start by reviewing the parameter handling for dpm build and the other dpm commands, using dpm build --help to compare --package-root, --project-root, and --multi-package-path. Trace how the selected project path reaches single-package and multi-package operations. Done means commands accept one consistent optional project-root parameter, default to PWD, and support both daml.yaml and multi-package.yaml projects.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100