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

Trouble compiling on NixOS #164

Closed
magnetophon opened this issue Mar 26, 2021 · 14 comments
Closed

Trouble compiling on NixOS #164

magnetophon opened this issue Mar 26, 2021 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@magnetophon
Copy link
Contributor

Describe the bug
When I try to compile on NixOS, I get a lot of ld errors:

https://gist.github.com/magnetophon/24456c080ec3402cff26b5bca2353207

@magnetophon magnetophon added the bug Something isn't working label Mar 26, 2021
@jatinchowdhury18
Copy link
Owner

Oh wow, that is a lot of errors! This is strange, because it seems to be having trouble linking to the JUCE library code as though the JUCE code was never compiled, which makes no sense, since the output also shows that the JUCE library code was in fact compiled.

I wonder if there's something specific about the way NixOS compiles it that would break the JUCE module linking system... Would you have any insight as to what the differences are between compiling on other Linux distros (I use Ubuntu for the CI builds) and NixOS?

@magnetophon
Copy link
Contributor Author

FWIW, an older version compiles fine.

As to the differences between NixOS and other distros: there are a few (but I'm not the best person to list them).
For one, NixOS puts every package in it's own directory.

@jatinchowdhury18
Copy link
Owner

Hmm, I wonder if the older version was before I switched to the CMake compilation pipeline? Also was your build based on the master or the develop branch?

@magnetophon
Copy link
Contributor Author

The older version was indeed before cmake.
I am trying to build master.

@jatinchowdhury18
Copy link
Owner

Ah okay. So I've made a branch to work on this (see nix-os). What I've done for now is re-enable the Projucer interface, and the build_linux.sh script that was available before. Hopefully, this script will work as it did before. For now, I haven't enabled LV2 builds from the script, but if everything else works, it shouldn't be too hard to do. Would you mind giving it a try, and letting me know if it works for you?

While I'm fine with leaving the Projucer interface in the repo to help with making packaged builds like this, I'm not sure it's worth the effort to continually maintan both the Projucer and CMake build systems. I'll have to think about this a little bit more, but I'm wondering if you're comfortable with using the Projucer, in case you would need to make changes to the Projucer build system in the future?

@magnetophon
Copy link
Contributor Author

Thanks for making this!
It builds fine, but at the end it tries to write to home, which is not possible during a nix install.

It would be nice to get the cmake version working on nix.

@jatinchowdhury18
Copy link
Owner

Okay, glad that the building step works. Which step in the build is the one that tries to write to home?

For CMake builds, is it possible to build some of the JUCE examples plugins on NixOS?

@magnetophon
Copy link
Contributor Author

Which step in the build is the one that tries to write to home?

I was hoping you knew!

For CMake builds, is it possible to build some of the JUCE examples plugins on NixOS?

I'm sure it is.
How do I build them?

@jatinchowdhury18
Copy link
Owner

Which step in the build is the one that tries to write to home?

I was hoping you knew!

Haha, no worries. Would it be possible to share the terminal output to see where it gets stuck?

For CMake builds, is it possible to build some of the JUCE examples plugins on NixOS?

I'm sure it is.
How do I build them?

Here are instructions for building the JUCE examples with CMake.

@magnetophon
Copy link
Contributor Author

Here's the build error: https://gist.github.com/magnetophon/b228642642b4ec2f6adb2f8fede2488a

I'll go build the examples now.

@magnetophon
Copy link
Contributor Author

The examples build and run just fine.

@jatinchowdhury18
Copy link
Owner

Man, I'm pretty stumped on this one... I don't really get why the examples would build but the plugin won't. I have a couple ideas, but I feel like the best bet might be to find someone with a little bit more knowledge of this system.

Basically, I'm thinking that NixOS might not like that I compile the plugin dependencies as a static lib and then link the main plugin code to that lib (I do this so that CMake doesn't have to rebuild the JUCE modules for every plugin target). The counter-argument is that the linker errors were only occuring for JUCE code, any not for any of the other code in that library. I wonder if the fix might be as simple as setting different target properties for the static lib?

@SuperSandro2000
Copy link

The only suspicious lines I can find are

/nix/store/cp1sa3xxvl71cypiinw2c62i5s33chlr-binutils-2.35.1/bin/ar: CMakeFiles/juce_plugin_modules.dir/DISTRHO-JUCE/modules/juce_audio_utils/juce_audio_utils.cpp.o: plugin needed to handle lto object
/nix/store/cp1sa3xxvl71cypiinw2c62i5s33chlr-binutils-2.35.1/bin/ranlib: libjuce_plugin_modules.a(juce_audio_utils.cpp.o): plugin needed to handle lto object

but I am not sure if thats the issue.

@magnetophon
Copy link
Contributor Author

Fixed in #215

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

No branches or pull requests

3 participants