Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Failed to run compiled magefile. #449

Open
johnstoj opened this issue Dec 11, 2022 · 0 comments
Open

Bug: Failed to run compiled magefile. #449

johnstoj opened this issue Dec 11, 2022 · 0 comments
Labels

Comments

@johnstoj
Copy link

Bug Description
Mage has trouble finding the resulting compiled magefile in my azure devops pipeline. Seems to work fine on multiple local hosts (i.e. for the development team- we're using Win 11). FWIW, the ADO pipeline runs Windows Server 2019 images.

It looks as though there's an extra '' character slipped into the path when the mage attempts to run the resulting exe? (see further down).

Unfortunately I don't have a local Windows Server 2019 handy to step through with a debugger (I can try to put one together if more info is required). :(

What did you do?
Install mage, change to the correct directory, mage test:lint (it's the same for any target though)

What did you expect to happen?
I expected mage to run my target, as it does on local hosts.

What actually happened?

DEBUG: 08:58:50.114977 found namespace method ./ Build.Foo64
DEBUG: 08:58:50.114977 found namespace ./ Compile
DEBUG: 08:58:50.114977 found namespace method ./ Compile.Assets
DEBUG: 08:58:50.114977 found namespace method ./ Compile.Yella
DEBUG: 08:58:50.114977 found namespace ./ Dependency
DEBUG: 08:58:50.114977 found namespace ./ Git
DEBUG: 08:58:50.114977 found namespace ./ Test
DEBUG: 08:58:50.114977 found namespace method ./ Test.Checkdependencies
DEBUG: 08:58:50.114977 found namespace method ./ Test.Foobar
DEBUG: 08:58:50.114977 found namespace method ./ Test.Foo
DEBUG: 08:58:50.114977 found namespace method ./ Test.Functional
DEBUG: 08:58:50.114977 found namespace method ./ Test.Lint
DEBUG: 08:58:50.114977 found namespace method ./ Test.Precommit
DEBUG: 08:58:50.114977 found namespace method ./ Test.Race
DEBUG: 08:58:50.114977 found namespace method ./ Test.Unit
DEBUG: 08:58:50.114977 found namespace ./ Utils
DEBUG: 08:58:50.114977 found namespace ./ Winres
DEBUG: 08:58:50.114977 found target Clean
DEBUG: 08:58:50.114977 found target Cleaner
DEBUG: 08:58:50.114977 time parse Magefiles: 2.2189ms
DEBUG: 08:58:50.115485 Creating mainfile at magefiles\mage_output_file.go
DEBUG: 08:58:50.115640 writing new file at magefiles\mage_output_file.go
DEBUG: 08:58:50.118837 compiling to magefile\25aaac15522b215c66ad05db4c827dcfccff724d.exe
DEBUG: 08:58:50.118837 compiling using gocmd: go
DEBUG: 08:58:55.576665 running go build -o magefile\25aaac15522b215c66ad05db4c827dcfccff724d.exe dependson.go git.go magefile.go utils.go winres.go mage_output_file.go
go: downloading [github.com/carolynvs/magex](http://github.com/carolynvs/magex) v0.9.0
go: downloading [golang.org/x/sys](http://golang.org/x/sys) v0.0.0-20210510120138-977fb7262007
go: downloading [github.com/Masterminds/semver/v3](http://github.com/Masterminds/semver/v3) v3.1.1
DEBUG: 08:59:00.885789 time to compile Magefile: 5.3085701s
DEBUG: 08:59:00.885789 running binary magefile\25aaac15522b215c66ad05db4c827dcfccff724d.exe
DEBUG: 08:59:00.885789 running magefile with mage vars:
MAGEFILE_VERBOSE=1
MAGEFILE_DEBUG=1
MAGEFILE_GOCMD=go
failed to run compiled magefile: exec: "magefile\\25aaac15522b215c66ad05db4c827dcfccff724d.exe": file does not exist
exit status 1

Note the '\' in that "failed to run" path, vs. the "compiling to" path.

Environment

  • Mage Version: [run mage --version]
Mage Build Tool 1.14.0
Build Date: 2022-09-16T18:08:32Z
Commit: 300bbc868ba8f2c15b35e09df7e8804753cac00d
built with: go1.18
  • OS: [e.g. windows/linux/mac]
Windows Server 2019
10.0.17763.0

Additional context
I've worked around it by compiling to a specific output file in the pipeline task, and use that to run targets... Which brings me to a secondary problem- Since the 32bit packages of mage seems to have been dropped, the flows in my pipeline don't work (since there's no windows 32bit package to download). :(

Would it be possible to add those back into the build? I'd prefer not to compile it myself (I'd have then track mage release changes).

FWIW, I'm loving mage- thank-you. :)

@johnstoj johnstoj changed the title Bug: <description> Bug: Failed to run compiled magefile. Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant