Skip to content

Special characters in paths #12

Open
@awvwgk

Description

@awvwgk

I found this setting up challenging tests for fortran-lang/fpm#155, but it is also not working in bootstrap fpm as well.

Consider a project like this

.
├── app dir
│   └── main prog.f90
├── app"dir
│   └── main"prog.f90
├── app'dir
│   └── main'prog.f90
├── fpm.toml
└── source dir
    └── escape_m.f90

Of course, projects with such a structure are usually discouraged, but obviously not forbidden.

The fpm.toml for such a project would look like:

name = "escape chars"

[library]
source-dir = "source dir"

[[executable]]
name = "with spaces"
source-dir = "app dir"
main = "main prog.f90"

[[executable]]
name = "single'quotes"
source-dir = "app'dir"
main = "main'prog.f90"

[[executable]]
name = "double\"quotes"
source-dir = "app\"dir"
main = "main\"prog.f90"

And it is indeed a valid TOML document. But building with bootstrap fpm will fail due to spaces in the project name:

> fpm build
# ar (for build/gfortran_debug/escape chars/libescape chars.a)
ar: creating build/gfortran_debug/escape
ar: chars/libescape: No such file or directory
fpm: Error when running Shake build system:
  at want, called at src/Build.hs:205:11 in fpm-0.1.0.0-ExRRX9W2aflLvTBBChPpxh:Build
* Depends on: build/gfortran_debug/escape chars/libescape chars.a
  at cmd, called at src/Build.hs:204:13 in fpm-0.1.0.0-ExRRX9W2aflLvTBBChPpxh:Build
* Raised the exception:
Development.Shake.cmd, system command failed
Command line: ar rs build/gfortran_debug/escape chars/libescape chars.a 'build/gfortran_debug/escape chars/escape_m.o'
Exit code: 1
Stderr:
ar: creating build/gfortran_debug/escape
ar: chars/libescape: No such file or directory

Probably escape-chars is a better project name, but we still cannot run the executables:

fpm run with\ spaces
/bin/sh: /home/awvwgk/projects/src/github.com/fortran-package-manager/test/example_packages/escape-chars/build/gfortran_debug/app: No such file or directory

A complete version of this package is here: escape-chars.zip.

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