Skip to content

concretizer: make --force config and a common argument#48838

Merged
tgamblin merged 9 commits intodevelopfrom
force-everywhere
Jun 23, 2025
Merged

concretizer: make --force config and a common argument#48838
tgamblin merged 9 commits intodevelopfrom
force-everywhere

Conversation

@tgamblin
Copy link
Copy Markdown
Member

@tgamblin tgamblin commented Feb 3, 2025

--force was previously available only on spack concretize but not on spack spec,
spack solve, and other commands that do concretization.

This means you can now preview a force-concretize on an environment or spec with
spack spec -f or spack solve -f. You can also set concretization to always force
in config with:

spack:
    concretizer:
        force: true

Making room for this required two breaking changes:

  1. spack install --file no longer works. The -f / --file option conflicted
    with --force. If you wrote:

    spack install -f ./spec.json`
    

    you should simply remove the flag:

    spack install ./spec.json`
    

    Files as spec arguments have been supported since at least Spack v0.10.0.
    We did not preserve --file because it took a separate code path that was already
    buggy. Using one code path for spec files will allow us to handle them more reliably.

  2. spack mirror create --file no longer has a short -f option

    If you wrote:

    spack mirror create -f FILE
    

    You should now use the long argument:

    spack mirror create --file FILE
    

    We removed the -f option to make room for -f / --force.

  • make concretizer:force a configuration option
  • add --force to common concretizer arguments
  • remove the -f short option from spack mirror create --file
  • remove the -f / --file option from spack install

@spackbot-app spackbot-app bot added commands core PR affects Spack core functionality environments labels Feb 3, 2025
@tgamblin tgamblin added this to the v1.0.0 milestone Feb 3, 2025
@tgamblin tgamblin requested review from alalazo and haampie February 3, 2025 05:43
@tgamblin tgamblin force-pushed the force-everywhere branch 2 times, most recently from e2a1b68 to 0ffeaa5 Compare February 3, 2025 05:46
@tgamblin
Copy link
Copy Markdown
Member Author

tgamblin commented Feb 3, 2025

Ok this conflicts with spack install -f / --file <spec.json or spec.yaml>.

I am tempted to deprecate spack install -f (and maybe keep --file) and warn about them on develop relatively soon. Then we can make spack install respect -f in v1.0. You can already do this instead:

spack install ./spec.json
spack install /full/path/to/spec.json

i.e., you do not actually need the option anymore.

spack install -f seems to be used by at least a small number of people. I can find some usages in our issues (but mostly from our own CI system), but only from 3 users in actual code on GitHub.

Thoughts? Is this too drastic? The alternative would be only adding --force but not -f to spack install, making it the only command where -f means something different.

@tgamblin tgamblin changed the title concretizer: --force is now config and a common argument concretizer: make --force config and a common argument Feb 7, 2025
@psakievich
Copy link
Copy Markdown
Contributor

psakievich commented Feb 7, 2025

Ok this conflicts with spack install -f / --file <spec.json or spec.yaml>.

I am tempted to deprecate spack install -f (and maybe keep --file) and warn about them on develop relatively soon. Then we can make spack install respect -f in v1.0. You can already do this instead:

spack install ./spec.json
spack install /full/path/to/spec.json

i.e., you do not actually need the option anymore.

spack install -f seems to be used by at least a small number of people. I can find some usages in our issues (but mostly from our own CI system), but only from 3 users in actual code on GitHub.

Thoughts? Is this too drastic? The alternative would be only adding --force but not -f to spack install, making it the only command where -f means something different.

I think mapping -f to --force and eliminating single char param for --file makes sense. My brain is wired to -f --> --force. I think most peoples' are from the prevalence of spack concretize in our lives.

@tgamblin tgamblin self-assigned this Jun 6, 2025
@spackbot-app spackbot-app bot added shell-support tests General test capability(ies) labels Jun 20, 2025
tgamblin added 7 commits June 21, 2025 00:04
`--force` was previously available only on `spack concretize`
but not on `spack spec`, `spack solve`, and other commands that
do concretization.

This means you can now preview a force-concretize on an environment
or spec with `spack spec -f` or `spack solve -f`.  You can also set
concretization to *always* force in config with:

```yaml
spack:
    concretizer:
        force: true
```

- [x] make `concretizer:force` a configuration option
- [x] add `--force` to common concretizer arguments
- [x] BREAKING: remove `--file` from `spack install` to make room for `--force`

Signed-off-by: Todd Gamblin <[email protected]>
Signed-off-by: Todd Gamblin <[email protected]>
Signed-off-by: Todd Gamblin <[email protected]>
Signed-off-by: Todd Gamblin <[email protected]>
Signed-off-by: Todd Gamblin <[email protected]>
Copy link
Copy Markdown
Member

@alalazo alalazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the goal of the PR, just one comment on adding an implicit dependency on config to the env.concretize method

@tgamblin tgamblin merged commit c702f5b into develop Jun 23, 2025
31 checks passed
@tgamblin tgamblin deleted the force-everywhere branch June 23, 2025 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change commands core PR affects Spack core functionality environments shell-support tests General test capability(ies)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants