Skip to content

Bootstrap version fails to read implicit dependencies table #5

@awvwgk

Description

@awvwgk

This could be an upstream issue with https://github.com/kowainik/tomland, but I don't know enough Haskell to verify this.

Steps to reproduce:

  1. Install the bootstrap version of fpm (fcb7f67 used)
  2. Create new project and add any dependency without using an inline table
> fpm new example
> cd example
> echo "[dependencies.toml-f]\ngit = \"https://github.com/awvwgk/toml-f\"" >> fpm.toml
  1. Try to build the project with the dependency
> fpm build
# gfortran (for build/gfortran_debug/example/example.o build/gfortran_debug/example/example.mod)
# ar (for build/gfortran_debug/example/libexample.a)
ar: creating build/gfortran_debug/example/libexample.a
  1. Find the dependency not recognized
> tree build
build
└── gfortran_debug
    └── example
        ├── example.mod
        ├── example.o
        └── libexample.a

Presumed source of the error:

The following two TOML documents are equivalent, except

  1. uses an inline table for dependencies.toml-f
[dependencies]
toml-f = { git = "https://github.com/awvwgk/toml-f" }
  1. dependencies is implicitly created
[dependencies.toml-f]
git = "https://github.com/awvwgk/toml-f"

Apparently, implicit tables are handled differently by the tomland parser, but this implementation detail should not leak into fpm

Additional information:

Testing this with the Python toml module:

>>> import toml
>>> table = toml.loads("[dependencies.toml-f]\ngit = \"https://github.com/awvwgk/toml-f\"")
>>> print(table)
{'dependencies': {'toml-f': {'git': 'https://github.com/awvwgk/toml-f'}}}
>>> print(toml.dumps(table))
[dependencies.toml-f]
git = "https://github.com/awvwgk/toml-f"

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