elm-lang / elm-plans

no longer in use, just want to keep discussions around
BSD 3-Clause "New" or "Revised" License
29 stars 1 forks source link

Proposal: Versioned build-artifacts/ directory #1

Closed rtfeldman closed 9 years ago

rtfeldman commented 9 years ago

Proposed Change

Introduce a directory within elm-stuff/build-artifacts/ for the current version of elm-make.

Current Example: elm-stuff/build-artifacts/elm-lang/core/2.1.0

With Proposed Change: elm-stuff/build-artifacts/0.15.1/elm-lang/core/2.1.0

Motivation

This would improve two situations.

The first situation is what happens when you upgrade to a new version of elm-make, which is that building the same project yields this error:

Error reading build artifact elm-stuff/build-artifacts/elm-lang/core/2.1.0/Array.elmi
    The file was generated by a previous build and may be outdated or corrupt.
    Please remove the file and try again.

This has the unfortunate consequence of making non-breaking upgrades like 0.15 to 0.15.1 break your build despite being backwards-compatible.

The second situation is when you want to switch back and forth between multiple versions of elm-make on the same system. This can happen when you are in the process of upgrading to a new version of elm-make with breaking changes, but still need to periodically switch back in order to work on your existing production code that is not upgrade-ready yet.

The only real drawback of this proposed change appears to be that it would take up more disk space than the status quo. Of course, if that becomes a problem, you can always delete unused version directories.

evancz commented 9 years ago

Based on the initial discussion of this in https://github.com/elm-lang/elm-make/issues/30 this seems like a nice route to go. It is unclear when I will be able to do this, and the scope of this change is such that it'd make for a nice contribution!

texastoland commented 9 years ago

@evancz it looks like you can just update one line?

packagesDirectory =
    stuffDirectory </> "packages" </> V.toString version V.elm
Apanatshka commented 9 years ago

@dnalot It would cost @evancz less time if you actually tried that change to see if that's it. If it is, then you open the pull request and you get the kudos. If it isn't you can look into it more, or drop it.

texastoland commented 9 years ago

I followed up on the mailing list. I would've but my environment isn't set up i.e. no Haskell.

mgold commented 9 years ago

@rtfeldman Remove the Help Wanted label?

rtfeldman commented 9 years ago

Done!