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

PR - Fix build on alpine linux #3394

Closed
389-ds-bot opened this issue Sep 13, 2020 · 18 comments
Closed

PR - Fix build on alpine linux #3394

389-ds-bot opened this issue Sep 13, 2020 · 18 comments
Labels
closed Migration flag - PR pr Migration flag - PR

Comments

@389-ds-bot
Copy link

Cloned from Pagure Pull-Request: https://pagure.io/389-ds-base/pull-request/50335

  • Created at 2019-04-17 17:44:04 by codehotter
  • Merged at 2020-01-02 01:35:10

  • include nss as <cert.h> instead of <nss3/cert.h> - pkgconfig will pick up the proper include path
  • change #ifdef LINUX into #ifdef __GLIBC__ for malloc options so that we can build on musl
@389-ds-bot 389-ds-bot added closed Migration flag - PR pr Migration flag - PR labels Sep 13, 2020
@389-ds-bot
Copy link
Author

Comment from codehotter at 2019-04-24 11:14:43

Perhaps this should be done with configure instead of GLIBC define.

@389-ds-bot
Copy link
Author

Comment from firstyear (@Firstyear) at 2019-04-29 00:57:24

@codeHotter You might find that configure is adding nss3 into the include path, which is why the sources use cert.h not nss3/cert.h.

I'm also not sure about the ifdef linux to glibc change, because of the (potential) to build on freebsd which requires a distinction for those platform features. It could be better to determine why on alpine linux is not defined as true?

@389-ds-bot
Copy link
Author

Comment from codehotter at 2019-05-01 11:26:54

On alpine linux is defined as true, however, alpine uses musl which does not support mallopt. Since freebsd uses glibc but also does not support mallopt, that just further confirms that the glibc define is not the proper solution.

Perhaps ./configure could check for mallopt and it should be behind a mallopt ifdef instead. I'll try to see if I can get that to work. I will also test if it then builds on alpine, freebsd and fedora.

I'm not sure if I understand your nss3 comment. Do you support the change to include cert.h instead of nss3/cert.h, since configure is already adding nss3 to the include path? On alpine the include path is /usr/include/nss, which is why it breaks if we hardcode nss3 in the source.

@389-ds-bot
Copy link
Author

Comment from firstyear (@Firstyear) at 2019-05-02 00:48:40

@codeHotter Okay, so how about we make that "if linux && glibc" then around mallopt?

@kenoh What do you think about the nss3/cert.h change here?

(I'll defer to people to who know more about this than me :) )

@389-ds-bot
Copy link
Author

Comment from hmc at 2019-05-02 01:12:42

The NSS path issue also occurs on Debian-based systems, since cert.h exists in /use/include/nss. Note that this needs to be fixed in two places in the codebase.

@Firstyear Where is cert.h for you?

@389-ds-bot
Copy link
Author

Comment from firstyear (@Firstyear) at 2019-05-02 01:26:00

/usr/include/nss3/cert.h is the location on SUSE.

If it's an issue on debian that it's in /usr/include/nss then I think changing this to "nss3/cert.h" would break debian, because we need to -I the /usr/include/nss[3] into our configure process, so I think that changing this to <cert.h> and fixing our -I path is the right option here. I'd still like @kenoh's feedback though.

@389-ds-bot
Copy link
Author

Comment from hmc at 2019-05-02 13:31:15

@Firstyear Changing to <cert.h> (with no preceding path) is the correct fix. The recent pkg-config changes automatically generate the correct include path for nss.

I think this change should be a separate pull request.

@389-ds-bot
Copy link
Author

Comment from mhonek (@kenoh) at 2019-05-22 12:34:00

For the record, the <cert.h> issue was fixed in Hugh's PR 50352, commit 06c9f53 in master.

I'm not sure about the LINUX vs. __GLIBC__. @codeHotter what do you think about the William's proposal above?:

@codeHotter Okay, so how about we make that "if linux && glibc" then around mallopt?

@389-ds-bot
Copy link
Author

Comment from codehotter at 2019-06-11 08:41:34

The proper fix for this might be to check for it directly with configure, but that simple fix would certainly solve the problem for me.

@389-ds-bot
Copy link
Author

Comment from firstyear (@Firstyear) at 2019-06-11 11:16:05

So maybe we should rebase this ontop of 50352 (which is now master) and re-asses if more changes are needed around cert.h? Is that okay?

@389-ds-bot
Copy link
Author

Comment from firstyear (@Firstyear) at 2019-10-23 04:30:27

50352 has been merged, did you want me to finish this PR up?

@389-ds-bot
Copy link
Author

Comment from firstyear (@Firstyear) at 2019-12-17 00:54:34

@codeHotter Is this still an issue?

@389-ds-bot
Copy link
Author

Comment from codehotter at 2019-12-30 11:36:23

I've become much less enamored with alpine in general in the meantime, so I'm happy to close this, although I suspect some configure fix or ifdefs would still be necessary to make this work on alpine.

@389-ds-bot
Copy link
Author

Comment from firstyear (@Firstyear) at 2020-01-02 01:35:04

Sure. I'll close it and we can revive if there are requests. Currently I think the containerisation efforts are mainly driven by myself which means they'll be suse based, and that seems to be working today.

@389-ds-bot
Copy link
Author

Comment from firstyear (@Firstyear) at 2020-01-02 01:35:10

Pull-Request has been closed by Firstyear

@389-ds-bot
Copy link
Author

Patch
50335.patch

@kazimsarikaya
Copy link
Contributor

Hello, this patch is not working, I forked this repo and create several changes to build at alpine linux with commit kazimsarikaya/389-ds-base@f4e78a5

some of changes are based on the patch defined at #3394 (comment)

can you review changes? may be a pr can be created?

@vashirov
Copy link
Member

0dbdc11..9c7d590 389-ds-base-1.4.4 -> 389-ds-base-1.4.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed Migration flag - PR pr Migration flag - PR
Projects
None yet
Development

No branches or pull requests

3 participants