build-tools icon indicating copy to clipboard operation
build-tools copied to clipboard

fix: make load-xcode work without a config

Open nornagon opened this issue 2 years ago • 6 comments

Makes e load-xcode default to the latest version if there's no current config.

nornagon avatar Mar 31 '22 23:03 nornagon

why not just make a config that has your root configured correctly

there's no obvious way to do this with an existing checkout.

nornagon avatar Apr 04 '22 16:04 nornagon

The fallback very rarely is "correct"

I basically always work off main, which basically always needs the latest version of Xcode, so I'd say this is not true, at least for me.

nornagon avatar Apr 04 '22 16:04 nornagon

there's no obvious way to do this with an existing checkout.

Hm, yeah this isn't documented / easy at all. I do think it's the better way to do what you want to do though. Maybe a new e import-checkout command or something might be appropriate here in the long term.

In the short term you can just copy this config to ~/.electron_build_tools/configs/evm.{name}.json

{
  "goma": "cluster",
  "root": "/Users/{username}/projects/electron/electron",
  "remotes": {
    "electron": {
      "origin": "[email protected]:electron/electron.git"
    },
    "node": {
      "origin": "[email protected]:electron/node.git"
    }
  },
  "gen": {
    "args": [
      "import(\"//electron/build/args/testing.gn\")",
      "import(\"/Users/{username}/.electron_build_tools/third_party/goma.gn\")"
    ],
    "out": "Testing"
  },
  "env": {
    "CHROMIUM_BUILDTOOLS_PATH": "/Users/{username}/projects/electron/electron/src/buildtools",
    "GIT_CACHE_PATH": "/Users/{username}/.git_cache"
  }
}

Some paths might need fiddling 😄

I basically always work off main, which basically always needs the latest version of Xcode, so I'd say this is not true, at least for me.

Ah yeah I forgot we changed it recently so that the fallback Xcode is always the newest xcode, it still isn't correct and will lead to issues as soon as folks switch branches and goma stops cache hitting

MarshallOfSound avatar Apr 11 '22 22:04 MarshallOfSound

I still think it's preferable behavior to default to latest rather than crash.

nornagon avatar Apr 11 '22 22:04 nornagon

whoops wrong button

nornagon avatar Apr 11 '22 22:04 nornagon

This PR has been in limbo for ages. I don't feel strongly about this PR either way but lean towards accepting it on the principle of "we shouldn't crash". @MarshallOfSound if we're not going to take this PR, is there a better way at hand to prevent a crash?

ckerr avatar Sep 12 '22 23:09 ckerr