SMESH icon indicating copy to clipboard operation
SMESH copied to clipboard

Required submodules should be included in archive

Open hobbes1069 opened this issue 4 years ago • 12 comments

I'm working on packaging this fork of smesh for Fedora as a dependency for freecad.

The submodules should be in the posted archives to be useful for distro packaging.

hobbes1069 avatar Feb 21 '21 21:02 hobbes1069

instead of including the submodules, would it be acceptable to package up the processed sources after running the prepary.py script and attaching in the release?

So perhaps in the Github action, if it's building a release we store the necessary sources as an artifact, and then be sure and attach those files.

trelau avatar Feb 21 '21 22:02 trelau

I think we're saying the same thing :) But yes, in other projects that use sub-modules the sources are included in the release, I'm not sure of the actual mechanics of it though whether it's manual or automated in github somehow.

hobbes1069 avatar Feb 22 '21 12:02 hobbes1069

fyi seems like relevant convo happening here https://github.com/trelau/SMESH/pull/39

trelau avatar Feb 23 '21 10:02 trelau

Following on from #39 , this (or something like it) may be relevant to create source artifacts and attach to a Github release, programmatically https://github.com/actions/upload-release-asset

trelau avatar Feb 23 '21 10:02 trelau

Looking at the SMESH repo, it seems like the following files would be required to be in the source artifact to enable building locally:

  1. CMakeLists.txt
  2. LICENSE.txt
  3. README.md
  4. src/*
  5. test/*

Files 2 and 3 are put in there for good measure, and the src would include the source files to build after the prepare.py script is run. Based on what I'm seeing, it seems feasible to make this all happen via Github Actions.

@hobbes1069 would packaging up the files above and making available (per platform) attached to a Github release meet the need? Also same question to @looooo .

trelau avatar Feb 23 '21 11:02 trelau

Yes, sorry, I saw the notification email but then got busy with $DAYJOB and $LIFE. I don't know about other distros but on Fedora internet access is not available during an official build. Everything needed to build the package should be in the archive.

I could technically create a script to run prepare.py in Fedora's dist git and upload my own created archive but this does not guarantee a reproducible output for SHA verification so is not preferred.

hobbes1069 avatar Mar 13 '21 13:03 hobbes1069

Getting back to this... It's a bit cumbersome to make a packaging worthy archive but doable.

git clone <SMESH REPO>
cd SMESH
git archive --prefix smesh-<VERSION>/ -o smesh-<VERSION>.tar v<VERSION TAG>
python prepare.py
tar --transform='s,^src,smesh-<VERSION>/src,' -rf smesh-<VERSION>.tar src/*
gzip smesh-<VERSION>.tar

You can't append files to a gzipped tar so have to start with a plain tar file first.

hobbes1069 avatar Jul 24 '21 12:07 hobbes1069

I don't want to open a new issue for this just yet, but should the SOVERSION of the library be set to something? It's really required for Fedora so if one won't be maintained I'll have to do it manually in the packaging.

hobbes1069 avatar Jul 24 '21 13:07 hobbes1069

I guess we should not make the prepare-step part of the archive as it is platform-specific. I would simple make a archive of the repo and the necessary subrepos and call the prepare.py during the build process. What do you think @hobbes1069

looooo avatar Oct 31 '21 10:10 looooo

Sounds good to me as long as I have a single self-contained archive that I can use for packaging :)

hobbes1069 avatar Oct 31 '21 20:10 hobbes1069

Trying to update to 9.7.0.1 and getting this when running prepare.py:

Traceback (most recent call last):
  File "/tmp/smesh-e3nc0Cuvth/prepare.py", line 149, in <module>
    prepare_netgen()
  File "/tmp/smesh-e3nc0Cuvth/prepare.py", line 17, in prepare_netgen
    shutil.copytree('external/Netgen/libsrc', 'src/Netgen/libsrc')
  File "/usr/lib64/python3.10/shutil.py", line 554, in copytree
    with os.scandir(src) as itr:
FileNotFoundError: [Errno 2] No such file or directory: 'external/Netgen/libsrc'

Am I missing something?

hobbes1069 avatar Jan 30 '22 16:01 hobbes1069

Never mind, I had forgotten about --recurse-submodules.

hobbes1069 avatar Jan 30 '22 17:01 hobbes1069