Skip to content
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

Get rid of CGO #4342

Open
cirocosta opened this issue Sep 3, 2019 · 6 comments
Open

Get rid of CGO #4342

cirocosta opened this issue Sep 3, 2019 · 6 comments
Labels

Comments

@cirocosta
Copy link
Member

@cirocosta cirocosta commented Sep 3, 2019

What challange are you facing?

At the moment, cross compiling Concourse to multiple platforms
from a given OS is hard (maybe even not possible?) given that we
end up having to compile native code.

I'm pretty sure there are other good reasons to remove it
(performance and safety-wise) too, although I didn't think much
about it (aside from remembering that we had to deal with a mem
leak at some point that was hard to figure out as the memory
allocations were not tracked by Go).

What would make this better?

Remove the dependencies that we introduced that brought CGO to
our codebase:

  • go-sqlite (from dex)
    - I guess we could somehow disable the "plugin-based"
    introduction of it
  • zstd
    - we could replace it with something like pierrec/lz4
    which is all go-based

thanks!

@jchesterpivotal

This comment has been minimized.

Copy link
Contributor

@jchesterpivotal jchesterpivotal commented Sep 3, 2019

For zstd, there appear to be pure-go implementations:

@kcmannem

This comment has been minimized.

Copy link
Member

@kcmannem kcmannem commented Sep 4, 2019

@jchesterpivotal thanks for the links, gunna look into this.

@stale

This comment has been minimized.

Copy link

@stale stale bot commented Nov 3, 2019

Beep boop! This issue has been idle for long enough that it's time to check in and see if it's still important.

If it is, what is blocking it? Would anyone be interested in submitting a PR or continuing the discussion to help move things forward?

If no activity is observed within the next week, this issue will be exterminated closed, in accordance with our stale issue process.

@stale stale bot added the wontfix label Nov 3, 2019
@cirocosta

This comment has been minimized.

Copy link
Member Author

@cirocosta cirocosta commented Nov 4, 2019

🙌

@cirocosta

This comment has been minimized.

Copy link
Member Author

@cirocosta cirocosta commented Dec 23, 2019

One more reason to double down on removing cgo: with the -trimpath compile flag we could get reproducible concourse builds (e.g. k14s/kapp@b645918)

-trimpath prefix
Remove prefix from recorded source file paths.

(from https://golang.org/cmd/compile/)

@pivotal-jamie-klassen

This comment has been minimized.

Copy link
Contributor

@pivotal-jamie-klassen pivotal-jamie-klassen commented Jan 14, 2020

Happy to see #4621 (comment) stepping in the right direction. Too bad that using dex means opting into CGO...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.