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

Compiling Himmelblau on Ubuntu 24.04 #166

Closed
run-stop opened this issue Aug 30, 2024 · 16 comments · Fixed by #167 or #169
Closed

Compiling Himmelblau on Ubuntu 24.04 #166

run-stop opened this issue Aug 30, 2024 · 16 comments · Fixed by #167 or #169

Comments

@run-stop
Copy link
Collaborator

I'm following the instructions from the homepage to install Ubuntu packages. The only difference is that I had to use libclang-dev instead of libclang-13-dev. On the fresh Ubuntu 24.04 LTS Desktop VM, I've installed the Ubuntu packages:

sudo apt-get install libpam0g-dev libudev-dev libssl-dev pkg-config tpm-udev libtss2-dev libcap-dev libtalloc-dev libtevent-dev libldb-dev libdhash-dev libkrb5-dev libpcre2-dev libclang-dev autoconf gettext

I've used rustup to install Rust toolchain.

The make process fails as follows:

error: failed to run custom build command for `idmap v0.5.0 (/home/aleksandar-miljkovic/AD/himmelblau/src/idmap)`

Caused by:
  process didn't exit successfully: `/home/user/AD/himmelblau/target/debug/build/idmap-afd29ee2208ec77e/build-script-build` (exit status: 101)
  --- stderr
  sssd/src/external/libpcre.m4:20: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but not m4_defun'd
  sssd/src/build_macros.m4:42: SSS_AC_EXPAND_LIB_DIR is expanded from...
  sssd/src/external/libpcre.m4:20: the top level
  configure:4374: error: possibly undefined macro: AC_LIB_PREPARE_PREFIX
        If this token and others are legitimate, please use m4_pattern_allow.
        See the Autoconf documentation.
  configure:4377: error: possibly undefined macro: AC_LIB_WITH_FINAL_PREFIX
  autoreconf: error: /usr/bin/autoconf failed with exit status: 1
  thread 'main' panicked at src/idmap/build.rs:14:9:
  Failed to configure sss_idmap
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
make: *** [Makefile:3: all] Error 101

Any suggestions on fixing this? I would like to build Ubuntu packages and test them on 24.04, 22.04 and possibly 20.04.

Thank you in advance!

@dmulder
Copy link
Collaborator

dmulder commented Aug 30, 2024

Sounds like that m4 macro is defined in gettext.

@run-stop
Copy link
Collaborator Author

After adding several dependencies, and appending the SAMBA4 include header folder to the CFLAGS variable, rust compiler fails complaining about missing msal crate. Then I've added the missing crate to several modules (himmelblu_unix_common and kandim_utils_users), but then finally Rust compailer failed complaining that msal library has a missing dependency of msal crate...

@mw-a
Copy link
Contributor

mw-a commented Sep 2, 2024

Same here on current Debian testing. It seems, libhimmelblau 0.2.7+ has gone incompatible with himmelblau by renaming itself from msal to himmelblau and changing at least some of its API. Pinning it to =0.2.6 in Cargo.toml is a workaround. Upping it to 0.2.7 and changing msal:: to himmelblau:: in src/common/src/idprovider/himmelblau.rs gets me as far as:

   Compiling himmelblau_unix_common v0.5.0 (/home/m/himmelblau/src/common)                                                                                                                                                                                                        
error[E0308]: mismatched types                                                                                                                                                                                                                                                    
    --> src/common/src/idprovider/himmelblau.rs:1426:28                                                                                                                                                                                                                           
     |                                                                                                                                                                                                                                                                            
1426 |             .enroll_device(token, attrs, tpm, machine_key)                                                                                                                                                                                                                 
     |              ------------- ^^^^^ expected `&str`, found `&UserToken`                                                                                                                                                                                                       
     |              |                                                                                                                                                                                                                                                             
     |              arguments to this method are incorrect                                                                                                                                                                                                                        
     |                                                                                                                                                                                                                                                                            
     = note: expected reference `&str`                                                                                                                                                                                                                                            
                found reference `&himmelblau::UserToken`                                                                                                                                                                                                                          
note: method defined here                                                                                                                                                                                                                                                         
    --> /home/m/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libhimmelblau-0.2.9/src/auth.rs:1977:18                                                                                                                                                                      
     |                                                                                                                                                                                                                                                                            
1977 |     pub async fn enroll_device(                                                                                                                                                                                                                                            
     |                  ^^^^^^^^^^^^^                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                  
For more information about this error, try `rustc --explain E0308`.             

@dmulder
Copy link
Collaborator

dmulder commented Sep 3, 2024

Hrm, sorry for the confusion. I thought I had worked out all those kinks. Yes, you need libhimmelblau pinned at 0.2.6 to build.

@dmulder
Copy link
Collaborator

dmulder commented Sep 3, 2024

And yes, I made some small changes to the API. I probably should have included a major version change with that.

@dmulder
Copy link
Collaborator

dmulder commented Sep 3, 2024

Well, looks like I did work out those kinks, but in branch stable-0.4.x. Are you trying to build main?

@mw-a
Copy link
Contributor

mw-a commented Sep 3, 2024

Are you trying to build main?

I am indeed.

@dmulder
Copy link
Collaborator

dmulder commented Sep 3, 2024

Do you know which additional dependencies you needed in order to build on Ubuntu 24.04? It would be good to add that to the documentation.

@mw-a
Copy link
Contributor

mw-a commented Sep 3, 2024

@run-stop posted his list in #166 (comment). As I'm on Debian testing, my list is not very helpful - although I should be able to cobble it together still.

@dmulder
Copy link
Collaborator

dmulder commented Sep 3, 2024

@run-stop posted his list in #166 (comment). As I'm on Debian testing, my list is not very helpful - although I should be able to cobble it together still.

I think that's just the list I already have documented, @run-stop later says: "After adding several dependencies...". I'm wondering which others were added.

@mw-a
Copy link
Contributor

mw-a commented Sep 3, 2024

What both @run-stop and I seem to need to do as well is to add samba includes to the compiler search path in order for ldb.h to be found. I'm currently doing this crudely like so:

CFLAGS="-I/usr/include/samba-4.0" make

Is this something that could be addressed easily?

@dmulder
Copy link
Collaborator

dmulder commented Sep 3, 2024

What both @run-stop and I seem to need to do as well is to add samba includes to the compiler search path in order for ldb.h to be found. I'm currently doing this crudely like so:

CFLAGS="-I/usr/include/samba-4.0" make

Is this something that could be addressed easily?

I'll see what I can do.

dmulder added a commit that referenced this issue Sep 3, 2024
dmulder added a commit that referenced this issue Sep 3, 2024
@dmulder dmulder reopened this Sep 3, 2024
@dmulder
Copy link
Collaborator

dmulder commented Sep 3, 2024

@mw-a could you check if #169 fixes your build problem?

@mw-a
Copy link
Contributor

mw-a commented Sep 4, 2024

@dmulder Yes, it does. And I understand that with #167 merged, main does now also build without modification with libhimmelblau 0.2.9+. Awesome! :)

FWIW: Here's my package list for current Debian testing: libpam0g-dev libudev-dev libssl-dev pkg-config tpm-udev libtss2-dev libcap-dev libtalloc-dev libtevent-dev libldb-dev libdhash-dev libkrb5-dev libpcre2-dev libclang-dev autoconf gettext cargo libsqlite3-dev

This is basically your documented list with libclang-dev instead of libclang-13-dev (as Debian is at 16 currently) plus cargo (pulls in the rust toolchain I guess) and libsqlite3-dev (otherwise libnss_himmelblau and aad-tool do not link with note: /usr/bin/ld: cannot find -lsqlite3).

@dmulder
Copy link
Collaborator

dmulder commented Sep 4, 2024

@dmulder Yes, it does. And I understand that with #167 merged, main does now also build without modification with libhimmelblau 0.2.9+. Awesome! :)

Perfect!

FWIW: Here's my package list for current Debian testing: libpam0g-dev libudev-dev libssl-dev pkg-config tpm-udev libtss2-dev libcap-dev libtalloc-dev libtevent-dev libldb-dev libdhash-dev libkrb5-dev libpcre2-dev libclang-dev autoconf gettext cargo libsqlite3-dev

This is basically your documented list with libclang-dev instead of libclang-13-dev (as Debian is at 16 currently) plus cargo (pulls in the rust toolchain I guess) and libsqlite3-dev (otherwise libnss_himmelblau and aad-tool do not link with note: /usr/bin/ld: cannot find -lsqlite3).

Those are the same dependencies I found in my testing yesterday. I'll add those to the documentation.

@dmulder
Copy link
Collaborator

dmulder commented Sep 4, 2024

I've corrected the README to list those additional dependencies for Debian based distros.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants