Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

Valid looking command fails due to invalid arguments #51

Open
@chris-easton

Description

@chris-easton

I'm seeing an issue that I'm not sure how to solve. A valid looking command, e.g.:

[INFO] CMD: clang -o test main.c foo.c

Fails with:

clang: error: no such file or directory: 'main.c foo.c'

The following is the content of a shell script to set-up a minimal example:

#!/usr/bin/env bash

cat << EOF > foo.c
void foo() {
}
EOF

cat << EOF > main.c
void main() {
}
EOF


cat << EOF > nobuild.c
#include <stdio.h>
#include <string.h>
#define NOBUILD_IMPLEMENTATION
#include "./nobuild.h"

int main(int argc, char ** argv)
{
  GO_REBUILD_URSELF(argc, argv);

  Cstr_Array file_array = cstr_array_make(NULL, NULL);
  FOREACH_FILE_IN_DIR(file, ".", {
    if (ENDS_WITH(file, ".c") && !ENDS_WITH(file, "nobuild.c"))
    {
      file_array = cstr_array_append(file_array, file);
    }
  });

  CMD("clang", "-o", "test", cstr_array_join(" ", file_array));

  return 0;
}
EOF

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