mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: Andreas Helmcke <ahelmcke@ela-soft.com>
Cc: ptxdist@pengutronix.de
Subject: Re: [ptxdist] Problems with own get rule
Date: Fri, 29 Jul 2022 14:02:50 +0200	[thread overview]
Message-ID: <20220729120250.GE20240@pengutronix.de> (raw)
In-Reply-To: <c4ea4cd6-a388-e046-c0a6-b624f8b78129@ela-soft.com>

On Fri, Jul 29, 2022 at 01:23:22PM +0200, Andreas Helmcke wrote:
> Hello,
> 
> Am 29.07.22 um 12:54 schrieb Michael Olbrich:
> > On Fri, Jul 29, 2022 at 12:48:59PM +0200, Michael Olbrich wrote:
> >> On Fri, Jul 29, 2022 at 12:37:50PM +0200, Andreas Helmcke wrote:
> >>> Hello,
> >>>
> >>> i have defined my own get rule to fetch some sources from svn. I did not use the buildin svn support because:
> >>> 1. there are different svn targets which must get checked out to specific directories
> >>> 2. i want to use tags, not revision numbers
> >>>
> >>> This works pretty well, there is only one problem.
> >>>
> >>> After ptxdist menuconfig is called to change the version number, the compile step fails with missing directory because the get rule wont get called. It should, since the source directory does not exists (the directory name contains the version (tag) name).
> >>>
> >>> Any advice is appreciated.
> >>
> >> Which PTXdist version? I think with a current version, foo.get should be
> >> called whenever the value of $(FOO) changes.
> 
> ptxdist version: 2022.05.0
> 
> > It's only used indirectly via FOO_SOURCE. Try setting:
> >
> > FOO_SOURCE        := $(FOO_SRC_DIR)
> 
> this produces a circular dependency:
> 
> make: Circular .../svn_src/foo-V2.00.01-B2 <- .../svn_src/foo-V2.00.01-B2 dependency dropped.

Hmmm, so maybe you will need to find another way. In general ptxdist uses
make here and it generates the dependencies and has default implemenations
for certain targets.
For the 'get' part, ptxdist works like this:

If there is something to download, then it expects $(FOO_SOURCE) to refer
to a single file that contains all the source. PTXdist will denn generate a
make target that handles the download based on $(FOO_URL).

The foo.get stage has a existence only dependency on $(FOO_SOURCE). This
means that it is not triggered when the timestamp for $(FOO_SOURCE)
changes.
This stage will mostly check if the md5 matches.

Now, you can overwrite foo.get with something else, but then you need to
have your own dependencies that trigger foo.get.

Maybe something like this:

$(STATEDIR)/foo.$(FOO_VERSION):
	@$(call touch)

$(STATEDIR)/foo.get: $(STATEDIR)/foo.$(FOO_VERSION)
	...

Michael

> >>> The make file has this rules:
> >>>
> >>>> #
> >>>> # We provide this package
> >>>> #
> >>>> PACKAGES-$(PTXCONF_FOO) += foo
> >>>>
> >>>> #
> >>>> # Paths and names
> >>>> #
> >>>> FOO_VERSION    := $(call ptx/config-version, PTXCONF_FOO)
> >>>> FOO_MD5        :=
> >>>> FOO        := foo-$(FOO_VERSION)
> >>>> FOO_SRC_DIR    := $(PTXDIST_WORKSPACE)/svn_src/$(FOO)
> >>>> FOO_URL        := lndir://$(FOO_SRC_DIR)
> >>>> FOO_DIR        := $(BUILDDIR)/$(FOO)
> >>>> FOO_LICENSE    := unknown
> >>>>
> >>>> FOO_SVN_BASE_URL := \
> >>>>     https://subversion.company.com/entwicklung/foo_bar/foo/tags/$(FOO_VERSION)
> >>>>
> >>>> # ----------------------------------------------------------------------------
> >>>> # Get
> >>>> # ----------------------------------------------------------------------------
> >>>>
> >>>> $(STATEDIR)/foo.get:
> >>>>     @$(call targetinfo)
> >>>>     @$(call clean, $(FOO_SRC_DIR))
> >>>>     @svn export \
> >>>>         $(FOO_SVN_BASE_URL)/foo/phyCard-release $(FOO_SRC_DIR)/foo/phyCard-release
> >>>>     @svn export \
> >>>>         $(FOO_SVN_BASE_URL)/foo/src $(FOO_SRC_DIR)/foo/src
> >>>>     @$(call touch)
> >>>>
> >>>>
> >>>> # ----------------------------------------------------------------------------
> >>>> # Extract
> >>>> # ----------------------------------------------------------------------------
> >>>>
> >>>> $(STATEDIR)/foo.extract:
> >>>>     @$(call targetinfo)
> >>>>     @$(call clean, $(FOO_DIR))
> >>>>     @$(call extract, FOO)
> >>>>     @$(call patchin, FOO)
> >>>>     @$(call touch)
> >>>
> >>>
> >>
> >> -- 
> >> Pengutronix e.K.                           |                             |
> >> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> >> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> >> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> >>
> >>
> >
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



  reply	other threads:[~2022-07-29 12:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-29 10:37 Andreas Helmcke
2022-07-29 10:48 ` Michael Olbrich
2022-07-29 10:54   ` Michael Olbrich
2022-07-29 11:23     ` Andreas Helmcke
2022-07-29 12:02       ` Michael Olbrich [this message]
2022-07-29 12:53         ` Andreas Helmcke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220729120250.GE20240@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ahelmcke@ela-soft.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox