tinygo-org / tinygo

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
https://tinygo.org
Other
15.48k stars 913 forks source link

duplicate big-go version tags functionality [ fix #4391 ] #4389

Closed archie2x closed 3 months ago

archie2x commented 3 months ago

[ see #4391 for motivation ] This attempts to duplicate big-Go go1.X build tags in tinygo with a series of build tags in the form tinygo0.1,tinygo0.2,...

Also adds a '-full' command-line flag to see all of the tags.

% ./build/tinygo info -json -full
{
  "goarch": "arm64",
  "goarm": "6",
  [...]
  "build_tags": [
    "darwin",
    "arm64",
    "tinygo",
    "purego",
    "math_big_pure_go",
    "gc.precise",
    "scheduler.tasks",
    "serial.none",
    "tinygo0.1",       <---
    "tinygo0.2",       <---
    [...]
    "tinygo0.32",      <---
    "tinygo0.33"       <---
  ],
  "garbage_collector": "precise",
  "scheduler": "tasks",
  "llvm_triple": "arm64-apple-macosx11.0.0"
}

TODO:

const Major = 0 const Minor = 33 const Patch = 0 const Dev = "-dev" // "" for release

aykevl commented 3 months ago

I'm not entirely convinced we should be doing this. Can you explain why this is needed (and why you can't just use the latest tinygo for example)?

archie2x commented 3 months ago

I'm not entirely convinced we should be doing this. Can you explain why this is needed (and why you can't just use the latest tinygo for example)?

Thanks! Sorry: it was an early-morning PR. See Issue #4391 where I tried to illustrate the motivation.

archie2x commented 3 months ago

As mentioned in #4391, I agree this doesn't make sense for now.