Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler extensibility #4321

Closed
davidfowl opened this issue Oct 16, 2015 · 8 comments
Closed

Compiler extensibility #4321

davidfowl opened this issue Oct 16, 2015 · 8 comments
Assignees

Comments

@davidfowl
Copy link
Member

We should add an additional --compiler argument to dotnet compile. dotnet compile --compiler {compiler}. In absence of any compiler we'll use csc or sniff some sensible default. It can also be specified in the project.json file

{
    "version": "1.0.0-*",
    "compileFiles": [
       "Something.fs",
       "Program.fs"
     ],
    "compilationOptions": {
        "emitEntryPoint": true,
        "compiler": "fsc"
    },
    "dependencies": {
        "Microsoft.NETCore.ConsoleHost": "1.0.0-*",
        "Microsoft.NETCore.Runtime": "1.0.1-*",

        "System.Console": "4.0.0-*",
    },
    "frameworks": {
        "dnxcore50": { }
    }
}

The above project would be an f# project and we would execute the equivalent of dotnet compile --framework dnxcore50 --compiler fsc. The command line would override whatever was in the file.

/cc @jaredpar @anurse

@jaredpar
Copy link
Member

👍

@analogrelay
Copy link
Contributor

At some point we're also going to need to look at how compilation options are specified. Compilers may have their own options they want to provide, etc. Perhaps in that case an intermediary is used (i.e. dotnet-compile-[lang]) which parses the project.json itself.

davidfowl referenced this issue in dotnet/cli Oct 18, 2015
- Split dotnet-compile into dotnet-compile and
dotnet-compile-{compiler}
- We still need to figure out the protocol and responsibility
but this change adds the needed indirection so that compilers can do
their thing.
- Updated the bootstrap script and kept the commands since we need
them to bootstrap the world until we get updates.

#52
@agocke
Copy link
Member

agocke commented Oct 21, 2015

Jared and I briefly discussed this before he left.

I think we want two sets of arguments here: 1) some "compilationOptions" which are portable and 2) some "extra options" that are passed directly to the compiler.

The idea is that we want to keep familiarity by keeping the common options the same, but also provide a mechanism to provide compiler-specific and langauge-specific options.

@agocke
Copy link
Member

agocke commented Oct 21, 2015

The common options would be parsed by dotnet-compile, then passed on as command line arguments to the dotnet-compile-[lang], along with the extra options which are just copied verbatim.

@davidfowl
Copy link
Member Author

Sounds like a plan!

@davidfowl
Copy link
Member Author

Wood also be great if we didnc# sooner than later

@agocke agocke self-assigned this Oct 21, 2015
@davidfowl
Copy link
Member Author

@agocke @jaredpar We need to figure out how to handle source files resolution. Today we have 3 hard coded globbing patterns that look at source files:

https://github.com/dotnet/cli/blob/master/src/Microsoft.DotNet.ProjectModel/Files/ProjectFilesCollection.cs#L14-L17

Ideally this would be handled by the compiler or maybe it requires more metadata somewhere. This library will also be used for the IDE experience so it needs to flow properly and can't only be in the command line invocation (I'd rather not have the IDE do what it does today for csc 😄)

@blackdwarf
Copy link

This is probably done. Opportunistic close. Reopen if needed. Fixed by dotnet/cli#102.

wli3 referenced this issue in wli3/cli Sep 10, 2018
Fix dependency name showing twice in auto-PR title
@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@davidfowl davidfowl mentioned this issue Jan 31, 2020
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants