Skip to content

[Bug] docfx metadata does not generate all metadata on Ubuntu #9618

@AristurtleDev

Description

@AristurtleDev

Describe the bug
We are using DocFX to generate markdown API documentation based on two projects. The generation is run through a GitHub Action running on ubuntu-latest. It's been discovered that when running on Ubuntu, the dotnet docfx metadata command will skip all except the last glob listed in the metadata.src.files array.

For example, here is the docfx.json configuration file.

{
    "metadata": [
      {
        "outputFormat": "markdown",
        "src": [
          {
            "src": ".",
            "files": [
              "external/MonoGame/MonoGame.Framework/MonoGame.Framework.DesktopGL.csproj",
              "external/MonoGame/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj"
            ]
          }
        ],
        "dest": "./content/api",
        "includePrivateMembers": false,
        "disableGitFeatures": false,
        "disableDefaultFilter": false,
        "noRestore": false,
        "namespaceLayout": "flattened",
        "memberLayout": "samePage",
        "EnumSortOrder": "alphabetic"
      }
    ]
}

With this configuration file, when run on windows-latest and macOS-latest GitHub runners, the following is output

dotnet docfx metadata
Using .NET Core SDK 8.0.100
Loading project /Users/aristurtle/Desktop/monogame-11ty/external/MonoGame/MonoGame.Framework/MonoGame.Framework.DesktopGL.csproj
  Determining projects to restore...
  Restored /Users/aristurtle/Desktop/monogame-11ty/external/MonoGame/MonoGame.Framework/MonoGame.Framework.DesktopGL.csproj (in 1.08 sec).
Loading project /Users/aristurtle/Desktop/monogame-11ty/external/MonoGame/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj
  Determining projects to restore...
  Restored /Users/aristurtle/Desktop/monogame-11ty/external/MonoGame/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj (in 443 ms).
  1 of 2 projects are up-to-date for restore.

...

Export succeed: 460 items

However on ubunutu-latest the following is output

dotnet docfx metadata
Using .NET Core SDK 8.0.100
Loading project /Users/aristurtle/Desktop/monogame-11ty/external/MonoGame/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj
  Determining projects to restore...
  Restored /Users/aristurtle/Desktop/monogame-11ty/external/MonoGame/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj (in 443 ms).
  1 of 2 projects are up-to-date for restore.

...
Export succeed: 275 items

As you can see it skips the first file listed in the metadata.src.files array and only runs the last file listed.

Note:
If the configuration is updated so that it only contains the MonoGame.Framework.DesktopGL.csproj in the metadata.src.files array, then it will generate the metadata for that project correctly on the ubuntu-latest runner. However, if both csproj files are listed, no matter the order they are listed, it only executes the MonoGame.Framework.Content.Pipeline.csproj

To Reproduce
A minimal example repository has been created at https://github.com/AristurtleDev/docfx-ubuntu-issue

The following steps should be performed in a windows, mac, and ubuntu environment to see the difference in how it runs in ubuntu vs mac/windows.

Steps to reproduce the behavior:

  1. Clone the minimal example repository git clone https://github.com/AristurtleDev/docfx-ubuntu-issue.git
  2. cd into directory
  3. Restore dotnet tools dotnet tool restore
  4. Run the DocFX metadata command dotnet docfx metadata

Expected behavior
Metadata documentation is generated for both csproj files listed in the metadata.src.files array in docfx.json.

Actual behavior
Metadata documentation is only generated for one csproj when running on the ubuntu-latest GitHub runner.

Context (please complete the following information):

  • OS: Windows, Mac, Ubuntu
  • Docfx version: [e.g. 2.74.1]

Additional context
You can view the output of the minimal sample repo for each operating system at the following links

This is also in reference to the following issue MonoGame/monogame.github.io#58

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