This repository has been archived by the owner. It is now read-only.

Figure out debug and release builds #73

Closed
davidfowl opened this Issue Mar 30, 2014 · 11 comments

Comments

Projects
None yet
3 participants
@davidfowl
Member

davidfowl commented Mar 30, 2014

Today we don't have a way to specify debug or release. We need something here.

@Eilon

This comment has been minimized.

Show comment
Hide comment
@Eilon

Eilon Mar 30, 2014

Member

Do we want to also thing about the other things that go along with build configurations? E.g. config transformations (not that we necessarily want transformations) to decide/modify/set/unset different config values? E.g. time-outs for things might be longer, or we'd set customErrors=on/off/meme, etc.. Or maybe it's problematic if we conflate a "debug" vs. "release" build with different deployment settings? Anyway I'm just spewing out some thoughts so that I'll remember this when it comes time to discuss.

Member

Eilon commented Mar 30, 2014

Do we want to also thing about the other things that go along with build configurations? E.g. config transformations (not that we necessarily want transformations) to decide/modify/set/unset different config values? E.g. time-outs for things might be longer, or we'd set customErrors=on/off/meme, etc.. Or maybe it's problematic if we conflate a "debug" vs. "release" build with different deployment settings? Anyway I'm just spewing out some thoughts so that I'll remember this when it comes time to discuss.

@davidfowl

This comment has been minimized.

Show comment
Hide comment
@davidfowl

davidfowl Mar 30, 2014

Member

Nope, this is mostly about compiler settings. Things you're talking about are in the application layer. Today in VS Debug/Release configuration just means, "use these compiler settings". Right now our project.json pivots on target framework because it maps directly to nuget folders. We don't have a way (neither does nuget), to target debug/release builds within a single nuget package.

Member

davidfowl commented Mar 30, 2014

Nope, this is mostly about compiler settings. Things you're talking about are in the application layer. Today in VS Debug/Release configuration just means, "use these compiler settings". Right now our project.json pivots on target framework because it maps directly to nuget folders. We don't have a way (neither does nuget), to target debug/release builds within a single nuget package.

@Eilon

This comment has been minimized.

Show comment
Hide comment
@Eilon

Eilon Mar 30, 2014

Member

Today in VS debug/release runs web.config.transforms too for Debug/Release, doesn't it?

Member

Eilon commented Mar 30, 2014

Today in VS debug/release runs web.config.transforms too for Debug/Release, doesn't it?

@davidfowl

This comment has been minimized.

Show comment
Hide comment
@davidfowl

davidfowl Mar 30, 2014

Member

Yep, and that's a mistake.

Member

davidfowl commented Mar 30, 2014

Yep, and that's a mistake.

@Eilon

This comment has been minimized.

Show comment
Hide comment
@Eilon

Eilon Mar 30, 2014

Member

OK good then we're in agreement 😄

Member

Eilon commented Mar 30, 2014

OK good then we're in agreement 😄

@davidfowl davidfowl added this to the Post Alpha milestone Apr 17, 2014

@davidfowl

This comment has been minimized.

Show comment
Hide comment
@davidfowl

davidfowl May 24, 2014

Member

Related to #235

Member

davidfowl commented May 24, 2014

Related to #235

@davidfowl davidfowl added bug and removed bug labels Jun 24, 2014

@davidfowl davidfowl modified the milestones: 1.0.0-alpha3, Backlog Jun 24, 2014

@davidfowl davidfowl self-assigned this Jun 24, 2014

@davidfowl

This comment has been minimized.

Show comment
Hide comment
@davidfowl

davidfowl Jun 24, 2014

Member

I'll take a first pass at this, adding a parameter to build that will allow building debug/release builds.

Member

davidfowl commented Jun 24, 2014

I'll take a first pass at this, adding a parameter to build that will allow building debug/release builds.

@davidfowl

This comment has been minimized.

Show comment
Hide comment
@davidfowl

davidfowl Jul 8, 2014

Member

Proposal 1:

{
    "frameworks": {
        "net45": {
            "compilationOptions": {
                "define": [ "ALWAYS" ]
            },
            "dependencies": {
                "Newtonsoft.Json": "5.0.8"
            },
            "configurations": {
                "debug": {
                    "compilationOptions": {
                        "define": [ "DEBUG", "TRACE" ],
                        "optimize": false,
                        "debugSymbols": "full"
                    }
                },
                "release": {
                    "compilationOptions": {
                        "define": [ "RELEASE", "TRACE" ],
                        "optimize": true,
                        "debugSymbols": "pdbOnly"
                    }
                }
            }
        }
    }
}

Proposal 2:

{
    "dependencies": { },
    "configurations": {
        "net45": {
            "compilationOptions": {
                "define": [ "ALWAYS" ]
            },
            "dependencies": {
                "Newtonsoft.Json": "5.0.8"
            }
        },
        "net45|debug": {
            "compilationOptions": {
                "define": [ "DEBUG", "TRACE" ],
                "optimize": false,
                "debugSymbols": "full"
            }
        },
        "net45|release": {
            "compilationOptions": {
                "define": [ "RELEASE", "TRACE" ],
                "optimize": true,
                "debugSymbols": "pdbOnly"
            }
        }
    }
}

Proposal 3

{
  "compilationOptions": {
    "define": [ "ALWAYS" ]
  },

  "configurations": {
    "debug": {
      "compilationOptions": {
        "define": [ "DEBUG" ],
         "optimize": false,
         "debugSymbols": "full"
      },
      "release": {
      "compilationOptions": {
        "define": [ "RELEASE" ],
         "optimize": true,
         "debugSymbols": "pdbOnly"
      }
    }
  },

  "frameworks": {
    "net45": {
      "compilationOptions": {
        "define": [ "NET45_ALWAYS" ]
      },

      "configurations": {
        "debug": {
          "compilationOptions": {
            "define": [ "NET45_DEBUG" ]
          }
        }
      }
    }
  }
}

This proposal puts target frameworks into a separate node instead of baking it into the configurations node.

KPM Changes

  • kpm build with accept a -frameworks flag that allows passing in specific frameworks to be built (semicolon separated)
kpm build --framework net45;k10
kpm build --framework net45 --framework k10
  • It will also accept a -configuration flag that will allow passing multiple configurations:
kpm build --framework net45 --configuration debug;release;foo
kpm build --configuration debug --configuration release
  • The same goes for pack
kpm pack --configuration release

K Changes

  • k will have 2 new properties like pack, framework and configuration
k --framework net45 --configuration debug run

Defaults

The roslyn compiler will have known defaults for the debug/release configurations:

Debug:

{
  "compilationOptions": {
    "define": [ "DEBUG", "TRACE" ],
    "optimize": false,
    "debugSymbols": "full"
  }
}

Release

{
  "compilationOptions": {
    "define": [ "RELEASE", "TRACE" ],
    "optimize": true,
    "debugSymbols": "pdbOnly"
  }
}

When doing a regular kpm build, it will default to debug for configurations:

{
  "configurations": { 
    "debug": { },
    "release": { }
  },
  "frameworks": {
    "net45": { },
    "k10": { }
  }
}

kpm build with no arguments will build (net45, debug), (k10, debug).

Open questions:

  1. Do you ever change dependencies depending on debug/release/foo configuration?
Member

davidfowl commented Jul 8, 2014

Proposal 1:

{
    "frameworks": {
        "net45": {
            "compilationOptions": {
                "define": [ "ALWAYS" ]
            },
            "dependencies": {
                "Newtonsoft.Json": "5.0.8"
            },
            "configurations": {
                "debug": {
                    "compilationOptions": {
                        "define": [ "DEBUG", "TRACE" ],
                        "optimize": false,
                        "debugSymbols": "full"
                    }
                },
                "release": {
                    "compilationOptions": {
                        "define": [ "RELEASE", "TRACE" ],
                        "optimize": true,
                        "debugSymbols": "pdbOnly"
                    }
                }
            }
        }
    }
}

Proposal 2:

{
    "dependencies": { },
    "configurations": {
        "net45": {
            "compilationOptions": {
                "define": [ "ALWAYS" ]
            },
            "dependencies": {
                "Newtonsoft.Json": "5.0.8"
            }
        },
        "net45|debug": {
            "compilationOptions": {
                "define": [ "DEBUG", "TRACE" ],
                "optimize": false,
                "debugSymbols": "full"
            }
        },
        "net45|release": {
            "compilationOptions": {
                "define": [ "RELEASE", "TRACE" ],
                "optimize": true,
                "debugSymbols": "pdbOnly"
            }
        }
    }
}

Proposal 3

{
  "compilationOptions": {
    "define": [ "ALWAYS" ]
  },

  "configurations": {
    "debug": {
      "compilationOptions": {
        "define": [ "DEBUG" ],
         "optimize": false,
         "debugSymbols": "full"
      },
      "release": {
      "compilationOptions": {
        "define": [ "RELEASE" ],
         "optimize": true,
         "debugSymbols": "pdbOnly"
      }
    }
  },

  "frameworks": {
    "net45": {
      "compilationOptions": {
        "define": [ "NET45_ALWAYS" ]
      },

      "configurations": {
        "debug": {
          "compilationOptions": {
            "define": [ "NET45_DEBUG" ]
          }
        }
      }
    }
  }
}

This proposal puts target frameworks into a separate node instead of baking it into the configurations node.

KPM Changes

  • kpm build with accept a -frameworks flag that allows passing in specific frameworks to be built (semicolon separated)
kpm build --framework net45;k10
kpm build --framework net45 --framework k10
  • It will also accept a -configuration flag that will allow passing multiple configurations:
kpm build --framework net45 --configuration debug;release;foo
kpm build --configuration debug --configuration release
  • The same goes for pack
kpm pack --configuration release

K Changes

  • k will have 2 new properties like pack, framework and configuration
k --framework net45 --configuration debug run

Defaults

The roslyn compiler will have known defaults for the debug/release configurations:

Debug:

{
  "compilationOptions": {
    "define": [ "DEBUG", "TRACE" ],
    "optimize": false,
    "debugSymbols": "full"
  }
}

Release

{
  "compilationOptions": {
    "define": [ "RELEASE", "TRACE" ],
    "optimize": true,
    "debugSymbols": "pdbOnly"
  }
}

When doing a regular kpm build, it will default to debug for configurations:

{
  "configurations": { 
    "debug": { },
    "release": { }
  },
  "frameworks": {
    "net45": { },
    "k10": { }
  }
}

kpm build with no arguments will build (net45, debug), (k10, debug).

Open questions:

  1. Do you ever change dependencies depending on debug/release/foo configuration?
@monoman

This comment has been minimized.

Show comment
Hide comment
@monoman

monoman Jul 8, 2014

I prefer proposal 1, to avoid combinatorial explosion, which I currently
observe on csprojs. But 'configurations' inside 'configurations' sound a
bit too repetitive, maybe some other word?

Rafael Teixeira
O..:.)oooo

On Tue, Jul 8, 2014 at 5:46 AM, David Fowler notifications@github.com
wrote:

Proposal 1:

{
"dependencies": {

},
"configurations": {
    "net45": {
        "compilationOptions": {
            "define": [ "ALWAYS" ]
        },
        "dependencies": {
            "Newtonsoft.Json": "5.0.8"
        },
        "configurations": {
            "debug": {
                "compilationOptions": {
                    "define": [ "DEBUG", "TRACE" ],
                    "optimize": false,
                    "debugSymbols": "full"
                }
            },
            "release": {
                "compilationOptions": {
                    "define": [ "RELEASE", "TRACE" ],
                    "optimize": true,
                    "debugSymbols": "pdbOnly"
                }
            }
        }
    }
}}

Proposal 2:

{
"dependencies": { },
"configurations": {
"net45": {
"compilationOptions": {
"define": [ "ALWAYS" ]
},
"dependencies": {
"Newtonsoft.Json": "5.0.8"
}
},
"net45|debug": {
"compilationOptions": {
"define": [ "DEBUG", "TRACE" ],
"optimize": false,
"debugSymbols": "full"
}
},
"net45|release": {
"compilationOptions": {
"define": [ "RELEASE", "TRACE" ],
"optimize": true,
"debugSymbols": "pdbOnly"
}
}
}}

kpm build -framework net45 -configuration debug
kpm pack -framework net45 -configuration debug
k run -framework net45 -configuration debug


Reply to this email directly or view it on GitHub
#73 (comment).

monoman commented Jul 8, 2014

I prefer proposal 1, to avoid combinatorial explosion, which I currently
observe on csprojs. But 'configurations' inside 'configurations' sound a
bit too repetitive, maybe some other word?

Rafael Teixeira
O..:.)oooo

On Tue, Jul 8, 2014 at 5:46 AM, David Fowler notifications@github.com
wrote:

Proposal 1:

{
"dependencies": {

},
"configurations": {
    "net45": {
        "compilationOptions": {
            "define": [ "ALWAYS" ]
        },
        "dependencies": {
            "Newtonsoft.Json": "5.0.8"
        },
        "configurations": {
            "debug": {
                "compilationOptions": {
                    "define": [ "DEBUG", "TRACE" ],
                    "optimize": false,
                    "debugSymbols": "full"
                }
            },
            "release": {
                "compilationOptions": {
                    "define": [ "RELEASE", "TRACE" ],
                    "optimize": true,
                    "debugSymbols": "pdbOnly"
                }
            }
        }
    }
}}

Proposal 2:

{
"dependencies": { },
"configurations": {
"net45": {
"compilationOptions": {
"define": [ "ALWAYS" ]
},
"dependencies": {
"Newtonsoft.Json": "5.0.8"
}
},
"net45|debug": {
"compilationOptions": {
"define": [ "DEBUG", "TRACE" ],
"optimize": false,
"debugSymbols": "full"
}
},
"net45|release": {
"compilationOptions": {
"define": [ "RELEASE", "TRACE" ],
"optimize": true,
"debugSymbols": "pdbOnly"
}
}
}}

kpm build -framework net45 -configuration debug
kpm pack -framework net45 -configuration debug
k run -framework net45 -configuration debug


Reply to this email directly or view it on GitHub
#73 (comment).

@davidfowl

This comment has been minimized.

Show comment
Hide comment
@davidfowl

davidfowl Jul 8, 2014

Member

I'm leaning towards 3

Member

davidfowl commented Jul 8, 2014

I'm leaning towards 3

@davidfowl

This comment has been minimized.

Show comment
Hide comment
@davidfowl

davidfowl Aug 19, 2014

Member

Proposal 3 was implemented

Member

davidfowl commented Aug 19, 2014

Proposal 3 was implemented

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.