moonrepo / moon

A build system and monorepo management tool for the web ecosystem, written in Rust.
https://moonrepo.dev/moon
MIT License
2.89k stars 157 forks source link

[bug] Can't set language in moon.yaml as c++ #1619

Closed artsiommiksiuk closed 1 month ago

artsiommiksiuk commented 2 months ago

Describe the bug

Setting

language: "c++"

Causes error:

× Failed to parse libs/dp-boost/moon.yml.
  ╰─▶   × language: Invalid fallback variant c++, unable to parse type.

Steps to reproduce

  1. Create empty moon.yaml
  2. Add language: "c++" line, with some empty task
  3. Run this task

Expected behavior

Any string can be used for language identification

Screenshots

Environment

  System:
    OS: macOS 14.5
    CPU: (12) arm64 Apple M3 Pro
    Memory: 699.92 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
    pnpm: 8.15.6 - /opt/homebrew/bin/pnpm
  Managers:
    Homebrew: 4.3.15 - /opt/homebrew/bin/brew
    pip3: 24.0 - ~/Projects/backend/.venv-apps-be/bin/pip3
    RubyGems: 3.0.3.1 - /usr/bin/gem
  Utilities:
    Bazel: 7.1.2 - /opt/homebrew/bin/bazel
    Make: 3.81 - /usr/bin/make
    GCC: 15.0.0 - /usr/bin/gcc
    Git: 2.39.3 - /usr/bin/git
    Clang: 15.0.0 - /usr/bin/clang
    Curl: 8.6.0 - /usr/bin/curl
    OpenSSL: 3.3.1 - /opt/homebrew/bin/openssl
  Servers:
    Apache: 2.4.58 - /usr/sbin/apachectl
  Virtualization:
    Docker: 27.1.0 - /opt/homebrew/bin/docker
    Docker Compose: 2.24.6 - /usr/local/bin/docker-compose
  IDEs:
    VSCode: 1.92.1 - /usr/local/bin/code
    Vim: 9.0 - /usr/bin/vim
    Xcode: /undefined - /usr/bin/xcodebuild
  Languages:
    Bash: 3.2.57 - /bin/bash
    Perl: 5.34.1 - /usr/bin/perl
    Python: 3.10.14 - /Users/artsiommiksiuk/Projects/backend/.venv-apps-be/bin/python
    Python3: 3.10.14 - /Users/artsiommiksiuk/Projects/backend/.venv-apps-be/bin/python3
    Ruby: 2.6.10 - /usr/bin/ruby
  Databases:
    PostgreSQL: 14.11 - /opt/homebrew/bin/postgres
    SQLite: 3.43.2 - /usr/bin/sqlite3
  Browsers:
    Chrome: 127.0.6533.120
    Safari: 17.5

Additional context

milesj commented 2 months ago

@artsiommiksiuk This seems to be happening at the serde level, I wonder if it thinks its a number?

For now, you can use cpp or cplusplus (which is what the vscode extension expects).

milesj commented 2 months ago

Ah, it's because the fallback is an "id" type, and and ID must match this regex [0-9A-Za-z/\._-].

artsiommiksiuk commented 2 months ago

@milesj, okay, thanks for the hint!

milesj commented 1 month ago

Gonna leave this as-is, since this string is also used in filenames, + just makes things odd.