Skip to content

Rebuild not working properly after #213 #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
LKedward opened this issue Oct 30, 2020 · 3 comments · Fixed by #226
Closed

Rebuild not working properly after #213 #222

LKedward opened this issue Oct 30, 2020 · 3 comments · Fixed by #226
Labels
bug Something isn't working regression Something isn't working that previously did work

Comments

@LKedward
Copy link
Member

Since 4443986 (#213), changes to library sources do not trigger a rebuild of apps and tests.


To reproduce and demonstrate:

cd /tmp/
git clone [email protected]:fortran-lang/fpm.git
cd fpm/
cd bootstrap/
stack install
cd ../example_packages/hello_complex
fpm run
echo "!" >> source/greet_m.f90 
fpm run

The last fpm run command will rebuild the library, but not the apps or tests.

Output

~$ cd /tmp/
/tmp$ git clone [email protected]:fortran-lang/fpm.git
Cloning into 'fpm'...
remote: Enumerating objects: 206, done.
remote: Counting objects: 100% (206/206), done.
remote: Compressing objects: 100% (101/101), done.
remote: Total 2830 (delta 114), reused 178 (delta 100), pack-reused 2624
Receiving objects: 100% (2830/2830), 568.50 KiB | 1.49 MiB/s, done.
Resolving deltas: 100% (1569/1569), done.
/tmp$ cd fpm/
/tmp/fpm$ cd bootstrap/
/tmp/fpm/bootstrap$ stack install
DEPRECATED: The package at Repo from https://gitlab.com/everythingfunctional/hedge.git, commit 1c6cba3b5f8e52cf317f2421aaca13a0ddab4e92 in subdir . does not include a cabal file.
Instead, it includes an hpack package.yaml file for generating a cabal file.
This usage is deprecated; please see https://github.com/commercialhaskell/stack/issues/5210.
Support for this workflow will be removed in the future.

Building all executables for `fpm' once. After a successful build of all of them, only specified executables will be rebuilt.
fpm> configure (lib + exe)
Configuring fpm-0.1.0.0...
Warning: 'extra-source-files: ../README.md' is a relative path outside of the
source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'extra-source-files: ../ChangeLog.md' is a relative path outside of
the source tree. This will not work when generating a tarball with 'sdist'.
fpm> build (lib + exe)
Preprocessing library for fpm-0.1.0.0..
Building library for fpm-0.1.0.0..
[1 of 4] Compiling BuildModel
[2 of 4] Compiling Build
[3 of 4] Compiling Fpm
[4 of 4] Compiling Paths_fpm
Preprocessing executable 'fpm' for fpm-0.1.0.0..
Building executable 'fpm' for fpm-0.1.0.0..
[1 of 2] Compiling Main
[2 of 2] Compiling Paths_fpm
Linking .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/fpm/fpm ...
fpm> copy/register
Installing library in /tmp/fpm/bootstrap/.stack-work/install/x86_64-linux/624da27b4edec5b2a9682661e54b7da94a4de40ca862562a4526c1ddd57e9117/8.6.5/lib/x86_64-linux-ghc-8.6.5/fpm-0.1.0.0-ExRRX9W2aflLvTBBChPpxh
Installing executable fpm in /tmp/fpm/bootstrap/.stack-work/install/x86_64-linux/624da27b4edec5b2a9682661e54b7da94a4de40ca862562a4526c1ddd57e9117/8.6.5/bin
Registering library for fpm-0.1.0.0..
Copying from /tmp/fpm/bootstrap/.stack-work/install/x86_64-linux/624da27b4edec5b2a9682661e54b7da94a4de40ca862562a4526c1ddd57e9117/8.6.5/bin/fpm to /home/lk12325/.local/bin/fpm

Copied executables to /home/lk12325/.local/bin:
- fpm


/tmp/fpm$ cd ../example_packages/hello_complex
/tmp/fpm/example_packages/hello_complex$ fpm run
# gfortran (for build/gfortran_debug/hello_complex/source_subdir_constants.f90.o build/gfortran_debug/hello_complex/subdir_constants.mod)
# gfortran (for build/gfortran_debug/hello_complex/source_farewell_m.f90.o build/gfortran_debug/hello_complex/farewell_m.mod)
# gfortran (for build/gfortran_debug/hello_complex/source_greet_m.f90.o build/gfortran_debug/hello_complex/greet_m.mod)
# ar (for build/gfortran_debug/hello_complex/libhello_complex.a)
ar: creating build/gfortran_debug/hello_complex/libhello_complex.a
# gfortran (for build/gfortran_debug/apps/say_hello/apps_say_hello_say_Hello.f90.o)
# gfortran (for build/gfortran_debug/apps/say_hello/say_Hello)
# gfortran (for build/gfortran_debug/apps/say_goodbye/apps_say_goodbye_say_goodbye.f90.o)
# gfortran (for build/gfortran_debug/apps/say_goodbye/say_goodbye)
# gfortran (for build/gfortran_debug/tests/greet/tests_greet_greet_test.f90.o)
# gfortran (for build/gfortran_debug/tests/greet/greet_test)
# gfortran (for build/gfortran_debug/tests/farewell/tests_farewell_farewell_test.f90.o)
# gfortran (for build/gfortran_debug/tests/farewell/farewell_test)
 Hello, World!
 Goodbye, World!
/tmp/fpm/example_packages/hello_complex$ echo "!" >> source/greet_m.f90 
/tmp/fpm/example_packages/hello_complex$ fpm run
# gfortran (for build/gfortran_debug/hello_complex/source_greet_m.f90.o build/gfortran_debug/hello_complex/greet_m.mod)
 Hello, World!
 Goodbye, World!

@LKedward LKedward added bug Something isn't working fpm-haskell regression Something isn't working that previously did work labels Oct 30, 2020
@LKedward
Copy link
Member Author

LKedward commented Nov 1, 2020

@everythingfunctional, are you able to look into this?

@everythingfunctional
Copy link
Member

I'm pretty sure I know exactly what happened. Forgot a need archives in the build rules. I'm super busy today, but I should have time tomorrow to fix it.

@everythingfunctional
Copy link
Member

Also note, the build system is comparing file hashes for rebuilds, so adding a comment to the end of the file won't cause the .o or .mod files to be different, stopping the rebuild after that one step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Something isn't working that previously did work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants