facebook / facebook/hhvm

hhbc regression: symlinks lead to duplicate definitions

Open
#8,719 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

**Describe the bug**

Symlinks between hack files lead to "More than one with the name "

**Standalone code, or other way to reproduce the problem**

```
$ cd $(mktemp -d)
$ cd src
$ echo "function foo(): void {}" > foo.hack
$ ln -s foo.hack bar.hack
$ cd ..
$ hhvm --hphp --target hhbc -l 3 --module src --output-dir $(pwd)/out
```

**Expected behavior**

Seen on 4.61 and below:

```
fredemmott@fredemmott-fbmbp foo % hhvm --hphp --target hhbc -l 3 --module src --output-dir $(pwd)/out
running hphp...
parsing inputs...
parsing inputs took 0'00" (35218 us) wall time
creating binary HHBC files...
running HHBBC...
committing units to repo...
running HHBBC took 0'00" (196002 us) wall time
committing units to repo took 0'00" (159245 us) wall time
creating binary HHBC files took 0'00" (210305 us) wall time
all files saved in /tmp/foo/out ...
running hphp took 0'01" (1156975 us) wall time
```
**Actual behavior**

Seen on 4.62:

```
fredemmott@fredemmott-fbmbp foo % hhvm --hphp --target hhbc -l 3 --module src --output-dir $(pwd)/out
running hphp...
parsing inputs...
parsing inputs took 0'00" (35182 us) wall time
creating binary HHBC files...
running HHBBC...
running HHBBC took 0'00" (4734 us) wall time
creating binary HHBC files took 0'00" (5000 us) wall time
running hphp took 0'00" (858870 us) wall time
std::exception: More than one function with the name foo. In src/foo.hack and src/bar.hack
hphp failed
running hphp took 0'00" (864919 us) wall time
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.