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

build: dist.exe can't find mercurial (hg) on Windows if VERSION file is missing #3093

Closed
gopherbot opened this issue Feb 21, 2012 · 10 comments
Closed

Comments

@gopherbot
Copy link
Contributor

by Jasonryanphillips:

What steps will reproduce the problem?
1. Delete %GOROOT%\VERSION
2. hg pull
3. hg update weekly
4. cd %GOROOT%\src
5. all.bat

What is the expected output?
Build is successful

What do you see instead?
Build silently fails after the following output:
"# Building C bootstrap tool.
cmd/dist"

After which the env.bat file contains the following text:
"go tool dist: hg: The system cannot find the file specified."

Which compiler are you using (5g, 6g, 8g, gccgo)?
n/a

Which operating system are you using?
Windows 7

Which revision are you using?  (hg identify)
43cf9b39b647 weekly/weekly.2012-02-14

Please provide any additional information below.
Mercurial is built from source. If I manually create the VERSION file the build succeeds
as expected.
@rsc
Copy link
Contributor

rsc commented Feb 21, 2012

Comment 1:

echo %PATH%
is the directory containing hg.exe there?

@gopherbot
Copy link
Contributor Author

Comment 2 by Jasonryanphillips:

Yes, hg is accessible from my %PATH%

@rsc
Copy link
Contributor

rsc commented Feb 21, 2012

Comment 3:

Is it called hg.exe or hg?

@gopherbot
Copy link
Contributor Author

Comment 4 by Jasonryanphillips:

hg.bat
The Mercurial source install uses a batch file to wrap/launch the python modules.

@alexbrainman
Copy link
Member

Comment 5:

Please, send us a copy of your hg.bat file. Thank you.

@alexbrainman
Copy link
Member

Comment 6:

Russ,
I can reproduce this. I think the problem is that we use CreateProcess windows API with
lpApplicationName == nil and lpCommandLine == "hg ...". This combination invokes this
rule:
"... the first white space–delimited token of the command line specifies the module
name. ... If the file name does not contain an extension, .exe is appended. Therefore,
if the file name extension is .com, this parameter must include the .com extension. ..."
(http://goo.gl/m24Rh).
So, it is not even trying to look for hg.bat.
We can add another call to CreateProcess("hg.bat") if CreateProcess("hg") fails. But I
am reluctant to deal with batch files altogether. Given our experience with all.bat, how
are we going to know if hg runs to successful completion?
Alex

Labels changed: added os-windows.

Owner changed to @alexbrainman.

Status changed to Thinking.

@dsymonds
Copy link
Contributor

Comment 7:

Labels changed: added priority-go1, removed priority-triage.

@mattn
Copy link
Member

mattn commented Mar 5, 2012

Comment 8:

CreateProcess("cmd", "/c hg", ...) should work.

@rsc
Copy link
Contributor

rsc commented Mar 27, 2012

Comment 9:

I'm sad that this doesn't work, but we aren't going to change anything before Go 1.
The Go 1 repo will have a VERSION file, so this will be less of an issue.

Labels changed: added priority-later, removed priority-go1.

@rsc
Copy link
Contributor

rsc commented Apr 9, 2012

Comment 10:

This issue was closed by revision 0669261.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants