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

GitVersion 4.0.0 fails on VSTS #1496

Closed
jmezach opened this issue Oct 14, 2018 · 20 comments
Closed

GitVersion 4.0.0 fails on VSTS #1496

jmezach opened this issue Oct 14, 2018 · 20 comments

Comments

@jmezach
Copy link

jmezach commented Oct 14, 2018

Now that the 4.0.0 version of GitVersion has been published to the Marketplace I've been trying to use it in my projects, but unfortunately I'm getting an error when using the 4.0 version of the build task:

2018-10-14T17:50:43.3560348Z ##[error]File not found: 'D:\a\_tasks\GitVersion_e5983830-3f75-11e5-82ed-81492570a08e\4.0.0\GitVersion.js'

This looks like a packaging issue with the VSTS extension. Looks like the build task is written in TypeScript, so I'm guessing that the TypeScript wasn't transpiled to JavaScript at the time of the release. I believe @arturcic published the 4.0.0 version of the VSTS task as a part of #1445.

@arturcic
Copy link
Member

Actually the GitVersion.js is there, I guess the task is not looking at the correct location
image

@jmezach
Copy link
Author

jmezach commented Oct 14, 2018

Hmm, looking at the task.json it's looking for the GitVersion.js in the root, but looking at the screenshot it is inside of a scripts folder. So I guess the task.json should be modified to match the actual path of the GitVersion.js. I can submit a PR to fix this, but I don't think I'll be able to release it, right?

@yohanb
Copy link

yohanb commented Oct 14, 2018

Same error on an Ubuntu VSTS build agent.
screen shot 2018-10-14 at 4 34 40 pm
It's a private agent so I was able to look into the task folder's content:
image
no scripts folder, no transpiled GitVersion.js.

@arturcic
Copy link
Member

arturcic commented Oct 15, 2018

@jmezach, @yohanb, I have updated task.json with the scripts/GitVersion.js path and uploaded the version with the fix. Can you try the latest version and see if this fixes your issue?

@jmezach
Copy link
Author

jmezach commented Oct 15, 2018

@arturcic I just tried it, but I'm still getting the same error. Since the error also contains the version number, which is still 4.0.0, I'm wondering if the version number on the task has been updated. If not I believe that VSTS will still use the old version (due to caching).

@arturcic
Copy link
Member

Ok then, I'll update that as well

@arturcic
Copy link
Member

@jmezach Updated, moved the files to the same location as task.json, can you try the new version?

@jmezach
Copy link
Author

jmezach commented Oct 15, 2018

Okay, it picked up the new version of the task now, but now I'm getting a different error:

2018-10-15T07:02:45.7987690Z ##[section]Starting: GitVersion
2018-10-15T07:02:45.7991420Z ==============================================================================
2018-10-15T07:02:45.7991620Z Task         : GitVersion Task
2018-10-15T07:02:45.7991730Z Description  : Easy Semantic Versioning (http://semver.org) for projects using Git
2018-10-15T07:02:45.7991850Z Version      : 4.0.1
2018-10-15T07:02:45.7992010Z Author       : GitVersion Contributors
2018-10-15T07:02:45.7992190Z Help         : See the [documentation](http://gitversion.readthedocs.org/en/latest/) for help
2018-10-15T07:02:45.7992310Z ==============================================================================
2018-10-15T07:02:46.3209380Z module.js:471
2018-10-15T07:02:46.3218320Z     throw err;
2018-10-15T07:02:46.3218580Z     ^
2018-10-15T07:02:46.3218700Z 
2018-10-15T07:02:46.3219900Z Error: Cannot find module 'vsts-task-lib/task'
2018-10-15T07:02:46.3220270Z     at Function.Module._resolveFilename (module.js:469:15)
2018-10-15T07:02:46.3220560Z     at Function.Module._load (module.js:417:25)
2018-10-15T07:02:46.3220900Z     at Module.require (module.js:497:17)
2018-10-15T07:02:46.3221060Z     at require (internal/module.js:20:19)
2018-10-15T07:02:46.3221860Z     at Object.<anonymous> (/Users/vsts/agent/2.140.2/work/_tasks/GitVersion_e5983830-3f75-11e5-82ed-81492570a08e/4.0.1/GitVersion.js:11:12)
2018-10-15T07:02:46.3222470Z     at Module._compile (module.js:570:32)
2018-10-15T07:02:46.3222700Z     at Object.Module._extensions..js (module.js:579:10)
2018-10-15T07:02:46.3222860Z     at Module.load (module.js:487:32)
2018-10-15T07:02:46.3223090Z     at tryModuleLoad (module.js:446:12)
2018-10-15T07:02:46.3224580Z     at Function.Module._load (module.js:438:3)
2018-10-15T07:02:46.3889420Z ##[error]Exit code 1 returned from process: file name '/Users/vsts/agent/2.140.2/externals/node/bin/node', arguments '"/Users/vsts/agent/2.140.2/work/_tasks/GitVersion_e5983830-3f75-11e5-82ed-81492570a08e/4.0.1/GitVersion.js"'.
2018-10-15T07:02:46.3926680Z ##[section]Finishing: GitVersion

Are the node_modules part of the VSIX?

@arturcic
Copy link
Member

looks like we need to include the node_modules as well

@arturcic
Copy link
Member

@jmezach can you try the new version? this one included node_modules

@jmezach
Copy link
Author

jmezach commented Oct 15, 2018

Okay, so it looks like it's working now, at least on Windows. It still fails on macOS and Linux though. Not entirely sure if that is supported at all. I thought it was, but I guess it's not, but I should probably open a separate issue for that.

@arturcic
Copy link
Member

For unix you need mono installed

@arturcic
Copy link
Member

I'll create a PR for this issue with the changes I've done so far, and I'll close the issue.

@jmezach
Copy link
Author

jmezach commented Oct 15, 2018

Sounds good. I'll file another issue for the macOS and Linux failures.

@arturcic
Copy link
Member

@yohanb , can you check the new version on your agent, I guess you have mono installed there.

arturcic added a commit to arturcic/GitVersion that referenced this issue Oct 15, 2018
arturcic added a commit that referenced this issue Oct 15, 2018
@yohanb
Copy link

yohanb commented Oct 15, 2018

@arturcic why is mono required if it's compiled as .NET Core?

@arturcic
Copy link
Member

The version that is used in the VSTS package is a .NET Framework package - il-merged. That was the way it was packaged before v.4.0.0, and I did not changed that, so it's still running with mono. Probably we might consider using the .NET core version, but that will add a dependency on .net core to be installed, now it's on mono

@claudiuconstantin
Copy link

When will this be released?

@arturcic
Copy link
Member

a PR for this change is welcomed.

@jmezach
Copy link
Author

jmezach commented Oct 15, 2018

Perhaps this is also the reason for #1497. I guess taking a dependency on .NET Core isn't that weird, since the hosted agents on VSTS (including Windows, macOS and Linux) all have .NET Core SDK's installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants