Erlang/OTP Forums

Author Message

<  Erlang patches mailing list  ~  Behaviour of make:files vs. erlc and patch

Guest
Posted: Tue May 18, 2010 11:02 pm Reply with quote
Guest
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi everyone,

I have sometimes had a problem with make:files failing mysteriously with
'error' and no message. Running erlc from the command line on the same
files works successfully and I think I've tracked the issue to an
unnecessary check in make:files that fails because the target .beam file
exists but is owned by root.

I have created a simple patch for this and I humbly present it for
review. It's my first one so I hope it's OK! Here's the commit message:

- ------

Change make:files to behave more like erlc

Currently make:files will fail with the atom 'error' and
no message when the input (.erl) file is unreadable or the
output (.beam) file is unwritable. This differs from erlc
which will print a useful error message, or when possible,
remove the unwritable output file and continue successfully.

This change removes an the unnecessary checks on the files when
make:files is called and allows the error checking to be
done in compile:file, where the error messages are produced.
It does not effect the return value.

In particular this resolves the mysterious problem of make:files
failing but erlc succeeding, caused by an unwritable (usually
root owned) beam file in an otherwise writable build directory.

- ------

The patch location is:

git fetch git://github.com/firx/otp.git make_files_like_erlc

Cheers,

Sam.
- --
Sam Bobroff | sam@m5net.com | M5 Networks
Why does my email have those funny headers? Because I use PGP to sign
my email (and you should too!): that's how you know it's really from me.
See: http://en.wikipedia.org/wiki/Pretty_Good_Privacy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvzHFsACgkQm97/UHSa/ARwZgCdFE2AAg7AY+d0rXMSHRdAJvhx
8EEAn3heGIEw/bJxmvTowxvWbP1gV3jm
=FJfG
-----END PGP SIGNATURE-----

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Tue May 18, 2010 11:02 pm Reply with quote
Guest
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi everyone,

I have sometimes had a problem with make:files failing mysteriously with
'error' and no message. Running erlc from the command line on the same
files works successfully and I think I've tracked the issue to an
unnecessary check in make:files that fails because the target .beam file
exists but is owned by root.

I have created a simple patch for this and I humbly present it for
review. It's my first one so I hope it's OK! Here's the commit message:

- ------

Change make:files to behave more like erlc

Currently make:files will fail with the atom 'error' and
no message when the input (.erl) file is unreadable or the
output (.beam) file is unwritable. This differs from erlc
which will print a useful error message, or when possible,
remove the unwritable output file and continue successfully.

This change removes an the unnecessary checks on the files when
make:files is called and allows the error checking to be
done in compile:file, where the error messages are produced.
It does not effect the return value.

In particular this resolves the mysterious problem of make:files
failing but erlc succeeding, caused by an unwritable (usually
root owned) beam file in an otherwise writable build directory.

- ------

The patch location is:

git fetch git://github.com/firx/otp.git make_files_like_erlc

Cheers,

Sam.
- --
Sam Bobroff | sam@m5net.com | M5 Networks
Why does my email have those funny headers? Because I use PGP to sign
my email (and you should too!): that's how you know it's really from me.
See: http://en.wikipedia.org/wiki/Pretty_Good_Privacy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvzHFsACgkQm97/UHSa/ARwZgCdFE2AAg7AY+d0rXMSHRdAJvhx
8EEAn3heGIEw/bJxmvTowxvWbP1gV3jm
=FJfG
-----END PGP SIGNATURE-----

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum