Skip to content

build.cmd accepting invalid values for -c #34782

Closed

Description

@mrj001

I was able to run the following to build this morning.

$ ./build.cmd -subset Clr -c Checked
$ ./build.cmd -subset Libs -c Checked

When I tried to run "dotnet" from a library folder, I got this error;

$ dotnet --version
bash: /C/Users/mrj00/source/repos/runtime/artifacts/bin/testhost/netcoreapp5.0-Windows_NT-Debug-x64/dotnet: No such file or directory

I thought the only valid values for -c for the libraries were "Release" and "Debug". So it should not accept "Checked".

So I tried this from the reporoot:

$ ./build.cmd -c Fizzbin

This was accepted. I interrupted the build, and the following folder was found:
artifacts/bin/coreclr/Windows_NT.x64.Fizzbin

I believe that the invalid values for -c should be rejected immediately, rather than appearing to succeed, only to produce difficulties later.

Activity

  1. added
    area-Infrastructure-coreclr
    untriaged
    on Apr 9, 2020
  2. danmoseley commented on Apr 9, 2020

    @danmoseley
    Contributor

    Also, does casing of the configuration matter? On Unix I'm guessing it produces an output folder with the same casing, so perhaps yes?

  3. janvorli commented on Apr 9, 2020

    @janvorli
    Member

    On unix, it matters. The old scripts (the src/coreclr/build.sh) accept any casing and fixes it. The new one doesn't seem to do so.

  4. danmoseley commented on Apr 9, 2020

    @danmoseley
    Contributor

    It would be good to fix that too since it's just another thing to get wrong (or have to remember)

  5. ivdiazsa commented on Apr 16, 2020

    @ivdiazsa
    Contributor

    Checked used to be a valid configuration in CoreCLR. It was an intermediate flavor between Debug and Release. Actually, if you run the following command:

    .\build.cmd -subset clr -configuration Checked

    Things go fine without any issues. However, if you do:

    .\build.cmd -configuration Checked

    The build will fail at some point saying it could not open the include file version_info.h. Is Checked no longer supported in runtime and thus should we remove it? Or make it only work when building the clr subset? I ask because it's listed in the help as a valid option, but it doesn't work. @janvorli @danmosemsft

    Regarding passing arbitrary values to the configuration parameter, if you use -subset clr, it fails almost immediately, which is a reasonable result. However, if you pass it to just build.cmd, it ultimately fails but takes quite some time, which is very misleading and prone to wasting time. It is worth mentioning it will also create folders for this passed configuration, which shouldn't happen.

    I can work on correcting this. I would greatly appreciate feedback regarding the Checked configuration concerns.

  6. danmoseley commented on Apr 16, 2020

    @danmoseley
    Contributor
  7. ivdiazsa commented on Apr 16, 2020

    @ivdiazsa
    Contributor

    @danmosemsft I see, so the Checked builds are a story still under debate. Then I'm planning to add a checking mechanism to make the build fail since the beginning when receiving invalid options, to avoid the problems described in the original post.

  8. self-assigned this
    on Apr 16, 2020
  9. ivdiazsa commented on Apr 17, 2020

    @ivdiazsa
    Contributor

    Through more experiments, I found that other parameters, such as -os and -arch also accept random values. This causes them to fail much later with huge unrelated, and therefore misleading error messages. Will work on fixing those as well. Also, I can confirm this issue is present on Linux too (build.sh).

  10. trylek commented on Apr 17, 2020

    @trylek
    Member

    Casing is hell. Sigh.

  11. removed
    untriaged
    on May 11, 2020
  12. ivdiazsa commented on May 13, 2020

    @ivdiazsa
    Contributor

    Closing this as it's been fixed through issue #35222

  13. ghost locked as resolved and limited conversation to collaborators on Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-Infrastructure-coreclr

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions