build2-packaging / google-benchmark

Build2 package for Google-Benchmark
Other
0 stars 1 forks source link

Incorrect output directory specification #13

Open boris-kolpackov opened 2 years ago

boris-kolpackov commented 2 years ago

There are lines in buildfile in the form:

benchmark/hxx{benchmark_orig}@./: install = false

Which need to be corrected to read:

benchmark/hxx{benchmark_orig}@benchmark/: install = false

In the upcoming 0.16.0 release these will cause warnings but in 0.17.0 it will be changed to error.

Below is the list of affected packages.

[public/1/stable/google-benchmark/google-benchmark-1.6.0+1.tar.gz:google-benchmark-1.6.0+1/include/buildfile]:benchmark/hxx{benchmark_orig}@./: install = false
[public/1/stable/google-benchmark/google-benchmark-1.6.0+1.tar.gz:google-benchmark-1.6.0+1/include/buildfile]:benchmark/hxx{benchmark_orig}@./: dist = false
[public/1/stable/google-benchmark/google-benchmark-1.6.0+1.tar.gz:google-benchmark-1.6.0+1/include/buildfile]:benchmark/hxx{benchmark}@./:

[public/1/stable/google-benchmark/google-benchmark-1.6.1+1.tar.gz:google-benchmark-1.6.1+1/include/buildfile]:benchmark/hxx{benchmark_orig}@./: install = false
[public/1/stable/google-benchmark/google-benchmark-1.6.1+1.tar.gz:google-benchmark-1.6.1+1/include/buildfile]:benchmark/hxx{benchmark_orig}@./: dist = false

[public/1/stable/google-benchmark/google-benchmark-1.7.0+1.tar.gz:google-benchmark-1.7.0+1/include/buildfile]:benchmark/hxx{benchmark_orig}@./: install = false
[public/1/stable/google-benchmark/google-benchmark-1.7.0+1.tar.gz:google-benchmark-1.7.0+1/include/buildfile]:benchmark/hxx{benchmark_orig}@./: dist = false
Swat-SomeBug commented 2 years ago

Hi @boris-kolpackov, Thanks for the heads up. I tried to change it but in my quick experiment, the form benchmark/hxx{benchmark_orig}@benchmark/: install = false form doesn't work with the current 0.15.0 release. Is it ok to keep this issue open until 0.16.0 releases?

boris-kolpackov commented 2 years ago

Hm, can you clarify what you mean by "doesn't work"? I've just tried it on a simple example, and it seems to work correctly both in 0.15.0 and 0.16.0.

Swat-SomeBug commented 2 years ago

I did the following experiments:

  1. In include/buildfile:
    benchmark/hxx{benchmark_orig}@./: install = false
    benchmark/hxx{benchmark_orig}@./: dist = false

    Command used: b install config.install.root=../install-root && b dist config.dist.root=../install-root Output of install:

    
    tree ../install-root/include/benchmark
    ------------------------------------------------
    ../install-root/include/benchmark
    ├── benchmark.h
    └── export.h

tree ../install-root/google-benchmark-1.7.0+1/include/benchmark

../install-root/google-benchmark-1.7.0+1/include/benchmark ├── benchmark.h └── export.h

Conclusion: The `@./:` form seems to work and not install nor distribute.

2. In `include/buildfile`:

benchmark/hxx{benchmark_orig}@benchmark/: install = false benchmark/hxx{benchmark_orig}@benchmark/: dist = false

Command used: `b install config.install.root=../install-root && b dist config.dist.root=../install-root`
Output of install:

tree ../install-root/include/benchmark

../install-root/include/benchmark ├── benchmark.h └── export.h

tree ../install-root/google-benchmark-1.7.0+1/include/benchmark

../install-root/google-benchmark-1.7.0+1/include/benchmark ├── benchmark.h └── export.h

Conclusion: The `@benchmark/:` form seems to work and does not install nor distribute.

3. In `include/buildfile`:

benchmark/hxx{benchmark_orig}@./: install = true benchmark/hxx{benchmark_orig}@./: dist = true

Command used: `b install config.install.root=../install-root && b dist config.dist.root=../install-root`
Output of install:

tree ../install-root/include/benchmark

../install-root/include/benchmark ├── benchmark.h └── export.h

tree ../install-root/google-benchmark-1.7.0+1/include/benchmark

../install-root/google-benchmark-1.7.0+1/include/benchmark ├── benchmark.h ├── benchmark_orig.h └── export.h

Conclusion: The `@./:` does not work as intended. `install` doesn't actually install `hxx[benchmark_orig}`, however, `dist` distributes the file correctly.

4. In `include/buildfile`:

benchmark/hxx{benchmark_orig}@benchmark/: install = true benchmark/hxx{benchmark_orig}@benchmark/: dist = true

Command used: `b install config.install.root=../install-root && b dist config.dist.root=../install-root`
Output of install:

tree ../install-root/include/benchmark

../install-root/include/benchmark ├── benchmark.h └── export.h

tree ../install-root/google-benchmark-1.7.0+1/include/benchmark

../install-root/google-benchmark-1.7.0+1/include/benchmark ├── benchmark.h ├── benchmark_orig.h └── export.h


Conclusion: The `@benchmark/:` does not work as intended. `install` doesn't actually install `hxx[benchmark_orig}`, however, `dist` distributes the file correctly.

In general both `@./` and `@benchmark/` form seem to work in the same manner ---> So yes, the change can be done now.
However, there is a difference between how `install` and `dist` are behaving. Any idea why `hxx{benchmark_orig}` doesn't install? Is it because `hxx{benchmark_orig}` is not a dependency of `./`?
boris-kolpackov commented 2 years ago

Any idea why hxx{benchmark_orig} doesn't install? Is it because hxx{benchmark_orig} is not a dependency of ./?

Yes, if it's not a prerequisite of any target, then it won't be installed (unlike dist, which considers any mentioned in the buildfile targets).