go-aah / aah

A secure, flexible, rapid Go web framework
https://aahframework.org
MIT License
690 stars 33 forks source link

Exclude PID files from single binary build #206

Closed joelsdc closed 6 years ago

joelsdc commented 6 years ago

Please answer these questions before submitting your issue. Thanks!

What version of aah are you using (aah --version)?

$ aah --version
cli v0.12.1
aah v0.11.2
go  v1.10.3

Does this issue reproduce with the latest release?

Yes

What operating system are you using (such as macOS, Linux and Windows)?

macOS

What did you do?

Have any *.pid file in your build path, run aah build --single, if you run your application with -list you will see the PID files there although they are listed in the exclude in the aah.project file.

This doesn't happen if you do not specify the --single, on regular builds the files are excluded correctly.

What did you expect to see?

The PID files not being included.

Additional context

I think the problem is not specifically related to PID files, but more to the exclude tag inside aah.project being ignored when building single binary.

jeevatkm commented 6 years ago

@joelsdc Thanks for reporting an issue. I will analyze and address it.

jeevatkm commented 6 years ago

@joelsdc I'm analysis the issue. I need one more info.

joelsdc commented 6 years ago

Hi @jeevatkm, this is the output:

✔ ~/go/src/git.example.com/ops/voice-api [master|✚ 1]
20:26 $ aah b -s
---------------------------------------------------------------
                    aah framework v0.11.2
---------------------------------------------------------------
# Report improvements/bugs at https://aahframework.org/issues #

Loaded aah project file: /Users/joel/go/src/git.example.com/ops/voice-api/aah.project
Build starts for 'voice-api' [git.example.com/ops/voice-api]
Embed starts for 'voice-api' [git.example.com/ops/voice-api]
|-- Processing mount: '/app' <== '/Users/joel/go/src/git.example.com/ops/voice-api'
     |-- Skipping: /Users/joel/go/src/git.example.com/ops/voice-api/.DS_Store
     |-- Skipping: /Users/joel/go/src/git.example.com/ops/voice-api/.git
     |-- Skipping: /Users/joel/go/src/git.example.com/ops/voice-api/.gitignore
     |-- Skipping: /Users/joel/go/src/git.example.com/ops/voice-api/app
     |-- Skipping: /Users/joel/go/src/git.example.com/ops/voice-api/build
     |-- Skipping: /Users/joel/go/src/git.example.com/ops/voice-api/logs
     |-- Skipping: /Users/joel/go/src/git.example.com/ops/voice-api/run_dev.sh
     |-- Skipping: /Users/joel/go/src/git.example.com/ops/voice-api/voice-api.pid
     |-- Processing: /Users/joel/go/src/git.example.com/ops/voice-api/voice-api.service
     |-- Processing: /Users/joel/go/src/git.example.com/ops/voice-api/aah.project
     |-- Processing: /Users/joel/go/src/git.example.com/ops/voice-api/config/env/prod.conf
     |-- Processing: /Users/joel/go/src/git.example.com/ops/voice-api/config/security.conf
     |-- Processing: /Users/joel/go/src/git.example.com/ops/voice-api/php/application__models__Numberings_m.php
     |-- Processing: /Users/joel/go/src/git.example.com/ops/voice-api/php/application__models__Portabilidadesasep_m.php
     |-- Processing: /Users/joel/go/src/git.example.com/ops/voice-api/php/application__models__Operators_m.php
     |-- Processing: /Users/joel/go/src/git.example.com/ops/voice-api/README.md
     |-- Processing: /Users/joel/go/src/git.example.com/ops/voice-api/config/aah.conf
     |-- Processing: /Users/joel/go/src/git.example.com/ops/voice-api/config/env/dev.conf
     |-- Processing: /Users/joel/go/src/git.example.com/ops/voice-api/config/routes.conf
     |-- Processing: /Users/joel/go/src/git.example.com/ops/voice-api/php/application__controllers__Api.php
Embed successful for 'voice-api' [git.example.com/ops/voice-api]
Compile starts for 'voice-api' [git.example.com/ops/voice-api]
Cleaning /Users/joel/go/src/git.example.com/ops/voice-api/app/aah.go
Cleaning build directory /Users/joel/go/src/git.example.com/ops/voice-api/build
Compile successful for 'voice-api' [git.example.com/ops/voice-api]
Build successful for 'voice-api' [git.example.com/ops/voice-api]
Application artifact is here: /Users/joel/go/src/git.example.com/ops/voice-api/build/voice-api-310329e-dirty-darwin-amd64.zip

✔ ~/go/src/git.example.com/ops/voice-api [master|✚ 1]
20:26 $
joelsdc commented 6 years ago

Hi @jeevatkm,

To add to my previous post:

20:26 $ unzip /Users/joel/go/src/git.example.com/ops/voice-api/build/voice-api-310329e-dirty-darwin-amd64.zip
Archive:  /Users/joel/go/src/git.example.com/ops/voice-api/build/voice-api-310329e-dirty-darwin-amd64.zip
  inflating: voice-api
✘-1 ~/go/src/git.example.com/ops/voice-api [master|✚ 1…1]
20:52 $ ./voice-api -list "." | grep -i pid
✘-1 ~/go/src/git.example.com/ops/voice-api [master|✚ 1…1]
20:52 $ 

Weird...

joelsdc commented 6 years ago

Strange thing is, for SURE I have single-binary builds with the PID files in them! But I'm trying to reproduce again

jeevatkm commented 6 years ago

@joelsdc Thank you for the details. FYI I have analyzed the CLI release version on three platform (macOS, Linux, Windows) so far I'm unable to reproduce. I will continue my investigation and keep you posted.

jeevatkm commented 6 years ago

@joelsdc If you identify any clue on this, please let me know.

joelsdc commented 6 years ago

Hi @jeevatkm, I have not been able to reproduce. I'll pay attention to my next builds to see if it happens again and how I did it. Closing this one for now... Sorry for the noise.

jeevatkm commented 6 years ago

@joelsdc Its not a noise. Its better to verify and confirm. Even when you're in doubt feel free to create an issue to clarify.