gha-setup-swift icon indicating copy to clipboard operation
gha-setup-swift copied to clipboard

Moving from 0.2.1 to 0.2.3 caused editbin.exe to be unfindable

Open dabrahams opened this issue 1 year ago • 7 comments
trafficstars

See https://github.com/hylo-lang/hylo/actions/runs/9357322028/job/26052808446#step:12:315

Possibly relevant: we setup-vsdevenv before setting up Swift; that used to be necessary but might now be obsolete?

dabrahams avatar Jun 11 '24 01:06 dabrahams

Update: prior setup-vsdevenv is still needed; otherwise we pick up the wrong link.exe.

dabrahams avatar Jun 12 '24 18:06 dabrahams

Update: the problem was introduced between 0.2.2 and 0.2.3; upgrading to 0.2.2 is no problem for us. Apparently it has something to do with changes to "vs2002 compatibility setup"

dabrahams avatar Jun 12 '24 18:06 dabrahams

CC: @kendalharland

compnerd avatar Jun 12 '24 18:06 compnerd

Hi @dabrahams sorry for the breakage. This is likely because in the latest version I've removed an internal, implicit call to gha-setup-vsdevenv which happens on Windows after the Swift installation. IIRC the reason I skipped this action's internal call to gha-setup-vsdevenv is because it doesn't pass any inputs to gha-setup-vsdevenv, and so that internal call may overwrite values in the environment which were set by a prior call to gha-setup-vsdevenv. In particular the default values for gha-setup-vsdevenv's inputs arch (amd64) and host_arch (amd64) can be problematic, for example if building for or on an arm64 machine.

Does the problem go away if you add an additional, explicit call to gha-setup-vsdevenv with the default arguments, to replace the implicit call that was removed?

If that does not fix the issue, we may need to think about adding the call back, and accepting the same set of inputs as gha-setup-vsdevenv in this action so that the caller may pass them in to handle the case where the defaults differ from their preferred inputs. Another alternative is to expect callers that need something other than the default arguments to explicitly call gha-setup-vsdevenv a third time, after this action runs to override the defaults. Perhaps @compnerd has opinions on how to handle this.

kendalharland avatar Jun 12 '24 20:06 kendalharland

Does the problem go away if you add an additional, explicit call to gha-setup-vsdevenv with the default arguments, to replace the implicit call that was removed?

I could try that… but I already need an explicit call to setup-vsdevenv before I set up Swift, or link.exe isn't found. So the whole magillah starts to look like a giant ball of hacks.

dabrahams avatar Jun 12 '24 20:06 dabrahams

I understand the sentiment, but I think in this particular case, the cost of that one extra line to run gha-setup-vsdevenv again explicitly is a net improvement given that it clarifies what is happening after swift is installed.

kendalharland avatar Jun 13 '24 15:06 kendalharland

@dabrahams does adding -use-ld=lld to the Swift help remove the initial use of setup-vsdevenv? That would change the linker and avoid the dependency on link.exe, which is what the default behaviour is for SPM as well.

compnerd avatar Jun 13 '24 16:06 compnerd