Bug #19738 "make install" tries to build files that "make" should already have built
Submitted: 11 May 2006 19:47 Modified: 4 Oct 2006 2:41
Reporter: Paul Dubois Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.0, 5.1 OS:Any (Unix)
Assigned to: Magnus Blåudd CPU Architecture:Any

[11 May 2006 19:47] Paul Dubois
Description:
Scenario:

Build MySQL from source distribution using one login account.
Try to install using a different login account not in same group.  It doesn't work.

The basic problem is that "make install" tries to build some files
that were not built by "make", and thus it fails when run from
a login account that cannot write to the source tree.

"make install" ends in failure like this:

make[4]: Entering directory `/tmp/m-5.0/sql/share'make[4]: stat: english/errmsg.sys: Permission denied
rm -f ../../include/mysqld_error.h
(cd ../../extra && make)
make[5]: Entering directory `/tmp/m-5.0/extra'
../extra/comp_err \
        --charset=../sql/share/charsets \
        --out-dir=../sql/share/ \
        --header_file=../include/mysqld_error.h \
        --name_file=../include/mysqld_ername.h \
--state_file=../include/sql_state.h \
        --in_file=../sql/share/errmsg.txt ../extra/comp_err: Can't
create/write to file '../include/sql_state.h' (Errcode: 13)
Failed to create header files
make[5]: *** [../include/mysqld_error.h] Error 1
make[5]: Leaving directory `/tmp/m-5.0/extra'
make[4]: *** [english/errmsg.sys] Error 2
make[4]: Leaving directory `/tmp/m-5.0/sql/share'
make[3]: *** [install-recursive] Error 1
make[3]: Leaving directory `/tmp/m-5.0/sql'
make[2]: *** [install] Error 2
make[2]: Leaving directory `/tmp/m-5.0/sql'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/tmp/m-5.0'
make: *** [install] Error 2

The english/errmsg.sys error occurs because the english directory
has mode 700 and "make install" can't create errmsg.sys there.
But "make install" should be *trying* to create anything there.
The file should be created by a plain "make", shouldn't it? However,
even if errmsg.sys was created by "make", "make install" would fail
because the english directory is not even readable to the account
doing the install.

One part of the fix is to go+rx the language directories.
Another part would be for "make" to create the errmsg.sys files
and not leave that to "make install".

The comp_err message occurs because sql_state.h existed after "make"
finishes but cannot be written to by the user who runs "make install".

A related problem that doesn't show up here is that comp_err will
also try to create other *.h files in the include directory during
"make install".  Again, "make install" shouldn't be creating any
files in the source tree. Shouldn't they be built during "make"?

How to repeat:
See above.
[12 May 2006 13:41] Paul Dubois
I need to make a correction to this report. Instead of
"source distribution" I should have said "BK source tree".
That is, I'm running make from the BK tree, not from
a source distribution.
[15 May 2006 14:00] Miguel Solorzano
Thank you for the bug report.

Making install in share
make[4]: Entering directory `/tmp/mysql-5.0/sql/share'
make[4]: stat:english/errmsg.sys: Permission denied
rm -f ../../include/mysqld_error.h
rm: cannot remove `../../include/mysqld_error.h': Permission denied
make[4]: *** [english/errmsg.sys] Error 1
make[4]: Leaving directory `/tmp/mysql-5.0/sql/share'
make[3]: *** [install-recursive] Error 1
make[3]: Leaving directory `/tmp/mysql-5.0/sql'
make[2]: *** [install] Error 2
make[2]: Leaving directory `/tmp/mysql-5.0/sql'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/tmp/mysql-5.0'
make: *** [install] Error 2
tester@hegel:/tmp/mysql-5.0$
[12 Sep 2006 14:07] Magnus Blåudd
Stealing this as it would simplify cross compile if we could avoid rebuilding the files generated by our own tools.

Also affects the source distribution, all hosts have to rebuild and run the tools although the generated file is already there.
[14 Sep 2006 8:16] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/11917

ChangeSet@1.2232, 2006-09-14 10:16:25+02:00, msvensson@shellback.(none) +2 -0
  BUG#19738 "make install" tries to build files that "make" should already have built
   - Make built sources only depend on it's sources not the built tool
[18 Sep 2006 19:11] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/12163

ChangeSet@1.2232, 2006-09-18 21:11:34+02:00, msvensson@shellback.(none) +2 -0
  BUG#19738 "make install" tries to build files that "make" should already have built
   - Make built sources only depend on it's sources not the built tool
[19 Sep 2006 6:15] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/12183

ChangeSet@1.2233, 2006-09-19 08:15:42+02:00, msvensson@shellback.(none) +1 -0
  Bug#19738 "make install" tries to build files that "make" should already have built
   - Remove the wildcard dependcy on the charset xml files
[20 Sep 2006 6:57] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/12255

ChangeSet@1.2234, 2006-09-20 08:56:57+02:00, msvensson@shellback.(none) +1 -0
  Bug#19738 "make install" tries to build files that "make" should already have built
   - Move gen_lex_hash to EXTRA_PROGRAMS
[20 Sep 2006 7:28] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/12260

ChangeSet@1.2325, 2006-09-20 09:28:12+02:00, msvensson@shellback.(none) +2 -0
  Bug#19738 "make install" tries to build files that "make" should already have built
   - Move comp_err to EXTRA_PROGRAMS, it will not be installed from 5.1 and up.
[3 Oct 2006 20:02] Chad MILLER
Available in 5.0.26.
[3 Oct 2006 20:10] Chad MILLER
Available in 5.1.12-beta.
[4 Oct 2006 2:41] Paul Dubois
Noted in 5.0.26, 5.1.12 changelogs.

make install tried to build files that should already have been built
by make all, causing a failure if installation was performed using a
different account than the one used for the initial build.