Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch create --dry-run actually creates folder #5918

Open
tuohy opened this issue Apr 10, 2024 · 1 comment
Open

switch create --dry-run actually creates folder #5918

tuohy opened this issue Apr 10, 2024 · 1 comment
Assignees

Comments

@tuohy
Copy link

tuohy commented Apr 10, 2024

Current behavior:

$ opam switch --dry-run create lts ocaml=4.14.2

<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><>
Switch invariant: ["ocaml" {= "4.14.2"}]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Installing base-bigarray.base.
∗ installed base-bigarray.base
Installing base-threads.base.
∗ installed base-threads.base
Installing base-unix.base.
∗ installed base-unix.base
Installing ocaml-options-vanilla.1.
∗ installed ocaml-options-vanilla.1
Installing ocaml-base-compiler.4.14.2.
∗ installed ocaml-base-compiler.4.14.2
Installing ocaml-config.2.
∗ installed ocaml-config.2
Installing ocaml.4.14.2.
∗ installed ocaml.4.14.2
Done.
# Run eval $(opam env --switch=lts) to update the current shell environment
$ opam switch --dry-run create lts ocaml=4.14.2
[ERROR] Directory "/home/username/.opam/lts" already exists, please choose a different name
~$ tree -a ~/.opam/lts
/home/username/.opam/lts
└── .opam-switch
    ├── build
    ├── install
    │   ├── base-bigarray.changes
    │   ├── base-threads.changes
    │   ├── base-unix.changes
    │   ├── ocaml-base-compiler.changes
    │   ├── ocaml.changes
    │   ├── ocaml-config.changes
    │   └── ocaml-options-vanilla.changes
    └── packages
        └── cache

4 directories, 8 files

Expected behavior: --dry-run commands should not write to the filesystem at all outside opam's internal caches

# opam config report
# opam-version         2.1.2
# self-upgrade         no
# system               arch=x86_64 os=linux os-distribution=ubuntu os-version=22.04
# solver               builtin-mccs+glpk
# install-criteria     -removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed
# upgrade-criteria     -removed,-count[avoid-version,changed],-count[version-lag,solution],-count[missing-depexts,changed],-new
# jobs                 7
# repositories         1 (http), 1 (version-controlled) (default repo at b8624d2c)
# pinned               0
# current-switch       dev2
# ocaml:native         true
# ocaml:native-tools   true
# ocaml:native-dynlink true
# ocaml:stubsdir       /home/username/.opam/dev2/lib/ocaml/stublibs:/home/username/.opam/dev2/lib/ocaml
# ocaml:preinstalled   false
# ocaml:compiler       5.1.1
@kit-ty-kate
Copy link
Member

Thanks for your report. I was able to reproduce with the latest version (2.2.0~beta2)

@rjbou rjbou self-assigned this Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants