Skip to content

Conversation

@starkertyp
Copy link
Contributor

@starkertyp starkertyp commented Jun 14, 2017

Hi,
as mentioned on #342 make install fails on my gentoo system because make install tries to install lfe_scan.beam twice.
During the whole compilation magic src/lfe_scan.xrl will get turned into src/lfe_scan.erl . As EBINS is essentially a list of all .erl, .xrl and .yrl files with the endings replaced by .beam this results in the problem that EBINS will contain lfe_scan.beam twice as this name is generated from both the .xrl and the .erl file. As this problem seems to affect the install target I tried not to mess with anything else (I don't know a lot about make).

This fix is kinda ugly but it resolves the issue for me. Not sure if this will work well on other systems but it might be worth a shot.

rvirding and others added 30 commits April 23, 2016 17:38
To do this the macro expansion phase had to leave the define-macro and
eval-when-compiler in the code. Some compiler passes had to be
modified to ignore these forms.
Add `+no_docs` to terms list per lfe#227.
Add Hex badges and close lfe#221.
Convert all the compiler options to kebab case.
Fix forty-two?/1 and add another module, another-example.

Deliberately avoid (doc ...) in (defmodule another-module ...) and don't
include a docstring in divmod/2.
Move lfedoc to bin, make some general improvements and parse appropriate
lfe_comp:file/2 options. Notably, +to* options are ignored, since we
need to end up with a binary here.

Add lfedoc to the install make target too.
* Update README.md and doc/src/updating_docs.md

Similar to lfe#223, update README.md and doc/src/updating_docs.md
to point to the new doc/src directory.

* Update Makefile

Allow DESTBINDIR to be set by the user.

I use Nix to manage Erlang installations, which results in my not being
able to use the default DESTBINDIR.

With this change, the following works for me in fish shell:

    env DESTBINDIR=/usr/local/bin make install

This shouldn't have any negative consequences for "normal" users and
might be helpful to others as well.
Use Hex packages for proper and rebar3_proper, update the `travis`
make target to call `rebar3 do proper, ct` and update .travis.yml
to use rebar3 and call `make travis`.
Add ./bin to the $PATH so `/usr/bin/env lfe` can work and disable
builds for R14-16 for now. Use R16B03-1 (commented out).
Internally a number of things have happened:
- We now assume we have syntax checked code.
- The checking and pattern/guard extraction functions are now function
  and macro specific which make things much simpler.
- Don't use a macro when you can use a function.
lfe_doc
===================

- Remove `#doc.arity` and update `patterns/1`, `do_patterns/2`
  and `make_doc/6` (now `make_doc/5`) accordingly.
- Remove redundant `is_proper_list/1` and `is_symb_list/1` imports.
- Add and use `name()` for the value of `#doc.name`:

      -type name() :: atom() | {atom(),non_neg_integer()}.

  i.e. `Name | {Name,Arity}`.
- Make some cosmetic tweaks to normalize `lfe_doc`.
- Make `pprint/2` smarter.
- Update `bin/lfedoc` to reflect the `#doc{}` changes.

prop_lfe_doc
=====================

- Update `prop_lfe_doc` to accommodate the aforementioned changes.
- Add a `case` expression to elegantly handle failures in `do_validate/2`
  and remove the unnecessary `exported=false` match.
- Remove the invalid `define-macro` shape from `validate/1`
  and only generate `define-macro` forms with `match-lambda`.
- Generate proper pattern clauses for macros, i.e.

      [[Pat,_Env]|_]

- Prefer `Pat` to `Patt`, to mirror `lfe_doc`.
- KISS and just use EUnit.
The visual "tests" are not meant to be compiled or run as such and
break the build on older OTP releases on Travis. Per discussion, move
them to dev so Travis won't try to build them.

Re-enable R16B03-1, R15B03 and R14B04 to see if they succeed now.
Unfortunately we could not use if internally even if we had wanted to
as we can not redefine core forms.
Delete trailing whitespace and replace semicolon with colon.

In inferior-lfe-mode, Emacs thinks the rest of the line
after a semicolon is a comment. A colon has no such meaning.
The new read is not line based which can cause unexpected behaviour so
also add read_line which is line oriented. The shell uses read_line.
This reads and prints the documentation for a module/function/macro.
This will now step through the code search path to find the module and
get its code. The module will not be loaded. This even if the module
is loaded as it is impossible to get the chunks from a loaded module.
And we can also print docs of multiple functions in one call.
Also took the chance to do a small cleanup of handling of attributes.
This make it more consistent over the forms. Also the handling of doc
strings has been changed in that we now can have multiple module doc
strings, there is one in the define-module and and one in each
extend-module. We ignore empty doc strings when outputting.
Move `example.lfe` to `dev/` and fix `bin/lfedoc`

Also fix some mistakes in example.lfe and use a define-function once
for good measure.
Also add describe as an alternate call to print module docs.
oubiwann and others added 18 commits May 19, 2017 17:08
These are documented as well. We also got some renaming of dev test
files.
It uses Erlang booleans and has the do-state variable.
Now we must work to get this really useful, it might be the easiest
way to run in Windows.
We now specially handle the case ?ERL_MACRO: and translate it to
(ERL_MACRO()):. This will translate nicely to LFE in many cases.

I am guessing we will end up with a lot of special cases here.
This needs more improving to get it nice.
Note the we call the general <<_:42,_:_*84>> form for a bitstring
while Erlang internally calls it a binary. The reason is that the
syntax handles the general bitstring case. We must flip internally
when translating Erlang<->LFE.
This needs to be fixed in spell1 so it works properly.
- Separate install target into install-{beam,bin}
- Use install's -t flag in install-{beam,bin}
- Add install-{beam,bin,man} to .PHONY
This way we can avoid compiler-generated case clause errors.
lfe_scan.xrl will get compiled to lfe_scan.erl during make compile,
which in turn will be compiled to lfe_scan.beam.
Since EBINS contains all the .erl and .xrl files with the ending
replaced by .beam it will contain lfe_scan.beam twice when executing
make install which may cause an error on execution.
@yurrriq
Copy link
Contributor

yurrriq commented Jun 14, 2017

Is there a way we could use $^ rather than shelling out?

@yurrriq
Copy link
Contributor

yurrriq commented Jun 14, 2017

Due to the implicit rules it looks like no. It also seems like if we simply remove the xrl part from EBINS then all will be well, maybe. According to a quick search on my phone, we don't have any .yrl files either, so maybe we could remove or comment out the related parts of the Makefile for clarity.

@starkertyp
Copy link
Contributor Author

Removing the .xrl part results in lfe_scan.beam not being generated on my system, which is why I tried this solution.

@yurrriq
Copy link
Contributor

yurrriq commented Jun 14, 2017

Ah ok.

@oubiwann
Copy link
Member

I'm going to take a look at this, but I'll probably close this PR, cherry pick the commits, and work on the issue in a new branch (i.e., any commits made so far will get full credit 😉).

@oubiwann
Copy link
Member

I've cherry-picked the original commit for this into a new PR on the LFE 2.0 branch).

Closing ....

@oubiwann oubiwann closed this Oct 14, 2020
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

Successfully merging this pull request may close these issues.

9 participants