trelau / SMESH

Mesh module from the Salome Platform
GNU Lesser General Public License v2.1
50 stars 31 forks source link

Required submodules should be included in archive #38

Open hobbes1069 opened 3 years ago

hobbes1069 commented 3 years ago

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.

trelau commented 3 years ago

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.

hobbes1069 commented 3 years ago

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.

trelau commented 3 years ago

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

trelau commented 3 years ago

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 commented 3 years ago

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 .

hobbes1069 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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.

looooo commented 2 years ago

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

hobbes1069 commented 2 years ago

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

hobbes1069 commented 2 years ago

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 commented 2 years ago

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