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

surelog installs empty directories #3596

Closed
yurivict opened this issue Apr 16, 2023 · 15 comments
Closed

surelog installs empty directories #3596

yurivict opened this issue Apr 16, 2023 · 15 comments

Comments

@yurivict
Copy link

It installs this empty directory hierarchy:

/usr/local/share/surelog
/usr/local/share/surelog/pkg
/usr/local/share/surelog/pkg/work

It doesn't make sense to install empty directories into a read-only location.

@timkpaine
Copy link
Collaborator

ovm_pkg.sv.slpa ovm_pkg.sv.slpp uvm_pkg.sv.slpa uvm_pkg.sv.slpp are in that folder

@yurivict
Copy link
Author

@timkpaine

cmake didn't install anything into that folder.
What might be wrong?

@timkpaine
Copy link
Collaborator

@yurivict you really need to get into the habit of posting configuration, commands, and logs. This is not the first time you've failed to do so, and it's difficult to provide any help without them. This is a good guide, in particular the repro section: https://stackoverflow.com/help/how-to-ask

@yurivict
Copy link
Author

I don't provide details because I don;t build by hand typing in commands.
The build is done by standard cmake commands that are used for thousands of other packages.
It means that in default configuration under common conditions these directories are left empty.

Here is a complete build log showing that these directories are installed empty.

@timkpaine
Copy link
Collaborator

timkpaine commented Apr 16, 2023

standard

I can tell from the logs that this is untrue, just look at all the manually specified cmake variables. We test heavily across lots of different configurations and operating systems, if you're not comfortable debugging issues yourself the exact sequence of cmake commands, environment variable overrides, and other information about the system is essential.

@yurivict
Copy link
Author

They are not manually specified - they are set like this by the ports framework. When qBittorrent is built - the config line is largely the same.

@timkpaine
Copy link
Collaborator

timkpaine commented Apr 16, 2023

These lines build the precompiled assets: https://github.com/chipsalliance/Surelog/blob/master/CMakeLists.txt#L721
And they get installed a bit later: https://github.com/chipsalliance/Surelog/blob/master/CMakeLists.txt#L815

Your logs show the assets being built, but they maybe they're not ending up in the right output folder. We set the var here: https://github.com/chipsalliance/Surelog/blob/master/CMakeLists.txt#L140

You can see the correct installation in CI: https://github.com/chipsalliance/Surelog/actions/runs/4710503128/jobs/8354210283#step:7:240

I would try to build outside of any framework which might set lots of different CMake vars, and see if that yields a different result. It's possible that we rely on a variable without setting it. You could also try removing these redirects and/or checking the build logs to see if they ended up in a different folder: https://github.com/chipsalliance/Surelog/blob/master/CMakeLists.txt#L731

You also might be setting QUICK_COMP, as I don't see the last linking step that I see in CI

@yurivict
Copy link
Author

yurivict commented Apr 16, 2023

BTW, did you test build with a stage directory? My builds use stage directory.

make build install DESTDIR=/tmp/surelog-stagedir

@timkpaine
Copy link
Collaborator

timkpaine commented Apr 16, 2023

No, I would normally only use that for makefile-driven projects, we just use makefiles as a scripting layer, so I wouldn't really expect that to work (unless running from inside the cmake build folder). I think PREFIX dictates the path we use for cmake so it would be make build install PREFIX=/tmp/surelog-stagedir, or if running from cmake directly use CMAKE_INSTALL_PREFIX.

@yurivict
Copy link
Author

No, all packaging systems use stage directories because they don't need to install into $PREFIX in order to create a package.

stage directories work only at the level of 'make', not 'cmake', with the above command.
Some projects are broken when stage directory is used. It looks like this might be the case for Surelog.

@yurivict
Copy link
Author

CMAKE_INSTALL_PREFIX is just the $PREFIX variable value. stage directory is prepended to it by make.

@yurivict
Copy link
Author

In my build directory work/.build work/.build/bin/pkg is empty.

@timkpaine
Copy link
Collaborator

timkpaine commented Apr 16, 2023

stage directories work only at the level of 'make', not 'cmake', with the above command. Some projects are broken when stage directory is used. It looks like this might be the case for Surelog.

We don't have any dependency on make, I would avoid trying to mix make and cmake when you build and install. Either run the vanilla make install or use standard cmake args to configure your build.

@yurivict
Copy link
Author

Either make or ninja are always run as a backend of cmake.

@timkpaine
Copy link
Collaborator

Either make or ninja are always run as a backend of cmake.

Or e.g. visual studio, but the point stands. The top level makefile != the makefiles generated by cmake and shouldn't be treated as such.

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

No branches or pull requests

2 participants